Status update (September 2026): Drift Protocol was exploited for approximately $285M on April 1, 2026 — the largest DeFi hack of the year. The team rebranded to Velocity DEX on July 1, 2026 and is relaunching as a USDT-settled perpetuals exchange backed by a Tether credit line, with public relaunch targeted for Q3 2026. BET prediction markets are not part of the announced relaunch scope. Everything below describes the Drift v2 BET architecture as it operated through March 2026 — still the reference for how Solana-native prediction markets were built, but not a live integration target. For active alternatives, see Rain Protocol and Polymarket.

Verdict: was the most developer-friendly path to Solana prediction markets — currently offline pending the Velocity relaunch. Drift BET inherits Drift v2’s mature infrastructure — battle-tested SDKs, a self-hosted Gateway for agent execution, delegation for safety, and deep on-chain liquidity. The tradeoff is complexity: this is not a REST API you can call in 10 minutes. You’re integrating with Solana’s transaction model, Drift’s account system, and prediction-market-specific mechanics that differ from standard perps.

What Drift BET is

Drift BET is not a separate chain, wallet standard, or SDK. It is a special class of Drift v2 perpetual market with contract_type = Prediction. (The former docs.drift.trade domain now serves Velocity DEX documentation, which does not cover BET markets — the protocol repository is the stable historical source.) Your agent connects the same way it would connect to Drift generally — via the Drift SDKs, on-chain accounts, the Drift Gateway, and Drift’s Data API.

Under the hood, prediction markets on Drift behave differently from normal perps:

AttributeStandard PerpBET Market
Price rangeUnbounded0 to 1
FundingActivePaused
MarginPartial collateralFully collateralized
Short valuationStandard1 - oracle price
OracleExternal feedMark TWAP (prelaunch-style)

What happened to Drift BET

On April 1, 2026, an attacker compromised Drift’s 2-of-5 admin multisig, using pre-positioned durable nonce transactions to collect the required approvals, transfer admin authority, remove withdrawal limits, and drain approximately $285M in user funds — the largest DeFi exploit of 2026. The protocol halted immediately; BET markets have not traded since.

The recovery plan came together over the following quarter. The team secured a credit facility backed by Tether of roughly $127.5M, issued transferable recovery tokens to affected users, and on July 1, 2026 rebranded the protocol as Velocity DEX. Velocity is relaunching as a USDT-settled perpetuals exchange — private beta first, public relaunch targeted for Q3 2026. Its published documentation covers perps only; prediction markets are not part of the announced scope, and the team has not committed to bringing BET back.

That leaves this page as an architectural reference. The BET design — prediction markets implemented as fully collateralized, price-bounded perp markets inside an existing DEX — remains the most complete example of that pattern on any chain, and the integration surfaces documented below describe how it worked in production through March 2026.

Integration surfaces

For most developers building agents, four layers matter:

1. Data API (read-only)

Public REST and WebSocket at https://data.api.drift.trade and wss://data.api.drift.trade/ws. Ideal for market discovery, monitoring trades, pricing, candles, and order books without touching a wallet.

2. SDKs (stateful execution)

TypeScript, Python, and Rust. The main interaction class in TypeScript is DriftClient. The npm package @drift-labs/sdk (current beta: 2.158.0-beta.3) is the primary integration path.

3. Gateway (agent-optimized execution)

Self-hosted HTTP layer for order management without raw Solana transaction flows. Supports delegated operation and subaccount routing per request via ?subAccountId=.... Best fit for agent architecture.

4. DLOB / SWIFT / JIT (advanced execution)

For market making, low-latency taker logic, or agent-assisted order flow. DLOB is Drift’s off-chain view of resting orders, SWIFT supports signed off-chain taker flow, and JIT auctions are part of order execution priority.

For a production bot, separate concerns:

  1. Reader — Consumes Data API REST/WS and on-chain market/account state
  2. Decision engine — Turns market state into a desired action
  3. Risk engine — Enforces collateral, position, and pricing rules
  4. Executor — Talks to the Drift SDK directly or a private Gateway instance
  5. Signer — Isolated from the reasoning layer for autonomous safety

