{"uid":"cap_kkKqUcb8xzhE8qWlCMamj","slug":"otto-ai-x402-trade-perpetuals-7404a8f9","name":"Otto AI x402 — Trade Perpetuals","description":"Open leveraged perpetual positions on Hyperliquid with optional native TP/SL trigger orders. Min notional $10. Max leverage varies by asset (BTC 40x, ETH 25x, SOL 20x). Supports BTC, ETH, SOL, and 100+ other markets.","url":"https://x402.ottoai.services/trade-perpetuals","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"side":{"enum":["long","short"],"type":"string","description":"Position direction"},"size":{"type":"number","description":"Notional size in USDC (NOT margin). For '$10 margin at 25x', use size=250. Required — an omitted size is rejected, never defaulted."},"asset":{"type":"string","description":"Asset ticker (BTC, ETH, SOL, etc.). HIP-3 stock perps also accept 'xyz:TSLA' form."},"leverage":{"type":"number","description":"Leverage multiplier (1-40 depending on asset)"},"stopLoss":{"type":"object","properties":{"price":{"type":"number","description":"SL as an absolute price level"},"percentage":{"type":"number","description":"SL as a percentage loss from entry (e.g. 5 = -5%)"}},"description":"Optional stop-loss trigger. Provide EITHER percentage OR price, not both."},"orderType":{"enum":["market","limit"],"type":"string","description":"Default: market."},"limitPrice":{"type":"number","description":"Required when orderType is 'limit'."},"marginMode":{"enum":["cross","isolated"],"type":"string","description":"Default: cross. Stock perps (xyz DEX) are always isolated."},"takeProfit":{"type":"object","properties":{"price":{"type":"number","description":"TP as an absolute price level"},"percentage":{"type":"number","description":"TP as a percentage gain from entry (e.g. 10 = +10%)"}},"description":"Optional take-profit trigger. Provide EITHER percentage OR price, not both."},"userAddress":{"type":"string","description":"Optional for external x402 callers — the operated account is your verified payment payer, not this field. Internal/dApp callers must send a valid EVM address."},"stopLossPrice":{"type":"number","description":"Alias for stopLoss.price. Send exactly one of the two — supplying stopLoss and stopLossPrice together is rejected, including when their values are equal."},"takeProfitPrice":{"type":"number","description":"Alias for takeProfit.price. Send exactly one of the two — supplying takeProfit and takeProfitPrice together is rejected, including when their values are equal."}}},"responseSchema":{"type":"json","example":{"side":"long","asset":"BTC","entry":{"side":"long","size":250,"orderId":"12345","outcome":"filled","leverage":25,"orderType":"market","entryPrice":67000,"filledSize":0.0037,"marginMode":"cross","positionOpen":true,"amountConfirmed":true,"sizeInContracts":0.0037,"requestedNotional":250,"requestedSizeInContracts":0.0037},"status":"partial","message":"Entry filled; stop-loss unconfirmed — verify with /modify-hl-order.","orderId":"12345","tpOrderId":"12346","entryPrice":67000,"protection":{"legs":[{"leg":"takeProfit","state":"resting","orderId":"12346"},{"leg":"stopLoss","state":"unknown","detail":"Venue did not confirm; order list unread."}],"failed":[],"filled":[],"placed":["takeProfit"],"unknown":["stopLoss"],"requested":["takeProfit","stopLoss"],"actionRequired":true},"action_required":true}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_W2N-xtSjlbFUkkASjQURi","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Opens a leveraged perpetual futures position on Hyperliquid with optional take-profit and stop-loss orders via x402 micropayment","exampleAgentPrompt":"Open a long BTC perpetual position on Hyperliquid for me — set the take-profit at $72,000 and the stop-loss at $64,000, and pay for the call with USDC on Base.","exampleUseCases":null,"resultDescription":"Returns a JSON object confirming the trade was placed, including the main order ID, take-profit order ID, stop-loss order ID, the asset traded (e.g. BTC), the side (long or short), the entry price achieved, and a success boolean.","failureModes":["Insufficient margin or collateral in Otto AI Safe account — returns error indicating underfunded account","Invalid asset symbol or unsupported perpetual market — returns error or empty response","Hyperliquid API downtime or connectivity issue — returns upstream service error","x402 payment failure due to insufficient USDC balance — returns 402 payment required error","Invalid side parameter (not long or short) — returns validation error","Stop-loss price above entry for long or below entry for short — may return order rejection"],"whenToPreferThis":"Use this endpoint when you need to programmatically execute a leveraged perpetual futures trade on Hyperliquid with optional risk management orders (TP/SL) in a single atomic call, paying per-use via USDC micropayment on Base, Polygon, or Solana. Prefer this over manual Hyperliquid interaction when automating trading strategies or building agent-driven DeFi workflows.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:48:21.638Z","isFirstParty":false}