{"openapi":"3.1.0","info":{"title":"TradeHub","description":"Agent trading gateway: one risk gate, public MCP and REST, many venues","version":"0.1.0"},"paths":{"/v1/tools":{"get":{"summary":"List Tools","description":"Tool definitions shared with MCP: name, title, scopes, description, hints, input and output schemas.","operationId":"list_tools_v1_tools_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/me/mandate":{"get":{"summary":"My trading permissions","description":"What this agent may do right now on TradeHub: autonomy level (read, propose = every order needs a person's approval, preauth = executes within limits), allowed venues, symbols and actions, per-trade and daily limits, today's usage, connected venues and whether trading is halted. Use first in every session and after any rejection that mentions your mandate. Not for account balances (use get_my_account_balances). No inputs. Limits are fractions of equity or USD. Only a person can widen them, on the Web, and widening waits 24 hours. Next: size_position_by_risk or get_my_open_positions.","operationId":"get_my_trading_permissions","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Permissions"}}}}}}},"/v1/account":{"get":{"summary":"My account balances","description":"Equity, free margin, used margin and open profit or loss on every exchange account the user connected (Hyperliquid, Bybit, Binance, OKX, sandbox), and the total. Use to report balances or to compare free margin across exchanges. Not needed before opening: size_position_by_risk reads equity itself. Not for positions (use get_my_open_positions). No inputs. Amounts in USD (USDC / USDT count as USD). Next: get_my_open_positions.","operationId":"get_my_account_balances","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Balances"}}}}}}},"/v1/positions":{"get":{"summary":"My open positions","description":"Every open perpetual futures position on every connected exchange account: side, size, entry, mark, open profit or loss, leverage, and the liquidation price with how far away it is. Use before closing, adjusting a stop or reporting exposure. Not for resting orders or stops (use get_my_open_orders). No inputs. Sizes in the base coin, prices in USD. Next: close_perp_position_reduce_only or get_my_open_orders.","operationId":"get_my_open_positions","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Positions"}}}}}}},"/v1/orders":{"get":{"summary":"My open orders","description":"Resting orders on the user's exchange accounts, including protective stop-loss and take-profit orders (is_trigger = true), and trigger entries TradeHub holds (type TRIGGER_ENTRY, order_id req_…). Use to find an order_id to cancel or to confirm a stop is in place. Not for filled trades (use get_my_trade_history). Inputs: optional venue and symbol filters. Sizes in the base coin, prices in USD. Next: cancel_open_order(order_id).","operationId":"get_my_open_orders","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Orders"}}}}}},"post":{"summary":"Execute a previewed order","description":"Execute a preview from preview_perp_order: re-checked at a fresh price, then sent to the exchange with its stop-loss placed there. Use only after a successful preview. Not for new or changed orders (preview again). If a person must approve (propose level, or no trade:execute scope) it waits; wait_seconds (0-30) holds the call open for the decision. Inputs: preview_id, client_order_id (idempotency key: repeating it returns the first result). A fill cannot be undone; the remedy is close_perp_position_reduce_only. Next: get_order_request_status(request_id) while pending.","operationId":"execute_previewed_order","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/markets":{"get":{"summary":"Market Snapshot","description":"Best bid / ask, mark and funding for every platform symbol on every venue, refreshed every\ntwo seconds from public data; each quote says how old it is.","operationId":"market_snapshot_v1_markets_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/markets/{symbol}":{"get":{"summary":"Perpetual contract rules","description":"Rules and current funding for one perpetual futures contract on one exchange: mark price, size step, minimum size, price tick, maximum leverage, funding rate per interval and annualised. Use when a limit price or leverage must fit the venue; not needed for market orders (sizing and preview round for you). Not for comparing exchanges (use compare_perp_quotes_across_venues or compare_funding_rates_across_venues). Inputs: symbol (base coin, e.g. BTC), venue (without an account: hyperliquid only). Prices in USD per coin, sizes in the base coin, rates as fractions. Next: size_position_by_risk.","operationId":"get_perp_contract_rules","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractRules"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/markets/{symbol}/book":{"get":{"summary":"Order book","description":"Order book levels for one perpetual futures contract on one exchange, best first, as [price, size]. Use to judge liquidity before a large market order. Not for the best price across exchanges (use compare_perp_quotes_across_venues). Inputs: symbol, venue (without an account: hyperliquid only), depth (1-50 levels). Prices in USD per coin, sizes in the base coin. Next: preview_perp_order.","operationId":"get_order_book","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderBook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/markets/{symbol}/signals":{"get":{"summary":"Technical indicators (15-minute)","description":"RSI, MACD, Bollinger %B, ATR, EMA trend and volume rank on Hyperliquid's 15-minute candles for one coin, plus the current funding rate. Use as inputs to your own decision; it is not a trading recommendation. ATR is useful for placing a stop. Not for live quotes (use compare_perp_quotes_across_venues). Input: symbol (base coin). Prices in USD per coin. Next: size_position_by_risk.","operationId":"get_technical_indicators_15m","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Indicators"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/markets/{symbol}/candles":{"get":{"summary":"Price candles","description":"Price history for one coin as candles: open, high, low, close and volume per interval (1m, 5m, 15m, 1h, 4h, 1d), up to 500, oldest first, from Hyperliquid's public market, the same prices the sandbox trades at. Use to look back at price action, find recent highs and lows for a stop, or judge the trend. Not for the live best price (use compare_perp_quotes_across_venues) or ready-made indicators (use get_technical_indicators_15m). Inputs: symbol (base coin), interval (default 1h), limit (default 100). Prices in USD per coin, volume in the base coin, times UTC. Next: size_position_by_risk.","operationId":"get_price_candles","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Candles"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/venues/health":{"get":{"summary":"Exchange health","description":"Whether each exchange is reachable right now: TradeHub's public price feed per exchange, and, with an account, each connected exchange account's latency, last error and rate-limit headroom. Use after a VENUE_UNAVAILABLE error or before trading on an exchange that misbehaved. Not for prices (use compare_perp_quotes_across_venues). No inputs. Next: retry the failed call, or use another venue.","operationId":"get_venue_health","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VenueHealth"}}}}}}},"/v1/markets/{symbol}/quotes":{"get":{"summary":"Compare quotes and costs across exchanges","description":"Use to choose where to trade one perpetual futures coin: bid, ask, spread, trading fee (your account's rate if the exchange reports it, else the published one) and measured execution over 7 days, per exchange (with an account, also the sandbox). With side (and size_base or notional_usd): ranked by price plus taker fee plus a cost for poor execution; hold_hours adds funding, exit fee. With an account it shows which venues you may use and can afford; best_venue is the cheapest. Not for one venue's depth (use get_order_book). No rebates. Next: preview_perp_order with that venue, or venue \"best\".","operationId":"compare_perp_quotes_across_venues","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteComparison"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/markets/{symbol}/funding":{"get":{"summary":"Compare funding rates across exchanges","description":"Current perpetual futures funding rate for one coin on every exchange TradeHub supports, per interval and annualised, with the age of each reading. Use when choosing where to hold a long or a short, or to check a funding spread. Not a forecast: rates change every interval. Input: symbol (base coin). Rates are fractions; positive means longs pay shorts. Sorted by annualised rate, highest first; TradeHub takes no rebates from any exchange. Next: get_perp_contract_rules(venue, symbol) or size_position_by_risk.","operationId":"compare_funding_rates_across_venues","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundingComparison"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sizing":{"post":{"summary":"Size a position by risk","description":"Turns \"risk 1% of equity, stop 2% below\" into a size in the base coin, rounded down to the venue step and capped by every limit (this agent's, the person's and TradeHub's). Reads equity, mark and contract rules itself: no need for get_my_account_balances or get_perp_contract_rules first. Use before every preview_perp_order. Not an order: nothing is sent. Inputs: symbol, stop_loss (USD) or stop_pct with side, risk_pct or risk_usd (default: the most allowed), venue, entry_price (default: mark), leverage. Next: preview_perp_order with the returned size_base, stop_loss and leverage.","operationId":"size_position_by_risk","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sizing"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/performance":{"get":{"summary":"My performance","description":"How this agent has done: trades opened and closed, wins, realised profit or loss in USD, and its most common refusals with what to do differently, over the last N days. Use at the start of a session or after a run of rejections, to avoid repeating mistakes. Not for the trades themselves (use get_my_trade_history). Input: days (1-90). Only this agent's own record; a person sees all agents together. Next: get_my_trading_permissions.","operationId":"get_my_agent_performance","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentPerformance"}}}}}}},"/v1/risk":{"get":{"summary":"My risk limits and usage","description":"The person's global risk limits (per-trade risk, daily / weekly / monthly loss, drawdown, leverage, open positions) and how much of each is used, across all exchanges, plus limit increases waiting to take effect. Use when a trade was rejected by a user-level limit or before planning several trades. Not for this agent's own permissions (use get_my_trading_permissions). No inputs. Fractions of equity and USD; real money and the sandbox are counted separately. Next: size_position_by_risk.","operationId":"get_my_risk_limits_usage","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskUsage"}}}}}}},"/v1/fills":{"get":{"summary":"My trade history","description":"Recent trades opened through TradeHub with entry, stop, take-profit, leverage and realised profit or loss. Third-party apps see only the trades they opened; the user's own keys see all. Use for reviews and reports. Not for live positions (use get_my_open_positions). Input: limit (1-200). Sizes in the base coin, money in USD. Next: get_my_open_positions.","operationId":"get_my_trade_history","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradeHistory"}}}}}}},"/v1/requests/{request_id}":{"get":{"summary":"Order request status","description":"The current state of an order request made with execute_previewed_order: pending_approval, executed, rejected, failed, expired or declined, with fill price and stop order id once executed. Use to follow an order that was waiting for a person's approval. Not for listing orders (use get_my_open_orders). Input: request_id. Next: get_my_open_positions once executed.","operationId":"get_order_request_status","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/requests":{"get":{"summary":"List Requests","description":"Order requests, newest first (the approvals queue on Web). Agents see only their own.","operationId":"list_requests_v1_requests_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/orders/preview":{"post":{"summary":"Preview a perpetual futures order","description":"Check a perpetual futures order with its stop-loss (optional take-profit) against this agent's permissions, the person's limits and the price band, sending nothing. Use before every new position, also one that waits for a price (trigger_price). Not for closing (use close_perp_position_reduce_only). size_base (base coin): from size_position_by_risk; the stop: stop_loss (USD) or stop_pct. Returns preview_id (valid 30 s), notional, risk, margin, likely fill and every check; a rejection names the failing check and, when a fix is certain, suggested_args. Next: execute_previewed_order(preview_id).","operationId":"preview_perp_order","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/orders/{order_id}":{"delete":{"summary":"Cancel an open order","description":"Cancel one resting order on an exchange. Use to withdraw an unfilled limit order or a take-profit. A held position's stop-loss cannot be cancelled (move it with a new stop or close the position): this keeps every position protected. Not for closing positions (use close_perp_position_reduce_only). Inputs: order_id (from get_my_open_orders), symbol, venue. Works while trading is halted. Next: get_my_open_orders.","operationId":"cancel_open_order","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/positions/{symbol}/close":{"post":{"summary":"Close a position (reduce-only)","description":"Close all or part of a perpetual futures position with a reduce-only market order, so it can never open or flip a position. Use to take profit, cut a loss or reduce exposure; it is also the only way to undo a filled order. Third-party apps can close only positions they opened. Not for cancelling resting orders (use cancel_open_order). Inputs: symbol, venue, close_pct (1-100, default 100). Works while trading is halted. Next: get_my_open_positions.","operationId":"close_perp_position_reduce_only","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/kill":{"post":{"summary":"Stop all trading now","description":"Emergency stop for the whole account: cancel every resting order, close every position on every exchange with reduce-only orders, and block new positions. Use only when the person asks to stop everything or something is clearly wrong. Only a person can resume, on the Web with a verification code; third-party apps never get this permission. Not for closing one position (use close_perp_position_reduce_only). Input: reason. Next: get_my_open_positions to confirm nothing is left.","operationId":"stop_all_trading_now","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/positions/{symbol}/take-profits":{"put":{"summary":"Set a position's take-profits","description":"Replace a held position's take-profits: one level or several (e.g. 50% at 98000, the rest at 101000), each a reduce-only trigger on the exchange, so it can only shrink the position. Use after entry, or to move or remove them ([] removes all). Not for the stop-loss (use tighten_stop_loss) or for closing now (use close_perp_position_reduce_only). Inputs: symbol, levels [{price, close_pct}], venue. New orders are placed before the old ones go. Works while trading is halted. Next: get_my_open_orders.","operationId":"set_take_profit_levels","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/positions/{symbol}/stop-rule":{"put":{"summary":"Let a position's stop follow the price","description":"Make a held position's stop-loss move by itself, only ever toward the price: trailing (it follows the best price at trail_pct behind it) or breakeven (it moves to the entry once the price reaches activate_at). TradeHub checks about every 5 seconds; each move follows tighten_stop_loss's rules and is audited. Use to lock in profit on a winning position. One rule per position: a new one replaces it, kind=none removes it, it ends when the position closes. Not for a one-off move (use tighten_stop_loss). Next: get_my_open_positions shows the rule.","operationId":"set_stop_loss_rule","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopRuleSet"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/positions/{symbol}/stop-loss":{"post":{"summary":"Tighten a position's stop-loss","description":"Move a held position's stop-loss closer to the current price, e.g. to breakeven or to lock in profit: the new stop is placed first, then the old one is cancelled, so the position is never unprotected. Use when the user asks to raise a long's stop or lower a short's. Not for widening a stop (never allowed while the position is open) or for closing (use close_perp_position_reduce_only). Inputs: symbol, stop_loss (USD per coin), venue. Works while trading is halted. Next: get_my_open_orders to see the new stop.","operationId":"tighten_stop_loss","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/requests/{request_id}/decide":{"post":{"summary":"Decide Request","description":"approvals:decide — a present person only, on Web or through the Telegram bot; never an\nagent (SR-01). Telegram approvals are limited first (cooldown, daily limit, PIN, breaker).","operationId":"decide_request_v1_requests__request_id__decide_post","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/session/verify":{"post":{"summary":"Verify Session","description":"TradeHub Web step-up: a fresh authenticator code makes this sign-in \"recently verified\" again.","operationId":"verify_session_v1_session_verify_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents":{"get":{"summary":"List Agents","operationId":"list_agents_v1_agents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/agents/{agent_id}":{"put":{"summary":"Put Agent","operationId":"put_agent_v1_agents__agent_id__put","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MandateBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{agent_id}/pause":{"post":{"summary":"Pause Agent","operationId":"pause_agent_v1_agents__agent_id__pause_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{agent_id}/resume":{"post":{"summary":"Resume Agent","description":"A person un-pauses an agent that was auto-paused or stopped by the kill switch.","operationId":"resume_agent_v1_agents__agent_id__resume_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{agent_id}/revoke":{"post":{"summary":"Revoke Agent","operationId":"revoke_agent_v1_agents__agent_id__revoke_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{agent_id}/keys":{"post":{"summary":"Create Key","description":"The full key is in this response only; afterwards only its prefix is shown (ST-KY-01).","operationId":"create_key_v1_agents__agent_id__keys_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Keys","operationId":"list_keys_v1_agents__agent_id__keys_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{agent_id}/keys/{key_id}":{"delete":{"summary":"Revoke Key","operationId":"revoke_key_v1_agents__agent_id__keys__key_id__delete","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/usage":{"get":{"summary":"Get Usage","description":"Today's calls by agent and tool, and the limits (requests, agents, webhooks). A third-party\napp sees the account totals (the quota is per account) but only its own agent's breakdown.","operationId":"get_usage_v1_usage_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/email":{"post":{"summary":"Change Email","description":"Highest-risk operation: a code every time; the new address must confirm; the old one is told.","operationId":"change_email_v1_account_email_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/export":{"post":{"summary":"Export Account","operationId":"export_account_v1_account_export_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/deletion":{"get":{"summary":"Deletion Status","operationId":"deletion_status_v1_account_deletion_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Request Deletion","description":"With a code; refused while a real position is open; carried out in 7 days unless cancelled.","operationId":"request_deletion_v1_account_deletion_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Cancel Deletion","operationId":"cancel_deletion_v1_account_deletion_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/account/live":{"get":{"summary":"Live Status","operationId":"live_status_v1_account_live_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Open Live","description":"Highest-risk operation: a code every time, and it waits LOOSEN_DELAY_HOURS (cancellable).","operationId":"open_live_v1_account_live_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Close Live","description":"Turning live off only tightens: immediate, no code.","operationId":"close_live_v1_account_live_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/sandbox/reset":{"post":{"summary":"Reset Sandbox","description":"Back to 10,000 USDC with no positions or orders; open sandbox trade records are closed.","operationId":"reset_sandbox_v1_sandbox_reset_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/trading":{"get":{"summary":"Trading Status","operationId":"trading_status_v1_trading_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/trading/resume":{"post":{"summary":"Resume Trading","description":"Highest-risk operation (SEC-08): a person on Web with an authenticator code, every time.","operationId":"resume_trading_v1_trading_resume_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks":{"get":{"summary":"List Webhooks","operationId":"list_webhooks_v1_webhooks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Create Webhook","description":"The signing secret is in this response only (it can be rotated).","operationId":"create_webhook_v1_webhooks_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/{webhook_id}":{"delete":{"summary":"Delete Webhook","operationId":"delete_webhook_v1_webhooks__webhook_id__delete","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/{webhook_id}/rotate-secret":{"post":{"summary":"Rotate Webhook Secret","description":"New secret now; the old one keeps signing for 24 hours (SEC-23).","operationId":"rotate_webhook_secret_v1_webhooks__webhook_id__rotate_secret_post","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/{webhook_id}/enable":{"post":{"summary":"Enable Webhook","description":"Turn an endpoint back on after it was disabled for failing.","operationId":"enable_webhook_v1_webhooks__webhook_id__enable_post","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/venue-accounts":{"get":{"summary":"List Venue Accounts","operationId":"list_venue_accounts_v1_venue_accounts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Add Venue Account","description":"Connect an exchange account. The body is validated by hand so no error ever reflects a\ncredential back (FastAPI's 422 would echo the input, ST-VN-09).","operationId":"add_venue_account_v1_venue_accounts_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/venue-accounts/{account_id}":{"delete":{"summary":"Remove Venue Account","operationId":"remove_venue_account_v1_venue_accounts__account_id__delete","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/risk-limits":{"get":{"summary":"Get Risk Limits","operationId":"get_risk_limits_v1_risk_limits_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"patch":{"summary":"Change Risk Limits","description":"Tightening applies now; loosening waits LOOSEN_DELAY_HOURS and can be cancelled (SEC-28).\n{\"book\": \"sandbox\", \"limits\": {...}}: the sandbox's own values, at once (null: follow the real limit).","operationId":"change_risk_limits_v1_risk_limits_patch","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/loosenings":{"get":{"summary":"List Loosenings","description":"Pending loosenings of risk limits and mandates, with when each takes effect (SEC-28).","operationId":"list_loosenings_v1_loosenings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/loosenings/{change_id}/cancel":{"post":{"summary":"Cancel Loosening","operationId":"cancel_loosening_v1_loosenings__change_id__cancel_post","parameters":[{"name":"change_id","in":"path","required":true,"schema":{"type":"string","title":"Change Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/apps":{"get":{"tags":["people"],"summary":"List Apps","description":"OAuth apps the person has allowed (the console itself is not listed).","operationId":"list_apps_v1_apps_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/apps/{grant_id}":{"delete":{"tags":["people"],"summary":"Revoke App","description":"Revoking is risk-reducing: tokens die now, the app's agent is paused and its pending requests void.","operationId":"revoke_app_v1_apps__grant_id__delete","parameters":[{"name":"grant_id","in":"path","required":true,"schema":{"type":"string","title":"Grant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent-stats":{"get":{"tags":["people"],"summary":"Agents Stats","description":"Per agent: order calls, refusals by code, and refusals fixed within 3 calls (AG-05).","operationId":"agents_stats_v1_agent_stats_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":7,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/audit":{"get":{"tags":["people"],"summary":"Audit Log","description":"The person's own audit trail, newest first; personal details are decrypted for them.","operationId":"audit_log_v1_audit_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Before"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/events":{"get":{"tags":["people"],"summary":"Recent Events","description":"Recent events (the same ones the stream and webhooks carry); ``type`` may end in ``*``.","operationId":"recent_events_v1_events_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/profile":{"get":{"tags":["people"],"summary":"Profile","operationId":"profile_v1_account_profile_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/account/password":{"post":{"tags":["people"],"summary":"Change Password","description":"The current password and a code every time; every other Web sign-in ends.","operationId":"change_password_v1_account_password_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/authenticator":{"post":{"tags":["people"],"summary":"Start Authenticator Change","description":"Step 1 of changing the authenticator (a code from the current one): a new key, shown once as a QR code.\nNothing changes until step 2 proves the new app has it; the key lapses after 10 minutes.","operationId":"start_authenticator_change_v1_account_authenticator_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/authenticator/confirm":{"post":{"tags":["people"],"summary":"Finish Authenticator Change","description":"Step 2: a code from the new authenticator. It replaces the old one, every other Web sign-in ends and the\nperson is emailed. Recovery codes stay as they are.","operationId":"finish_authenticator_change_v1_account_authenticator_confirm_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/recovery-codes":{"post":{"tags":["people"],"summary":"Regenerate Recovery Codes","description":"New codes, shown once; the old ones stop working.","operationId":"regenerate_recovery_codes_v1_account_recovery_codes_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/sessions":{"get":{"tags":["people"],"summary":"Web Sessions","description":"Signed-in Web sessions (one per console sign-in that still has a live refresh token).","operationId":"web_sessions_v1_account_sessions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/account/sessions/{session_id}":{"delete":{"tags":["people"],"summary":"End Web Session","description":"End one Web sign-in (risk-reducing: no code needed). Its console page is signed out on its next call.","operationId":"end_web_session_v1_account_sessions__session_id__delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/sign-out-everywhere":{"post":{"tags":["people"],"summary":"Sign Out Everywhere","description":"Ends every Web sign-in (risk-reducing: no code needed). Agents' keys and apps keep working.","operationId":"sign_out_everywhere_v1_account_sign_out_everywhere_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/stream/ticket":{"post":{"tags":["events"],"summary":"Stream Ticket","operationId":"stream_ticket_v1_stream_ticket_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/telegram":{"get":{"tags":["telegram"],"summary":"Telegram Status","operationId":"telegram_status_v1_telegram_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"delete":{"tags":["telegram"],"summary":"Unlink","operationId":"unlink_v1_telegram_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/telegram/notifications":{"get":{"tags":["telegram"],"summary":"Get Notifications","operationId":"get_notifications_v1_telegram_notifications_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"put":{"tags":["telegram"],"summary":"Put Notifications","operationId":"put_notifications_v1_telegram_notifications_put","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/telegram/language":{"put":{"tags":["telegram"],"summary":"Put Language","description":"The bot's chat language, en or zh. Display only, so no authenticator code (like /language in the bot).","operationId":"put_language_v1_telegram_language_put","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/telegram/link":{"post":{"tags":["telegram"],"summary":"Start Link","description":"Binding starts here, never in the bot (ST-TG-13 / 16).","operationId":"start_link_v1_telegram_link_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/telegram/confirm":{"post":{"tags":["telegram"],"summary":"Confirm Link","description":"The person checks the Telegram account that used the link and confirms it (ST-TG-15).","operationId":"confirm_link_v1_telegram_confirm_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/telegram/pin":{"put":{"tags":["telegram"],"summary":"Set Pin","operationId":"set_pin_v1_telegram_pin_put","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/telegram/link-claims":{"post":{"tags":["telegram"],"summary":"Link Claim","description":"The bot reports who opened a link. The answer never says whose link it was.","operationId":"link_claim_v1_telegram_link_claims_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/telegram/bindings":{"get":{"tags":["telegram"],"summary":"List Bindings","operationId":"list_bindings_v1_telegram_bindings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/telegram/bindings/{tg_user_id}/misses":{"post":{"tags":["telegram"],"summary":"Record Miss","description":"Words the bot did not understand (kept 30 days) — how its rules learn new phrases.","operationId":"record_miss_v1_telegram_bindings__tg_user_id__misses_post","parameters":[{"name":"tg_user_id","in":"path","required":true,"schema":{"type":"integer","title":"Tg User Id"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/telegram/bindings/{tg_user_id}/language":{"put":{"tags":["telegram"],"summary":"Set Language","description":"The person chose the chat language with /language (en / zh).","operationId":"set_language_v1_telegram_bindings__tg_user_id__language_put","parameters":[{"name":"tg_user_id","in":"path","required":true,"schema":{"type":"integer","title":"Tg User Id"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/playbooks":{"get":{"tags":["playbooks"],"summary":"List Playbooks","operationId":"list_playbooks_v1_playbooks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["playbooks"],"summary":"Create Playbook","operationId":"create_playbook_v1_playbooks_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookBody"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/playbooks/{playbook_id}":{"delete":{"tags":["playbooks"],"summary":"Delete Playbook","operationId":"delete_playbook_v1_playbooks__playbook_id__delete","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/.well-known/oauth-protected-resource":{"get":{"summary":"Protected Resource Metadata","operationId":"protected_resource_metadata__well_known_oauth_protected_resource_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/oauth-protected-resource/mcp":{"get":{"summary":"Protected Resource Metadata","operationId":"protected_resource_metadata__well_known_oauth_protected_resource_mcp_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/oauth-authorization-server":{"get":{"summary":"Authorization Server Metadata","operationId":"authorization_server_metadata__well_known_oauth_authorization_server_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/oauth/authorize":{"get":{"summary":"Authorize","operationId":"authorize_oauth_authorize_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Consent","operationId":"consent_oauth_authorize_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/oauth/login":{"post":{"summary":"Login","operationId":"login_oauth_login_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_login_oauth_login_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/token":{"post":{"summary":"Token","operationId":"token_oauth_token_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/oauth/revoke":{"post":{"summary":"Revoke","description":"RFC 7009: always 200. Revoking a refresh token ends the whole grant.","operationId":"revoke_oauth_revoke_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/account/signup":{"get":{"tags":["account"],"summary":"Signup Page","operationId":"signup_page_account_signup_get","parameters":[{"name":"invite","in":"query","required":false,"schema":{"type":"string","default":"","title":"Invite"}},{"name":"next","in":"query","required":false,"schema":{"type":"string","default":"","title":"Next"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["account"],"summary":"Signup","operationId":"signup_account_signup_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_signup_account_signup_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account/verify":{"get":{"tags":["account"],"summary":"Verify Page","operationId":"verify_page_account_verify_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"type":"string","default":"","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["account"],"summary":"Verify","operationId":"verify_account_verify_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_verify_account_verify_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account/forgot":{"get":{"tags":["account"],"summary":"Forgot Page","operationId":"forgot_page_account_forgot_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["account"],"summary":"Forgot","operationId":"forgot_account_forgot_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_forgot_account_forgot_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account/reset":{"get":{"tags":["account"],"summary":"Reset Page","operationId":"reset_page_account_reset_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"type":"string","default":"","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["account"],"summary":"Reset","operationId":"reset_account_reset_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_reset_account_reset_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account/login":{"get":{"tags":["account"],"summary":"Account Login Page","operationId":"account_login_page_account_login_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["account"],"summary":"Account Login","operationId":"account_login_account_login_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_account_login_account_login_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account/logout":{"post":{"tags":["account"],"summary":"Account Logout","operationId":"account_logout_account_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/account/developers":{"get":{"tags":["account"],"summary":"Developers Page","operationId":"developers_page_account_developers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/account/developers/keys":{"post":{"tags":["account"],"summary":"Create Sandbox Key","operationId":"create_sandbox_key_account_developers_keys_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/account/developers/keys/revoke":{"post":{"tags":["account"],"summary":"Revoke Sandbox Key","operationId":"revoke_sandbox_key_account_developers_keys_revoke_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/account/developers/sandbox/reset":{"post":{"tags":["account"],"summary":"Reset Sandbox Page","operationId":"reset_sandbox_page_account_developers_sandbox_reset_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/account/confirm-email":{"get":{"tags":["account"],"summary":"Confirm Email Page","description":"A button, not an automatic change: mail scanners that open links must not change anything.","operationId":"confirm_email_page_account_confirm_email_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"type":"string","default":"","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["account"],"summary":"Confirm Email","operationId":"confirm_email_account_confirm_email_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_confirm_email_account_confirm_email_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account/export":{"get":{"tags":["account"],"summary":"Download Export","operationId":"download_export_account_export_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"type":"string","default":"","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/security/secret-scanning":{"post":{"tags":["security"],"summary":"Secret Scanning","operationId":"secret_scanning_v1_security_secret_scanning_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/agents/{agent_id}/tradingview":{"post":{"summary":"Create Hook","description":"A key for this agent that only works from TradingView's addresses, and the alert messages to paste.\nShown once, like any key (ST-KY-01).","operationId":"create_hook_v1_agents__agent_id__tradingview_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HookBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/trial":{"post":{"tags":["trial"],"summary":"Start a 24-hour sandbox trial (no sign-up)","description":"A sandbox API key for 24 hours: 10,000 USDC of play money, real market prices, no email or password.\nThe account and everything in it are deleted when the key expires.","operationId":"start_trial_v1_trial_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health","description":"Health check endpoint. No authentication required.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/metrics":{"get":{"summary":"Metrics","description":"Prometheus-compatible operational metrics. No authentication, so platform-wide numbers only —\nnever any user's balances or positions.","operationId":"metrics_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AgentPerformance":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"days":{"type":"integer","title":"Days","description":"Window, in days"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id","description":"This agent (null: a person, all agents together)"},"trades":{"type":"integer","title":"Trades","description":"Positions opened in the window"},"closed":{"type":"integer","title":"Closed","description":"Of those, closed"},"wins":{"type":"integer","title":"Wins","description":"Closed with a profit"},"win_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Win Rate","description":"wins / closed, as a fraction"},"realized_pnl_usd":{"type":"number","title":"Realized Pnl Usd","description":"Sum of realised profit or loss, USD"},"average_pnl_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Average Pnl Usd","description":"realized_pnl_usd / closed, USD"},"order_calls":{"type":"integer","title":"Order Calls","description":"Previews and refusals"},"refused":{"type":"integer","title":"Refused","description":"Refused previews or executions"},"fixed_within_3_calls":{"type":"integer","title":"Fixed Within 3 Calls","description":"Refusals the agent should fix itself (error.who = agent) followed by a successful preview within the next 3 calls"},"refusals":{"items":{"$ref":"#/components/schemas/RefusalPattern"},"type":"array","title":"Refusals","description":"Most common refusals first"}},"additionalProperties":true,"type":"object","required":["days","agent_id","trades","closed","wins","win_rate","realized_pnl_usd","average_pnl_usd","order_calls","refused","fixed_within_3_calls","refusals"],"title":"AgentPerformance"},"Balances":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"total_equity":{"type":"number","title":"Total Equity","description":"Sum of equity on every connected venue, USD"},"venues":{"items":{"$ref":"#/components/schemas/VenueBalance"},"type":"array","title":"Venues","description":"One entry per connected venue"}},"additionalProperties":true,"type":"object","required":["total_equity","venues"],"title":"Balances"},"Body_account_login_account_login_post":{"properties":{"email":{"type":"string","title":"Email","default":""},"password":{"type":"string","title":"Password","default":""},"otp":{"type":"string","title":"Otp","default":""},"recovery_code":{"type":"string","title":"Recovery Code","default":""}},"type":"object","title":"Body_account_login_account_login_post"},"Body_confirm_email_account_confirm_email_post":{"properties":{"token":{"type":"string","title":"Token","default":""}},"type":"object","title":"Body_confirm_email_account_confirm_email_post"},"Body_forgot_account_forgot_post":{"properties":{"email":{"type":"string","title":"Email","default":""}},"type":"object","title":"Body_forgot_account_forgot_post"},"Body_login_oauth_login_post":{"properties":{"email":{"type":"string","title":"Email","default":""},"password":{"type":"string","title":"Password","default":""},"otp":{"type":"string","title":"Otp","default":""},"recovery_code":{"type":"string","title":"Recovery Code","default":""}},"type":"object","title":"Body_login_oauth_login_post"},"Body_reset_account_reset_post":{"properties":{"token":{"type":"string","title":"Token","default":""},"password":{"type":"string","title":"Password","default":""},"otp":{"type":"string","title":"Otp","default":""},"recovery_code":{"type":"string","title":"Recovery Code","default":""}},"type":"object","title":"Body_reset_account_reset_post"},"Body_signup_account_signup_post":{"properties":{"email":{"type":"string","title":"Email","default":""},"password":{"type":"string","title":"Password","default":""},"invite":{"type":"string","title":"Invite","default":""},"next":{"type":"string","title":"Next","default":""}},"type":"object","title":"Body_signup_account_signup_post"},"Body_verify_account_verify_post":{"properties":{"token":{"type":"string","title":"Token","default":""},"otp":{"type":"string","title":"Otp","default":""}},"type":"object","title":"Body_verify_account_verify_post"},"Candle":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"time":{"type":"string","title":"Time","description":"Candle open time, ISO 8601 UTC"},"open":{"type":"number","title":"Open","description":"Open, USD per coin"},"high":{"type":"number","title":"High","description":"High, USD per coin"},"low":{"type":"number","title":"Low","description":"Low, USD per coin"},"close":{"type":"number","title":"Close","description":"Close, USD per coin"},"volume":{"type":"number","title":"Volume","description":"Volume, in the base coin (e.g. BTC), not USD"}},"additionalProperties":true,"type":"object","required":["time","open","high","low","close","volume"],"title":"Candle"},"Candles":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"symbol":{"type":"string","title":"Symbol","description":"Base coin"},"interval":{"type":"string","title":"Interval","description":"Candle length"},"source":{"type":"string","title":"Source","description":"Where the prices come from"},"candles":{"items":{"$ref":"#/components/schemas/Candle"},"type":"array","title":"Candles","description":"Oldest first"},"high":{"type":"number","title":"High","description":"Highest high over these candles, USD per coin"},"low":{"type":"number","title":"Low","description":"Lowest low over these candles, USD per coin"},"change_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Change Pct","description":"From the first open to the last close, as a fraction"}},"additionalProperties":true,"type":"object","required":["symbol","interval","source","candles","high","low","change_pct"],"title":"Candles"},"CheckOut":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"layer":{"type":"string","title":"Layer","description":"mandate (this agent's trading permissions), user (the person's global limits), platform or venue"},"rule":{"type":"string","title":"Rule","description":"Which rule, e.g. max_risk_pct, price_band, size_step"},"status":{"type":"string","title":"Status","description":"pass or fail"},"current":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Current","description":"The order's value for this rule"},"limit":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Limit","description":"The limit it was checked against"},"message":{"type":"string","title":"Message","description":"Readable explanation","default":""}},"additionalProperties":true,"type":"object","required":["layer","rule","status"],"title":"CheckOut"},"ContractRules":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"venue":{"type":"string","title":"Venue","description":"Venue name"},"symbol":{"type":"string","title":"Symbol","description":"Base coin"},"mark_price":{"type":"number","title":"Mark Price","description":"Mark price, USD per coin"},"size_step":{"type":"number","title":"Size Step","description":"Smallest size increment, in the base coin (e.g. BTC), not USD"},"min_size":{"type":"number","title":"Min Size","description":"Smallest order, in the base coin (e.g. BTC), not USD"},"price_tick":{"type":"number","title":"Price Tick","description":"Smallest price increment, USD per coin"},"max_leverage":{"anyOf":[{"type":"integer"},{"type":"number"}],"title":"Max Leverage","description":"Highest leverage the venue allows for this contract"},"funding_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Funding Rate","description":"Funding rate per interval, as a fraction (0.0001 = 0.01%); positive: longs pay"},"funding_interval_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Funding Interval Hours","description":"Hours between funding payments"},"funding_annualized":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Funding Annualized","description":"funding_rate scaled to a year, as a fraction"}},"additionalProperties":true,"type":"object","required":["venue","symbol","mark_price","size_step","min_size","price_tick","max_leverage","funding_rate","funding_interval_hours","funding_annualized"],"title":"ContractRules"},"DecideBody":{"properties":{"approve":{"type":"boolean","title":"Approve"},"pin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pin"}},"type":"object","required":["approve"],"title":"DecideBody"},"FeeOut":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"kind":{"type":"string","title":"Kind","description":"open or close"},"estimated_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Estimated Usd","description":"The account's rate x the filled notional, USD"},"actual_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Actual Usd","description":"What the exchange charged, USD; null until its fill records show it (or when charged in another asset, see actual and asset)"},"actual":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Actual","description":"The charged amount in asset; negative = a rebate"},"asset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Asset","description":"The asset it was charged in (USDT, USDC, BNB …)"},"status":{"type":"string","title":"Status","description":"pending (not read yet), done, or unknown (the exchange never showed it)"}},"additionalProperties":true,"type":"object","required":["kind","estimated_usd","actual_usd","actual","asset","status"],"title":"FeeOut"},"FundingComparison":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"symbol":{"type":"string","title":"Symbol","description":"Base coin"},"as_of":{"type":"string","title":"As Of","description":"ISO 8601 UTC"},"ranking_basis":{"type":"string","title":"Ranking Basis","description":"How the list is ordered"},"neutrality":{"type":"string","title":"Neutrality","description":"Commercial relationships that could affect the order (none)"},"cheapest_for_longs":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cheapest For Longs","description":"Fresh venue with the lowest annualised rate (longs pay least / earn most)"},"cheapest_for_shorts":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cheapest For Shorts","description":"Fresh venue with the highest annualised rate (shorts earn most)"},"venues":{"items":{"$ref":"#/components/schemas/VenueFunding"},"type":"array","title":"Venues","description":"Highest annualised rate first"}},"additionalProperties":true,"type":"object","required":["symbol","as_of","ranking_basis","neutrality","cheapest_for_longs","cheapest_for_shorts","venues"],"title":"FundingComparison"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HookBody":{"properties":{"execute":{"type":"boolean","title":"Execute","default":false},"expires_days":{"type":"integer","title":"Expires Days","default":90}},"type":"object","title":"HookBody"},"Indicators":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"symbol":{"type":"string","title":"Symbol","description":"Base coin"},"rsi":{"type":"number","title":"Rsi","description":"RSI(14), 0-100"},"macd":{"type":"number","title":"Macd","description":"MACD line"},"macd_signal":{"type":"number","title":"Macd Signal","description":"MACD signal line"},"macd_histogram":{"type":"number","title":"Macd Histogram","description":"MACD minus signal"},"bb":{"type":"number","title":"Bb","description":"Bollinger %B (0 = lower band, 1 = upper band)"},"ema_trend":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"integer"},{"type":"null"}],"title":"Ema Trend","description":"Direction of the EMA trend"},"volume_rank":{"type":"number","title":"Volume Rank","description":"Latest volume's percentile among recent candles, 0-1"},"funding_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Funding Rate","description":"Current funding rate per interval, fraction"},"atr":{"type":"number","title":"Atr","description":"ATR(14) on 15-minute candles, USD per coin"},"close_price":{"type":"number","title":"Close Price","description":"Last close, USD per coin"},"timestamp":{"anyOf":[{"type":"integer"},{"type":"string"},{"type":"null"}],"title":"Timestamp","description":"Last candle's open time (ms since epoch)"}},"additionalProperties":true,"type":"object","required":["symbol","rsi","macd","macd_signal","macd_histogram","bb","ema_trend","volume_rank","funding_rate","atr","close_price","timestamp"],"title":"Indicators"},"KeyBody":{"properties":{"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"expires_days":{"type":"integer","title":"Expires Days","default":90},"env":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Env"},"otp":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Otp"},"allowed_ips":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Ips"}},"type":"object","required":["scopes"],"title":"KeyBody"},"MandateBody":{"properties":{"name":{"type":"string","title":"Name","default":""},"level":{"type":"string","title":"Level","default":"propose"},"first_party":{"type":"boolean","title":"First Party","default":false},"venues":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Venues","default":["hyperliquid"]},"symbols":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Symbols"},"actions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Actions"},"max_risk_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Risk Pct"},"max_leverage":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Leverage"},"max_notional_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Notional Usd"},"max_positions":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Positions"},"daily_loss_budget_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Daily Loss Budget Usd"},"daily_order_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Daily Order Limit"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"otp":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Otp"}},"type":"object","title":"MandateBody"},"OrderBook":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"venue":{"type":"string","title":"Venue","description":"Venue name"},"symbol":{"type":"string","title":"Symbol","description":"Base coin"},"bids":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Bids","description":"[price (USD per coin), size (in the base coin (e.g. BTC), not USD)], best first"},"asks":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Asks","description":"[price (USD per coin), size (in the base coin (e.g. BTC), not USD)], best first"}},"additionalProperties":true,"type":"object","required":["venue","symbol","bids","asks"],"title":"OrderBook"},"OrderOut":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"venue":{"type":"string","title":"Venue","description":"Venue name"},"order_id":{"type":"string","title":"Order Id","description":"Venue order id; Binance stops look like algo:<id>"},"symbol":{"type":"string","title":"Symbol","description":"Base coin"},"side":{"type":"string","title":"Side","description":"buy or sell"},"size":{"type":"number","title":"Size","description":"Order size, in the base coin (e.g. BTC), not USD"},"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price","description":"Limit price, USD per coin"},"type":{"type":"string","title":"Type","description":"Order type as the venue reports it"},"is_trigger":{"type":"boolean","title":"Is Trigger","description":"True for stop-loss / take-profit orders"},"trigger_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Trigger Price","description":"Trigger price, USD per coin"},"reduce_only":{"type":"boolean","title":"Reduce Only","description":"True if it can only reduce a position"},"stop_loss":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stop Loss","description":"TRIGGER_ENTRY: the stop it opens with, USD per coin"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At","description":"TRIGGER_ENTRY: when it lapses unless reached, ISO 8601 UTC"}},"additionalProperties":true,"type":"object","required":["venue","order_id","symbol","side","size","type","is_trigger","reduce_only"],"title":"OrderOut"},"Orders":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"orders":{"items":{"$ref":"#/components/schemas/OrderOut"},"type":"array","title":"Orders","description":"Resting orders, including protective stops"}},"additionalProperties":true,"type":"object","required":["orders"],"title":"Orders"},"Permissions":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"mandate":{"additionalProperties":true,"type":"object","title":"Mandate","description":"This agent's trading permissions (its mandate): level (read / propose / preauth), venues, symbols, actions, max_risk_pct (fraction of equity at stop), max_leverage, max_notional_usd, max_positions, daily_loss_budget_usd, daily_order_limit, expires_at. null on a limit = only the user's global limit"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes","description":"OAuth / API key scopes this caller holds"},"today":{"additionalProperties":true,"type":"object","title":"Today","description":"orders_today and realized_pnl_today (USD) for this agent, UTC day"},"venues_connected":{"items":{"type":"string"},"type":"array","title":"Venues Connected","description":"Venues the user has connected (sandbox is always there)"},"trading_halted":{"type":"boolean","title":"Trading Halted","description":"True after a stop: no new positions until a person resumes on the Web"},"delegation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Delegation","description":"Who this agent acts for and where its rights come from"}},"additionalProperties":true,"type":"object","required":["mandate","scopes","today","venues_connected","trading_halted"],"title":"Permissions"},"PlaybookBody":{"properties":{"name":{"type":"string","maxLength":40,"minLength":1,"title":"Name"},"symbol":{"type":"string","pattern":"^[A-Z0-9]{1,12}$","title":"Symbol"},"side":{"type":"string","enum":["buy","sell"],"title":"Side"},"usd":{"anyOf":[{"type":"number","maximum":1000000.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Usd","description":"How much, in USD"},"size":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Size","description":"Or how much, in coins"},"venue":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Venue","description":"None: the best price with enough margin"},"stop_pct":{"type":"number","maximum":0.2,"minimum":0.002,"title":"Stop Pct","description":"Stop-loss distance from the entry, 0.02 = 2% (required)"},"take_profit_pct":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.002},{"type":"null"}],"title":"Take Profit Pct"},"trail_pct":{"anyOf":[{"type":"number","maximum":0.2,"minimum":0.001},{"type":"null"}],"title":"Trail Pct"}},"type":"object","required":["name","symbol","side","stop_pct"],"title":"PlaybookBody"},"PositionOut":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"venue":{"type":"string","title":"Venue","description":"Venue name"},"symbol":{"type":"string","title":"Symbol","description":"Base coin, e.g. BTC"},"side":{"type":"string","title":"Side","description":"long or short"},"size":{"type":"number","title":"Size","description":"Position size, in the base coin (e.g. BTC), not USD"},"entry_price":{"type":"number","title":"Entry Price","description":"Average entry, USD per coin"},"mark_price":{"type":"number","title":"Mark Price","description":"Current mark, USD per coin"},"unrealized_pnl":{"type":"number","title":"Unrealized Pnl","description":"Open profit or loss, USD"},"leverage":{"anyOf":[{"type":"number"},{"type":"integer"},{"type":"null"}],"title":"Leverage","description":"Leverage, e.g. 5 for 5x"},"liquidation_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Liquidation Price","description":"Where the exchange would liquidate this position, USD per coin, as the exchange reports it; absent where there is no liquidation (the sandbox)"},"liquidation_distance_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Liquidation Distance Pct","description":"How far the mark is from the liquidation price, as a fraction (0.12 = 12%); keep the stop well inside it"},"stop_rule":{"anyOf":[{"$ref":"#/components/schemas/StopRuleOut"},{"type":"null"}],"description":"The automatic stop rule following this position, if any"}},"additionalProperties":true,"type":"object","required":["venue","symbol","side","size","entry_price","mark_price","unrealized_pnl"],"title":"PositionOut"},"Positions":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"positions":{"items":{"$ref":"#/components/schemas/PositionOut"},"type":"array","title":"Positions","description":"Open positions on every connected venue"}},"additionalProperties":true,"type":"object","required":["positions"],"title":"Positions"},"PreviewOut":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"ok":{"type":"boolean","title":"Ok","description":"True: every check passed"},"preview_id":{"type":"string","title":"Preview Id","description":"Pass to execute_previewed_order within 30 seconds"},"expires_at":{"type":"string","title":"Expires At","description":"ISO 8601 UTC"},"venue":{"type":"string","title":"Venue","description":"Venue name"},"symbol":{"type":"string","title":"Symbol","description":"Base coin"},"side":{"type":"string","title":"Side","description":"buy or sell"},"size":{"type":"number","title":"Size","description":"Size after rounding down to the venue step, in the base coin (e.g. BTC), not USD"},"mark_price":{"type":"number","title":"Mark Price","description":"Mark at preview time, USD per coin"},"notional_usd":{"type":"number","title":"Notional Usd","description":"size x entry, USD"},"risk_usd":{"type":"number","title":"Risk Usd","description":"Loss if the stop fills, USD"},"margin_usd":{"type":"number","title":"Margin Usd","description":"Margin needed, USD"},"est_fill_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Est Fill Price","description":"Market orders: average fill if executed now against the book, USD per coin; null for limit orders or when the book is too thin to say"},"est_slippage_bps":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Est Slippage Bps","description":"est_fill_price against mark_price in basis points, positive = worse; a market order never fills beyond the price band"},"est_fee_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Est Fee Usd","description":"Trading fee for this order, USD: taker rate for market orders, maker for limit; the exit pays a fee too"},"fee_rate_bps":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fee Rate Bps","description":"The rate used, basis points of notional"},"fee_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fee Source","description":"account (your own rate), published (the base rate) or none (sandbox)"},"venue_choice":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Venue Choice","description":"With venue \"best\": why this venue (all-in price and the alternatives)"},"est_funding_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Est Funding Usd","description":"With hold_hours: funding over that time at today's rate, USD; negative = received"},"est_round_trip_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Est Round Trip Cost Usd","description":"With hold_hours: entry fee, exit fee at the taker rate and that funding, USD"},"requires_approval":{"type":"boolean","title":"Requires Approval","description":"True: execute_previewed_order will wait for a person's approval"},"trigger_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Trigger Price","description":"A trigger entry: opens at market only when the mark reaches this, USD per coin"},"trigger_valid_hours":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Trigger Valid Hours","description":"A trigger entry: hours it waits before lapsing"},"checks":{"items":{"$ref":"#/components/schemas/CheckOut"},"type":"array","title":"Checks","description":"Every check that ran, all pass"}},"additionalProperties":true,"type":"object","required":["ok","preview_id","expires_at","venue","symbol","side","size","mark_price","notional_usd","risk_usd","margin_usd","requires_approval","checks"],"title":"PreviewOut"},"QuoteComparison":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"symbol":{"type":"string","title":"Symbol","description":"Base coin"},"as_of":{"type":"string","title":"As Of","description":"When this comparison was made, ISO 8601 UTC"},"ranking_basis":{"type":"string","title":"Ranking Basis","description":"How the list is ordered"},"neutrality":{"type":"string","title":"Neutrality","description":"Commercial relationships that could affect the order (none)"},"best_bid_venue":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Best Bid Venue","description":"Fresh venue with the highest bid (best to sell)"},"best_ask_venue":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Best Ask Venue","description":"Fresh venue with the lowest ask (best to buy)"},"best_venue":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Best Venue","description":"With side: the cheapest all-in venue you can use (connected, allowed, enough margin); without an account, the cheapest overall; null if none"},"venues":{"items":{"$ref":"#/components/schemas/VenueQuote"},"type":"array","title":"Venues","description":"One entry per venue that lists the coin, in ranking order"}},"additionalProperties":true,"type":"object","required":["symbol","as_of","ranking_basis","neutrality","best_bid_venue","best_ask_venue","venues"],"title":"QuoteComparison"},"RefusalPattern":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"code":{"type":"string","title":"Code","description":"Error code"},"count":{"type":"integer","title":"Count","description":"How many times in the window"},"fix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fix","description":"What to do differently (from /docs/errors)"}},"additionalProperties":true,"type":"object","required":["code","count","fix"],"title":"RefusalPattern"},"RequestOut":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"ok":{"type":"boolean","title":"Ok","description":"False when rejected or failed"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id","description":"Order request id; get_order_request_status(request_id) follows it"},"status":{"type":"string","title":"Status","description":"pending_approval, armed (a trigger entry waiting for its price), executed, rejected, failed, expired, declined, cancelled, or executing (TradeHub has not confirmed the outcome yet: check get_order_request_status)"},"venue":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Venue","description":"Venue name"},"order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Id","description":"Venue order id of the fill"},"sl_oid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sl Oid","description":"Venue order id of the protective stop"},"fill_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fill Price","description":"Average fill, USD per coin"},"filled_size":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Filled Size","description":"Filled size, in the base coin (e.g. BTC), not USD"},"approval_expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approval Expires At","description":"While pending: when the approval request lapses, ISO 8601 UTC"},"error":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Error","description":"Why it was rejected or failed"},"checks":{"anyOf":[{"items":{"$ref":"#/components/schemas/CheckOut"},"type":"array"},{"type":"null"}],"title":"Checks","description":"Checks run at execution"},"receipt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Receipt","description":"Signed receipt (compact JWS, EdDSA) once executed: request, checks, preview price, fill, slippage, order ids, delegation. Verify with /.well-known/tradehub-receipts.jwks"},"take_profits":{"anyOf":[{"items":{"$ref":"#/components/schemas/TakeProfitOut"},"type":"array"},{"type":"null"}],"title":"Take Profits","description":"set_take_profit_levels: the take-profits now on the exchange"},"trigger_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Trigger Price","description":"status armed: opens at market when the mark reaches this, USD per coin"},"trigger_expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger Expires At","description":"status armed: when it lapses unless reached, ISO 8601 UTC"},"fee":{"anyOf":[{"$ref":"#/components/schemas/FeeOut"},{"type":"null"}],"description":"Once executed: the trading fee, estimated at once and replaced by the amount the exchange charged once its fill records show it"}},"additionalProperties":true,"type":"object","required":["ok","request_id","status"],"title":"RequestOut"},"RiskUsage":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"pending_loosening":{"items":{},"type":"array","title":"Pending Loosening","description":"Limit increases a person asked for that are not in force yet"},"as_of":{"type":"string","title":"As Of","description":"ISO 8601 UTC"},"book":{"type":"string","title":"Book","description":"real or sandbox: the two are counted separately"},"equity":{"type":"number","title":"Equity","description":"Equity in this book, USD"},"open_positions":{"type":"integer","title":"Open Positions","description":"Number of open positions"},"trading_halted":{"type":"boolean","title":"Trading Halted","description":"True after a stop"},"limits":{"additionalProperties":true,"type":"object","title":"Limits","description":"max_risk_per_trade, loss limits and max_drawdown as fractions; max_leverage; max_open_positions; symbols"},"realized_pnl":{"additionalProperties":true,"type":"object","title":"Realized Pnl","description":"Realised profit or loss for day / week / month (UTC), USD"},"drawdown":{"type":"number","title":"Drawdown","description":"Drop from peak equity, as a fraction"}},"additionalProperties":true,"type":"object","required":["pending_loosening","as_of","book","equity","open_positions","trading_halted","limits","realized_pnl","drawdown"],"title":"RiskUsage"},"Sizing":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"venue":{"type":"string","title":"Venue","description":"Venue name"},"symbol":{"type":"string","title":"Symbol","description":"Base coin"},"side":{"type":"string","title":"Side","description":"buy (long) or sell (short), from the stop's side of entry"},"entry_price":{"type":"number","title":"Entry Price","description":"Entry used, USD per coin (the mark when not given)"},"stop_loss":{"type":"number","title":"Stop Loss","description":"Stop-loss used, USD per coin"},"size_base":{"type":"number","title":"Size Base","description":"Suggested size, in the base coin (e.g. BTC), not USD, rounded down to the venue's size step; pass it to preview_perp_order as size_base"},"notional_usd":{"type":"number","title":"Notional Usd","description":"size_base x entry, USD"},"risk_usd":{"type":"number","title":"Risk Usd","description":"Loss if the stop fills, USD"},"risk_pct_of_equity":{"type":"number","title":"Risk Pct Of Equity","description":"risk_usd / equity, as a fraction"},"margin_usd":{"type":"number","title":"Margin Usd","description":"Margin needed at the given leverage, USD"},"leverage":{"type":"integer","title":"Leverage","description":"Leverage assumed"},"equity_usd":{"type":"number","title":"Equity Usd","description":"Equity used for the calculation (the venue's book), USD"},"capped_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Capped By","description":"Which limit made the size smaller than asked, if any"},"within_limits":{"type":"boolean","title":"Within Limits","description":"False if even the capped size cannot pass (e.g. below the venue minimum)"}},"additionalProperties":true,"type":"object","required":["venue","symbol","side","entry_price","stop_loss","size_base","notional_usd","risk_usd","risk_pct_of_equity","margin_usd","leverage","equity_usd","capped_by","within_limits"],"title":"Sizing"},"StopOut":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"ok":{"type":"boolean","title":"Ok","description":"True when nothing is left open"},"status":{"type":"string","title":"Status","description":"Outcome of the stop"},"orders_cancelled":{"type":"integer","title":"Orders Cancelled","description":"Number of orders cancelled"},"positions_closed":{"type":"integer","title":"Positions Closed","description":"Number of positions closed (reduce-only)"},"remaining":{"items":{},"type":"array","title":"Remaining","description":"Anything that could not be closed; retry or close it by hand"},"halted":{"type":"boolean","title":"Halted","description":"Always true: new positions are blocked until a person resumes on the Web"},"sequence":{"items":{},"type":"array","title":"Sequence","description":"The steps taken, in order"},"reason":{"type":"string","title":"Reason","description":"The reason given"},"receipt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Receipt","description":"Signed receipt (compact JWS, EdDSA); verify with /.well-known/tradehub-receipts.jwks"}},"additionalProperties":true,"type":"object","required":["ok","status","orders_cancelled","positions_closed","remaining","halted","sequence","reason"],"title":"StopOut"},"StopRuleOut":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"rule_id":{"type":"string","title":"Rule Id","description":"Rule id"},"venue":{"type":"string","title":"Venue","description":"Venue name"},"symbol":{"type":"string","title":"Symbol","description":"Base coin"},"kind":{"type":"string","title":"Kind","description":"trailing or breakeven"},"trail_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Trail Pct","description":"Trailing distance behind the best price, as a fraction (0.02 = 2%)"},"activate_at":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Activate At","description":"Price from which the rule acts, USD per coin"},"best_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Best Price","description":"Best mark since the rule was set, USD per coin"},"last_stop":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Last Stop","description":"Stop this rule last set, USD per coin"},"moves":{"type":"integer","title":"Moves","description":"How many times it moved the stop"},"status":{"type":"string","title":"Status","description":"active, done, ended, replaced or cancelled"}},"additionalProperties":true,"type":"object","required":["rule_id","venue","symbol","kind","moves","status"],"title":"StopRuleOut"},"StopRuleSet":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"ok":{"type":"boolean","title":"Ok","description":"True when the rule is stored"},"venue":{"type":"string","title":"Venue","description":"Venue name"},"symbol":{"type":"string","title":"Symbol","description":"Base coin"},"rule":{"anyOf":[{"$ref":"#/components/schemas/StopRuleOut"},{"type":"null"}],"description":"The rule now following the position; null after kind=none"}},"additionalProperties":true,"type":"object","required":["ok","venue","symbol","rule"],"title":"StopRuleSet"},"TakeProfitOut":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"price":{"type":"number","title":"Price","description":"Trigger price, USD per coin"},"size_base":{"type":"number","title":"Size Base","description":"Closes this much when triggered, in the base coin (e.g. BTC), not USD"},"order_id":{"type":"string","title":"Order Id","description":"Venue order id"}},"additionalProperties":true,"type":"object","required":["price","size_base","order_id"],"title":"TakeProfitOut"},"Trade":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"venue":{"type":"string","title":"Venue","description":"Venue name"},"symbol":{"type":"string","title":"Symbol","description":"Base coin"},"side":{"type":"string","title":"Side","description":"buy or sell"},"size":{"type":"number","title":"Size","description":"Size, in the base coin (e.g. BTC), not USD"},"entry_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Entry Price","description":"Entry, USD per coin"},"stop_loss":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stop Loss","description":"Stop-loss, USD per coin"},"take_profit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Take Profit","description":"Take-profit, USD per coin"},"leverage":{"anyOf":[{"type":"number"},{"type":"integer"},{"type":"null"}],"title":"Leverage","description":"Leverage"},"pnl":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pnl","description":"Realised profit or loss before fees, USD (null while open)"},"fees_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fees Usd","description":"Trading fees for opening and closing it, USD: what the exchange charged where its fill records say, else the estimate"},"fees_settled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Fees Settled","description":"True when fees_usd is entirely the amounts actually charged"},"net_pnl":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Net Pnl","description":"pnl minus fees_usd, USD (null while open)"},"opened_at":{"type":"string","title":"Opened At","description":"ISO 8601 UTC"},"closed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Closed At","description":"ISO 8601 UTC, null while open"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id","description":"Agent that opened it"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id","description":"Order request id"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Why, as the agent that opened it wrote it; present only for your own trades"}},"additionalProperties":true,"type":"object","required":["venue","symbol","side","size","entry_price","stop_loss","take_profit","leverage","pnl","opened_at","closed_at","agent_id","request_id"],"title":"Trade"},"TradeHistory":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"trades":{"items":{"$ref":"#/components/schemas/Trade"},"type":"array","title":"Trades","description":"Newest first"}},"additionalProperties":true,"type":"object","required":["trades"],"title":"TradeHistory"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VenueBalance":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"venue":{"type":"string","title":"Venue","description":"Venue name"},"currency":{"type":"string","title":"Currency","description":"The venue's settlement stablecoin (USDC or USDT), counted as USD"},"equity":{"type":"number","title":"Equity","description":"Account equity, USD"},"available_margin":{"type":"number","title":"Available Margin","description":"Margin free for new positions, USD"},"used_margin":{"type":"number","title":"Used Margin","description":"Margin held by open positions, USD"},"unrealized_pnl":{"type":"number","title":"Unrealized Pnl","description":"Open profit or loss, USD"}},"additionalProperties":true,"type":"object","required":["venue","currency","equity","available_margin","used_margin","unrealized_pnl"],"title":"VenueBalance"},"VenueExecution":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"executions":{"type":"integer","title":"Executions","description":"Orders TradeHub executed or failed to execute there"},"fill_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fill Rate","description":"Share that filled, 0-1; null without executions"},"median_slippage_bps":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Median Slippage Bps","description":"Fill against the preview's mark, basis points, positive = worse"},"median_fee_bps":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Median Fee Bps","description":"Fee the exchange actually charged, basis points of notional (from its fill records); null until known"},"downtime_minutes":{"type":"number","title":"Downtime Minutes","description":"Minutes the venue was unreachable"}},"additionalProperties":true,"type":"object","required":["executions","fill_rate","median_slippage_bps","median_fee_bps","downtime_minutes"],"title":"VenueExecution"},"VenueFunding":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"venue":{"type":"string","title":"Venue","description":"Venue name"},"funding_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Funding Rate","description":"Rate per interval, as a fraction; positive: longs pay shorts"},"funding_interval_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Funding Interval Hours","description":"Hours between payments"},"funding_annualized":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Funding Annualized","description":"Rate scaled to a year, as a fraction"},"age_seconds":{"type":"number","title":"Age Seconds","description":"How old this reading is, in seconds"},"stale":{"type":"boolean","title":"Stale","description":"True if older than 10 seconds; ranked last"}},"additionalProperties":true,"type":"object","required":["venue","funding_rate","funding_interval_hours","funding_annualized","age_seconds","stale"],"title":"VenueFunding"},"VenueHealth":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"venues":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Venues","description":"Your connected venue accounts: connected, latency_ms, last_error, rate-limit headroom (empty without an account)"},"public_data":{"additionalProperties":true,"type":"object","title":"Public Data","description":"Per venue: ok, updated_at, error for TradeHub's public price feed"}},"additionalProperties":true,"type":"object","required":["venues","public_data"],"title":"VenueHealth"},"VenueQuote":{"properties":{"deprecation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Deprecation","description":"Present only while this tool is deprecated: replacement, removal_date, changelog"},"venue":{"type":"string","title":"Venue","description":"Venue name"},"bid":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Bid","description":"Best bid, USD per coin"},"ask":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ask","description":"Best ask, USD per coin"},"mid":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mid","description":"(bid + ask) / 2, USD per coin"},"mark":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mark","description":"Mark price, USD per coin"},"spread_bps":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spread Bps","description":"(ask - bid) / mid in basis points"},"age_seconds":{"type":"number","title":"Age Seconds","description":"How old this quote is, in seconds"},"stale":{"type":"boolean","title":"Stale","description":"True if older than 10 seconds; ranked last"},"maker_fee_bps":{"type":"number","title":"Maker Fee Bps","description":"Fee for an order that rests on the book, basis points of notional"},"taker_fee_bps":{"type":"number","title":"Taker Fee Bps","description":"Fee for an order that takes liquidity (market orders), basis points of notional"},"fee_source":{"type":"string","enum":["account","published","none"],"title":"Fee Source","description":"account: your own rate as the exchange reports it; published: the base rate (no account, or the exchange does not say); none: the sandbox"},"execution_7d":{"$ref":"#/components/schemas/VenueExecution","description":"TradeHub's measured execution on this venue, all users, last 7 days"},"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price","description":"With side: the price you would take (ask to buy, bid to sell), USD per coin"},"all_in_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"All In Price","description":"With side: price plus the taker fee, USD per coin"},"cost_bps":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Bps","description":"With side: all_in_price against the mid in basis points (half the spread plus the fee); lower is cheaper"},"quality_bps":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quality Bps","description":"With side: measured execution quality as a cost, basis points (the rule is in ranking_basis); 0 without executions"},"effective_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Effective Price","description":"With side: all_in_price adjusted by quality_bps, USD per coin; the ranking key without hold_hours"},"size_base":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Size Base","description":"With a size: the size used, base coin"},"fee_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fee Usd","description":"With a size: the taker fee in USD"},"est_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Est Cost Usd","description":"With a size: what trading at all_in_price costs against the mid, USD"},"connected":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Connected","description":"With an account: you have this venue connected"},"allowed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Allowed","description":"With an account: this agent's permissions allow it"},"free_margin_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Free Margin Usd","description":"With an account and side: free margin on this venue, USD"},"margin_needed_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Margin Needed Usd","description":"With a size: margin needed at the given leverage, USD"},"enough_margin":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enough Margin","description":"With a size: free margin covers it"},"funding_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Funding Rate","description":"With hold_hours: funding rate per interval now, positive = longs pay"},"funding_interval_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Funding Interval Hours","description":"With hold_hours: hours between funding payments"},"est_funding_bps":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Est Funding Bps","description":"With hold_hours: funding you would pay over that time at today's rate, basis points of notional; negative = you receive it"},"total_cost_bps":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Cost Bps","description":"With hold_hours: entry cost against the mid, entry and exit taker fees and that funding"},"effective_cost_bps":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Effective Cost Bps","description":"With hold_hours: total_cost_bps plus quality_bps; the ranking key"},"est_funding_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Est Funding Usd","description":"With hold_hours and a size: that funding in USD"},"est_total_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Est Total Cost Usd","description":"With hold_hours and a size: the whole round trip's cost in USD"}},"additionalProperties":true,"type":"object","required":["venue","bid","ask","mid","mark","spread_bps","age_seconds","stale","maker_fee_bps","taker_fee_bps","fee_source","execution_7d"],"title":"VenueQuote"}}}}