Use a dedicated delegate wallet for the executor and one Drift subaccount per strategy or agent instance.

Quick start

Install the SDK:

npm install @drift-labs/sdk @coral-xyz/anchor @solana/web3.js @solana/spl-token

Discover active BET markets dynamically (do not hardcode market indexes — many historical BET markets are now delisted):

type MarketStat = {
  symbol: string;
  marketIndex: number;
  marketType: string;
  status?: string;
  oraclePrice?: number | string;
  markPrice?: number | string;
};

async function getActiveBetMarkets(): Promise<MarketStat[]> {
  const res = await fetch("https://data.api.drift.trade/stats/markets");
  const json = await res.json();
  const markets: MarketStat[] = json.markets ?? [];
  return markets.filter((m) => {
    const status = String(m.status ?? "").toLowerCase();
    return (
      m.marketType === "perp" &&
      m.symbol.endsWith("-BET") &&
      status !== "delisted"
    );
  });
}

Place an order via Gateway:

curl -X POST "http://localhost:8080/v2/orders" \
  -H "Content-Type: application/json" \
  -d '{
    "marketType": "perp",
    "marketName": "YOUR-BET-SYMBOL",
    "direction": "long",
    "baseAmount": 1,
    "orderType": "market"
  }'

For the complete TypeScript setup, Gateway configuration, WebSocket subscriptions, delegation patterns, and production advice, see the full developer guide.

Fees and Costs

Fee schedule as of March 2026 (pre-exploit Drift v2). Drift BET had no platform subscription fee — the protocol was free to use, with costs coming from trading fees and Solana infrastructure. Velocity’s relaunch schedule is 0.040% taker / 0.0025% maker rebate at the Regular tier, in USDT (docs.velocity.exchange).

CostAmountNotes
Trading fees (taker)0.1% of notionalPaid on each fill; maker fees are lower or zero depending on tier
Trading fees (maker)0.0% – 0.02%Fee tier depends on 30-day volume and staked DRIFT tokens
Account rent~0.035 SOL (one-time)Required to create a Drift user account on-chain
Solana transaction fees~0.000005 SOL per txNegligible, but priority fees during congestion can reach 0.001+ SOL
RPC provider$50–200/monthFree public RPCs are too unreliable for production agent use
Gateway hosting$5–20/monthA small VPS for your self-hosted Gateway instance

Compared to centralized prediction markets, the per-trade costs are competitive. Polymarket’s taker fees range from 0% to ~2% depending on market type. Kalshi charges per-contract fees that scale with quantity. Drift’s 0.1% taker fee is among the lowest, but the infrastructure costs (RPC, VPS, SOL for gas) add up for agents running continuously.

How Trading Works in Practice

Drift BET markets settle to either 0 or 1. Buying at $0.40 means you believe the outcome has better than 40% probability. If the event resolves YES, your position is worth $1.00 — a $0.60 profit per share. If it resolves NO, your position is worth $0.00.

Short selling works differently from standard perps. A short position at $0.40 is valued at 1 - 0.40 = $0.60. You profit if the price drops toward $0.00 (the event resolves NO). Because positions are fully collateralized, there is no liquidation risk in the traditional sense — you cannot lose more than your collateral.

Order types available on Drift BET:

  • Market orders — Execute immediately at the best available price. Subject to JIT auction and DLOB matching before hitting the AMM.
  • Limit orders — Rest on the DLOB until filled or cancelled. Maker fee tier applies. Preferred for agents that can wait for fills.
  • Post-only orders — Guaranteed to be maker or cancelled. Prevents accidental taker fills that erode edge.
  • Oracle-pegged orders — Price tracks the oracle with an offset. Useful for market-making strategies that want to stay centered around the current price.

A practical workflow for an agent placing a bet:

  1. Query the Data API for active BET markets and current prices
  2. Identify a market where your model’s probability diverges from the current price
  3. Calculate position size based on your edge estimate and bankroll management rules
  4. Submit a limit order via Gateway at your target price
  5. Monitor fill status through the Data API WebSocket
  6. Track position P&L and set exit criteria (price target, time-based, or event resolution)

When to Choose Drift BET Over Other Platforms

