Skip to main content

Build Trading Bots for Turbine Markets

Python SDK for gasless prediction markets trading. No RPC, no gas tokens, no complexity — just pure trading logic.

Turbine

Quick start

Get your first bot trading in minutes

1

Install the SDK

Install via pip or clone from source:
pip install turbine-py-client
Or install from source:
git clone https://github.com/ojo-network/turbine-py-client.git
cd turbine-py-client
pip install -e .
2

Get API credentials

Request API credentials using your wallet. You only need to do this once:
from turbine_client import TurbineClient

credentials = TurbineClient.request_api_credentials(
    host="https://api.turbinefi.com",
    private_key="your_wallet_private_key",
)

print(f"API Key ID: {credentials['api_key_id']}")
print(f"API Private Key: {credentials['api_private_key']}")
Save these credentials! The private key cannot be retrieved later.
3

Place your first trade

Create a client and place a limit order:
from turbine_client import TurbineClient, Outcome

client = TurbineClient(
    host="https://api.turbinefi.com",
    chain_id=137,  # Polygon mainnet
    private_key="your_wallet_private_key",
    api_key_id="your_api_key_id",
    api_private_key="your_api_private_key",
)

# Get the latest BTC quick market
market = client.get_quick_market("BTC")
print(f"Market: {market.question}")

# Place a limit buy order
order = client.create_limit_buy(
    market_id=market.market_id,
    outcome=Outcome.YES,
    price=500000,      # 50% (price scaled by 1e6)
    size=1_000_000,    # 1 share (6 decimals)
)

result = client.post_order(order)
print(f"Order submitted: {result['orderHash']}")
4

Build a trading bot

Use our example bots as templates or generate a custom bot with Claude:
# Use the Claude skill to generate a bot
curl -sSL turbinefi.com/claude | bash
Or explore the example bots to understand different trading strategies.

Key features

Everything you need to build sophisticated trading bots

Gasless trading

No RPC, no gas tokens, no blockchain complexity. Everything routes through Turbine’s API.

EIP-712 signing

Automatic order signing with nonce management. Sign once, trade all day.

Real-time streams

WebSocket subscriptions for live orderbook updates, trades, and market rotations.

Market rotation

Built-in support for 15-minute BTC markets with automatic rotation and claiming.

Example bots

Production-ready bots: price action, market maker, and more strategies.

Full type hints

TypeScript-style dataclasses with complete type coverage for IDE support.

Ready to start trading?

Follow our quickstart guide to build and deploy your first trading bot in minutes.

Get Started Now

Build docs developers (and LLMs) love