원클릭으로
create-bot
Generate a Turbine trading bot. Pick an algorithm, get a complete bot file. Use after /setup.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Generate a Turbine trading bot. Pick an algorithm, get a complete bot file. Use after /setup.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Deploy a Turbine trading bot to Locus using your wallet (no API key needed). Uses x402 Polygon payment for authentication. Use after creating a bot with /create-bot.
Deploy a Turbine trading bot to Locus for 24/7 cloud operation. Use after creating a bot with /create-bot.
Generate a Turbine liquidity-providing market maker bot. Earn from spread + maker rebates. Use after /setup.
Deploy a Turbine trading bot to Railway for 24/7 cloud operation. Use after creating a bot with /create-bot.
Get a new user from zero to ready-to-trade on Turbine. Environment, wallet, credentials, funding.
| name | create-bot |
| description | Generate a Turbine trading bot. Pick an algorithm, get a complete bot file. Use after /setup. |
| argument-hint | [algorithm] |
Here's what you're helping the user build: a Python file that automatically trades on Turbine's BTC, ETH, SOL, and XRP prediction markets.
Turbine opens new markets on rolling intervals (15-minute and 1-hour) asking "Will BTC/ETH/SOL/XRP be above $X at [time]?" The user's bot watches these markets and places trades — buying YES shares if it thinks the price will be above the strike, or NO shares if it thinks it will be below. When the market resolves, winning shares pay out $1.00.
A trading bot is a single Python file. When you run python my_bot.py, it connects to Turbine, starts watching the current markets for all configured assets and intervals, and executes trades according to its strategy. It handles everything automatically — market rotation, gasless USDC approval, order management, and claiming winnings. Use --assets BTC,ETH,SOL,XRP to choose which assets to trade (default: all four) and --intervals 15,60 to choose which intervals to trade (default: both).
Different strategies = different Python files. A Price Action bot and a Momentum bot are two separate files. Each one implements its own signal logic (the "should I buy YES, buy NO, or hold?" decision) while sharing the same underlying infrastructure for connecting to Turbine, managing orders, and handling the market lifecycle.
The creative core is the signal function — that's where the user's trading idea lives. Everything else is plumbing that follows a standard pattern.
Reference these when explaining algorithms, linking users to docs, or looking up details:
If a user asks about algorithm details, fee structures, or platform mechanics you're unsure of, fetch the relevant page above.
First, check if user-context.md exists in the repo root. This file is created by the /setup skill and contains the user's technical level, PM familiarity, and goals.
test -f user-context.md && echo "USER_CONTEXT_EXISTS" || echo "NO_USER_CONTEXT"
If it exists, read it. You now know their technical level, PM familiarity, what they're here for (hackathon, competition, exploring), and their chain/wallet. Adapt accordingly — don't re-ask what you already know.
If it doesn't exist, the user may have skipped /setup or set up manually. Ask directly using AskUserQuestion with two questions:
"How comfortable are you with Python?"
"How familiar are you with prediction markets?"
This matters because it changes how you explain things throughout the rest of this flow. A beginner needs the intro explained carefully. An expert wants to skip to algorithm selection.
Verify the user's environment is ready. Run silently:
# Check for .env with private key
test -f .env && grep -q "TURBINE_PRIVATE_KEY=0x" .env && echo "ENV_OK" || echo "NO_ENV"
# Check SDK is importable
python3 -c "import turbine_client" 2>&1 && echo "SDK_OK" || echo "NO_SDK"
If either check fails, don't try to fix it inline. Tell the user:
"Looks like your environment isn't set up yet. Run
/setupfirst — it'll walk you through Python, wallet, and credentials. Come back here when you're ready to build."
Then stop. Don't continue.
If both pass, proceed to the intro.
Before jumping into algorithm selection, make sure the user understands what they're about to build. This is especially important for users who are new to prediction markets — they need to understand what they're trading before they can make an informed choice about how to trade it.
Explain clearly:
Here's what we're building: A Python bot that trades on Turbine's BTC, ETH, SOL, and XRP prediction markets.
New markets open on rolling intervals (every 15 minutes and every hour): "Will BTC/ETH/SOL/XRP be above $X?" Your bot will decide whether to buy YES (bet price stays above) or NO (bet price goes below), based on a strategy you choose. If your bot is right, each share pays out $1.00. If it's wrong, you lose what you paid.
The bot handles everything automatically — connecting to Turbine, placing trades on all configured assets and intervals simultaneously, switching to new markets as they rotate, and claiming winnings. You just pick the strategy and run it.
Each strategy is a separate Python file. You can create multiple bots with different strategies and compare how they perform.
Adapt the depth based on the user's profile:
New to PMs: Give the full explanation above, PLUS walk through a concrete example with real dollar amounts:
"Here's a specific example: the market asks 'Will BTC be above $97,250 at 3:15 PM?' Your bot checks the live BTC price and sees it's at $97,400 — above the strike. So it buys a YES share at $0.65. If BTC stays above $97,250 by 3:15, the share pays out $1.00 — that's a $0.35 profit. If BTC drops below, the share is worth $0.00 and you lose the $0.65."
"The strategy is the part that decides when to buy and which side to take. That's what we're about to pick."
Do not proceed to strategy selection until they confirm they understand this. A user who doesn't grasp the payout mechanic can't evaluate whether a strategy makes sense. If they seem uncertain, reference docs/prediction-markets.md for a fuller explanation.
Knows PMs: Keep it brief — "We're building a Python bot to trade Turbine's 15-min BTC binary markets. Let's pick a strategy."
Expert: Skip entirely if they already indicated what they want.
Use AskUserQuestion:
If they want more info, answer their questions. Reference CLAUDE.md, docs/prediction-markets.md, or the Turbine docs URLs above. Don't rush past this — a user who doesn't understand what they're trading can't evaluate whether their strategy makes sense.
If they're ready, proceed.
If the user passed an argument (e.g., /create-bot momentum), use $ARGUMENTS to skip directly to that algorithm.
Otherwise, ask what they're looking for. Use AskUserQuestion:
"What kind of trading strategy interests you?"
Options:
Each algorithm answers the same core question differently: "Given the current market, should I buy YES, buy NO, or hold?"
| # | Algorithm | How It Decides | Risk | Best For | Reference File |
|---|---|---|---|---|---|
| 1 | Price Action (recommended) | Compares live asset price (Pyth) to strike price. Above strike → YES, below → NO. Trades BTC, ETH, SOL simultaneously. | Medium | Beginners. Signal aligns with how markets resolve. | price_action_bot.py |
| 2 | Simple Spread | Places bid + ask around mid-price with fixed spread. Profits from the spread. | Medium | Learning market making basics. | market_maker.py |
| 3 | Inventory-Aware | Like Simple Spread, but skews quotes to reduce accumulated position. | Lower | Balanced exposure, less directional risk. | market_maker.py (modified) |
| 4 | Momentum | Detects which direction recent trades are flowing. Follows the trend. | Higher | Trending markets, breakouts. | price_action_bot.py (modified) |
| 5 | Mean Reversion | Fades large moves — buys after dips, sells after spikes. Bets on reversion. | Higher | Range-bound markets, overreactions. | price_action_bot.py (modified) |
| 6 | Probability-Weighted | Bets that prices far from 50% will revert toward uncertainty. | Medium | Markets with overconfident pricing. | price_action_bot.py (modified) |
Why Price Action is recommended for beginners: It uses Pyth Network — the same oracle Turbine uses to resolve markets. The bot's trading signal is directly aligned with how winners are determined. It's the simplest to understand and the most intuitive to reason about. It trades all three assets (BTC, ETH, SOL) by default, configurable via --assets.
For users new to PMs: The algorithm table above is meaningless without PM context. Don't just show the table — translate each strategy into plain English tied to what they now understand:
- Price Action: "Checks the live price of each asset (BTC, ETH, SOL). If the price is above the strike, buy YES. If below, buy NO. The simplest possible logic."
- Momentum: "Watches what other traders are doing. If lots of people are buying YES, follow the crowd."
- Mean Reversion: "If the price spikes in one direction, bet it comes back. Contrarian approach."
For beginners, strongly recommend Price Action and don't overwhelm them with all 6 options. Say: "I'd recommend starting with Price Action — it's the most intuitive and directly aligned with how markets resolve. You can always create another bot with a different strategy later."
For users new to technical concepts (low tech): They can't evaluate algorithmic tradeoffs. Don't ask them to choose from a table of options they can't meaningfully compare. Instead, recommend Price Action directly and explain it in one sentence: "Your bot will check if Bitcoin is above or below the target price and trade accordingly." Only present the full table if they ask for options.
If the user has their own idea: Listen to what they describe. Map it to the closest algorithm type above, or if it's truly novel, design a custom signal function that fits into the standard bot structure. The infrastructure stays the same — only the signal logic changes.
Use AskUserQuestion to confirm their choice.
There are two reference implementations to use depending on the algorithm type:
examples/price_action_bot.py — For directional trading strategies (algorithms 1, 4, 5, 6)
examples/market_maker.py — For market making strategies (algorithms 2, 3)
CRITICAL: Do not use inline code snippets from this skill as the basis for generated code. Always read the actual reference file. Both contain tested patterns for:
The only things that change between algorithms are:
Everything else — credentials, market management, USDC approval, order execution, position tracking, claiming — comes directly from the reference implementation. Don't rewrite it, don't simplify it, don't "improve" it.
For Price Action (algorithm 1): The reference implementation IS a Price Action bot. Copy it and let the user customize parameters (order size, max position, confidence thresholds).
For Simple Spread and Inventory-Aware (algorithms 2-3):
Use examples/market_maker.py as the base:
examples/market_maker.py for the full market making infrastructureget_user_positions() periodically)calculate_quotes() that adjusts bid/ask based on inventoryinventory_skew_bps)For directional strategies (algorithms 4-6):
Use examples/price_action_bot.py as the base:
examples/price_action_bot.py for the full infrastructurecalculate_signal() with the new algorithm's logicget_current_btc_price() only if the new algorithm doesn't need external price data__init__When generating bots, here's the core logic to implement. These are conceptual — adapt them to fit the reference implementation's structure.
Simple Spread (2) — Based on market_maker.py:
(best_bid + best_ask) / 2mid - half_spread and a SELL order at mid + half_spreadInventory-Aware (3) — Based on market_maker.py with modifications:
client.get_user_positions(address) to track inventoryposition_shares * skew_bps adjustment to both bid and askMomentum (4):
client.get_trades(market_id)buys / total over the windowMean Reversion (5):
Probability-Weighted (6):
Save the generated bot in the repo root with a descriptive name:
price_action_bot.py (if different from the example)momentum_bot.pymean_reversion_bot.pyspread_bot.pyTell the user where you saved it.
After generating, walk the user through the key parameters they can tweak:
Universal parameters (all algorithms):
IMPORTANT — use exactly these defaults. Do not increase them:
--order-size — $1.00 (one dollar per trade)--max-position — $5.00 (five dollars maximum at risk per asset per market)--assets — BTC,ETH,SOL,XRP (which assets to trade; comma-separated)--intervals — 15,60 (which intervals in minutes to trade; comma-separated)This is real USDC on Polygon mainnet. Keep defaults small. The user can always increase once they see the bot working and understand the risk.
Minimum taker order size: The Turbine API enforces a $1 minimum on taker orders (size × price ≥ $1 USDC). Orders below this threshold will be rejected. Maker orders (resting limit orders) are exempt. Since directional bots typically place taker orders, the default order size must be at least $1.
Tell them: "I've set these conservatively — this is real money. Your bot risks one dollar per trade. Start by watching how it behaves, then increase the amounts once you're comfortable."
For users new to PMs: Explain what these numbers mean in context:
- "Order size is how much you bet each time — one dollar. If the trade wins, you get back more than that. If it loses, you lose the dollar."
- "Max position is the most your bot can have on the line at once. Even if the bot places many trades, it won't risk more than $5 total in any single market."
- "With $10 in your wallet, you can run the bot for a long time at these sizes."
Algorithm-specific parameters:
For non-technical users: Don't present algorithm-specific parameters unless they ask. Use sensible defaults and move on. Say: "I've set the defaults to reasonable values. You can tweak them later once you see how the bot performs."
Give the user the command to run their bot themselves. Do NOT offer to run the bot for them — the user should see the output live in their own terminal. This is the payoff moment.
source .venv/bin/activate # If not already active
python <bot_filename>.py
For non-technical users: Running a Python file may not be obvious. Be explicit:
- "To run the bot, you'll need a separate terminal window from this one (this one is for Claude). Open a new terminal window, then navigate to the project folder:"
cd [path to repo] source .venv/bin/activate python price_action_bot.py- "Make sure you see
(.venv)at the start of your prompt — that means the virtual environment is active."- "You'll see text scrolling — that's your bot thinking and trading. Don't close this window or the bot stops."
- "To stop the bot, press
Ctrl+C(hold Control and press C)."- "You can come back to this Claude window anytime to ask questions about what's happening."
If they're in an IDE with an integrated terminal, this is simpler: "Open a new terminal tab in your IDE (usually the + button next to the terminal) and run the command there."
Explain what will happen on first run:
.env. This takes a few seconds on the very first run.For non-technical users: Also explain what the output means as it scrolls by: "The first few lines are setup — registering credentials and approving USDC. After that, you'll see lines about the current market, the BTC price, and what your bot decided to do. If you see 'BUY_YES' or 'BUY_NO', your bot is actively trading."
"You can leave it running — it handles everything. Press
Ctrl+Cto stop. The bot cancels all open orders on shutdown."
After the bot is running, suggest next steps based on the user's goals (from user-context.md or what they've told you):
For competition users:
Check the leaderboard at https://beta.turbinefi.com/leaderboard to see how your PnL ranks. You can run multiple strategies simultaneously — try
/create-botagain with a different algorithm and compare results.
For hackathon users:
You've got a working bot! If time allows, try tweaking parameters or building a second strategy. Deploy to Railway with
/railway-deployso it keeps trading while you work on other things.
For explorers:
Watch the logs to see how your bot makes decisions. When you're ready, tweak the parameters, try a different algorithm, or design your own signal logic. Each strategy is just a Python file — experiment freely.
For everyone:
- Deploy 24/7 — run
/railway-deployto put your bot in the cloud (free $5 Railway credit for 30 days)- Build another strategy — run
/create-botagain with a different algorithm- Read the code —
examples/price_action_bot.pyshows exactly what your bot is doing under the hood
Update user-context.md with a note about which bot was created (strategy type, filename) under a ## Bots Created section. This helps Claude in future sessions know what the user has already built.
DO NOT modify these when generating bots. They exist in the reference implementations for a reason and must be preserved exactly:
Order verification chain: After post_order(), fire a background task that sleeps 2 seconds, then checks failed trades → pending trades → recent trades → open orders. This runs via asyncio.create_task() so it doesn't block the next order placement. The sequence ensures the bot tracks the true state of its orders without sacrificing trading speed.
Gasless USDC approval: One-time gasless permit via API per settlement contract. approve_usdc() returns a dict with tx_hash key (not a raw tx hash string). Check allowance first via API, skip if already approved. Never do per-order approvals. No web3 or RPC needed.
Market transitions: Poll every 5 seconds for new markets. On transition: cancel all orders on the old market, reset state (pending orders, processed trade IDs), approve USDC for the new settlement if needed, then resume trading.
Claiming: Background task checks for resolved markets every 120 seconds. Enforce 15-second delay between individual claim calls (API rate limit). Remove markets from tracking after successful claim or if no position exists.
NOTE: The current market_maker.py reference is a simplified example that does NOT include automatic market transitions, claiming, or position tracking. When generating market making bots:
If using as-is: The bot will continue quoting on a single market. Users must manually restart when markets rotate (every 15 minutes). This is acceptable for learning/testing.
For production use: Consider enhancing with patterns from price_action_bot.py:
get_user_positions()Mention this limitation to the user and offer to add these enhancements if they plan to run the bot continuously.
These patterns are battle-tested in the reference implementations. When in doubt, copy exactly.