The decision depends on what matters most for your use case:

PriorityBest choiceWhy
Lowest trading feesPolymarket (maker)Drift BET’s 0.1% taker / 0% maker led this category before going offline; Polymarket makers trade free
Easiest integrationKalshi or PolymarketREST APIs you can call in 10 minutes vs Solana’s transaction model
Widest market selectionPolymarketThousands of markets created permissionlessly vs Drift’s governance-gated list
On-chain transparencyDrift BET or PolymarketBoth are fully on-chain; Kalshi is centralized
Latency-sensitive strategiesPolymarketDrift BET’s sub-second Solana finality won here while live; Polygon’s ~2-second blocks are now the fastest available
Permissionless market creationPolymarketAnyone can create markets; Drift requires governance approval
No infrastructure requiredKalshiHosted REST API with no wallet, RPC, or node management

While live, Drift BET was the strongest option when you needed low fees, fast finality, and full self-custody — provided you had the technical capacity to manage Solana infrastructure. Until the Velocity relaunch resolves whether prediction markets return, route new builds to Polymarket, Kalshi, or Rain.

BET-specific pitfalls

  • Oracle behavior — BET markets rely on mark TWAP rather than external oracles. A decision engine built for BTC/SOL perps will make bad assumptions if reused unchanged.
  • Order validation — The dedicated InvalidPredictionMarketOrder program error means not every standard perp order pattern transfers cleanly. Validate price ranges and size logic before signing.
  • Execution priority — Drift’s order flow prioritizes JIT auction → DLOB → AMM. A naive “post and assume it matches” mental model is incomplete.
  • Delisted markets — Old blog posts and code gists often reference markets now marked DELISTED. Always discover markets dynamically.
  • Subaccount isolation — Each Drift subaccount maintains its own margin and positions. If your agent runs multiple strategies, use separate subaccounts to prevent one strategy’s losses from affecting another’s collateral. Subaccount creation costs additional rent (~0.035 SOL each).
  • Priority fees during congestion — Solana’s base fee is negligible, but during network congestion (common during major market events), you may need to attach priority fees of 0.001–0.01 SOL per transaction to avoid dropped orders. Budget for this in your agent’s cost model.

Strengths

  • Mature infrastructure — Inherits Drift v2’s battle-tested SDKs, Gateway, and deep on-chain liquidity
  • Agent-friendly Gateway — Self-hosted HTTP execution layer with delegation and subaccount routing
  • Open source — Protocol, SDKs, and Gateway are all open source on GitHub
  • Solana speed — Sub-second finality and low transaction costs compared to EVM chains
  • Multiple integration paths — Data API for reads, SDK for direct execution, Gateway for agent-safe HTTP execution

Weaknesses

  • High complexity — Requires understanding Solana’s transaction model, Drift’s account system, and BET-specific mechanics
  • No simple REST trading API — Unlike Kalshi or Rain, there is no hosted API for placing trades. You must run your own Gateway or use the SDK directly.
  • Market availability — BET markets are created by Drift governance, not permissionlessly. Market selection is limited compared to Polymarket.
  • RPC requirements — Free Solana RPCs are insufficient for production. Budget for a paid RPC provider.
  • Account setup costs — Creating a Drift user account requires ~0.035 SOL in rent.

Alternatives

PlatformChainTrading FeesMarket CreationIntegration ComplexityBest For
Rain ProtocolArbitrumVariablePermissionlessModerate (REST + SDK)Builders who want revenue share and AI-native tooling
PolymarketPolygon0–2% takerPermissionlessLow (REST API)Widest market selection, most liquidity
KalshiCentralizedPer-contractPlatform-controlledLow (REST API)Regulated US access, no wallet management
OpenClawMulti-chainVariesN/A (framework)Moderate (SDK)Multi-platform agents with composable skills
Drift BETSolana0.1% takerGovernance-gatedHigh (Solana SDK + Gateway)Low fees, sub-second finality, full self-custody

Last updated: September 3, 2026. Drift BET is offline following the April 1, 2026 exploit and the July 2026 Velocity DEX rebrand; this page documents the Drift v2 BET architecture as a reference.