Verdict: The most developer-friendly path to Solana prediction markets. 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. 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:
| Attribute | Standard Perp | BET Market |
|---|---|---|
| Price range | Unbounded | 0 to 1 |
| Funding | Active | Paused |
| Margin | Partial collateral | Fully collateralized |
| Short valuation | Standard | 1 - oracle price |
| Oracle | External feed | Mark TWAP (prelaunch-style) |
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.
Recommended agent architecture
For a production bot, separate concerns:
- Reader — Consumes Data API REST/WS and on-chain market/account state
- Decision engine — Turns market state into a desired action
- Risk engine — Enforces collateral, position, and pricing rules
- Executor — Talks to the Drift SDK directly or a private Gateway instance
- 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
Drift BET has no platform subscription fee — the protocol is free to use. Costs come from trading fees and Solana infrastructure:
| Cost | Amount | Notes |
|---|---|---|
| Trading fees (taker) | 0.1% of notional | Paid 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 tx | Negligible, but priority fees during congestion can reach 0.001+ SOL |
| RPC provider | $50–200/month | Free public RPCs are too unreliable for production agent use |
| Gateway hosting | $5–20/month | A 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:
- Query the Data API for active BET markets and current prices
- Identify a market where your model’s probability diverges from the current price
- Calculate position size based on your edge estimate and bankroll management rules
- Submit a limit order via Gateway at your target price
- Monitor fill status through the Data API WebSocket
- 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:
| Priority | Best choice | Why |
|---|---|---|
| Lowest trading fees | Drift BET | 0.1% taker, 0% maker is cheaper than most centralized alternatives |
| Easiest integration | Kalshi or Polymarket | REST APIs you can call in 10 minutes vs Solana’s transaction model |
| Widest market selection | Polymarket | Thousands of markets created permissionlessly vs Drift’s governance-gated list |
| On-chain transparency | Drift BET or Polymarket | Both are fully on-chain; Kalshi is centralized |
| Latency-sensitive strategies | Drift BET | Sub-second Solana finality; Polygon (Polymarket) has ~2-second blocks |
| Permissionless market creation | Polymarket | Anyone can create markets; Drift requires governance approval |
| No infrastructure required | Kalshi | Hosted REST API with no wallet, RPC, or node management |
Drift BET is the strongest option when you need low fees, fast finality, and full self-custody — and you have the technical capacity to manage Solana infrastructure. It is the weakest option when you want a quick prototype or access to a large catalog of markets.
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
InvalidPredictionMarketOrderprogram 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
| Platform | Chain | Trading Fees | Market Creation | Integration Complexity | Best For |
|---|---|---|---|---|---|
| Rain Protocol | Arbitrum | Variable | Permissionless | Moderate (REST + SDK) | Builders who want revenue share and AI-native tooling |
| Polymarket | Polygon | 0–2% taker | Permissionless | Low (REST API) | Widest market selection, most liquidity |
| Kalshi | Centralized | Per-contract | Platform-controlled | Low (REST API) | Regulated US access, no wallet management |
| OpenClaw | Multi-chain | Varies | N/A (framework) | Moderate (SDK) | Multi-platform agents with composable skills |
| Drift BET | Solana | 0.1% taker | Governance-gated | High (Solana SDK + Gateway) | Low fees, sub-second finality, full self-custody |
Related guides
- How to Build a Drift BET Agent on Solana — Full developer guide with TypeScript examples
- The Agent Betting Stack Explained — The four-layer framework
- Prediction Market API Reference 2026 — Compare Drift’s APIs with Polymarket and Kalshi
- Agent Wallet Comparison — Wallet options for Solana-based agents
- Rain Protocol — Another decentralized prediction market protocol for comparison
Last updated: March 20, 2026. Drift BET is in active development; market availability and SDK versions change frequently.