Trading
Perps and prediction-market orders in the user’s own wallet, within their caps.
4 tools. Generated from the Swop MCP server’s own tools/list (server version 0.2.2), so names, inputs and limits match what your client sees.
swop_perps_order
Open or close a perps position · Sign-in: perps.trade · /mcp only · Preview, then confirm · Changes or moves things
Open or close a Hyperliquid perpetual position for the linked user, within their margin and leverage caps set in the Swop app. The cap is MARGIN per position (e.g. $25) with a leverage ceiling (e.g. 5x) — so $25 at 5x controls ~$125 of exposure. TWO-STEP like swop_send: call WITHOUT confirm to preview (coin, direction, margin, leverage, resulting exposure, mark price); ALWAYS show the user the leverage and exposure and get explicit confirmation; then call again with previewId and confirm: true. reduceOnly:true closes/reduces an existing position. Over-cap or no delegation returns a Swop-app approval link. Perps are leveraged and can be liquidated — make the risk clear to the user.
| Input | Type | Required | Description |
|---|---|---|---|
coin | string | Yes | Perp market symbol, e.g. "BTC", "ETH", "SOL" (min length 1) |
direction | "long" | "short" | Yes | long = buy/up, short = sell/down |
marginUsd | number | Yes | Margin (collateral) in USD to commit (max 500; > 0) |
leverage | number | Yes | Leverage multiplier (capped by the user's setting and the market max) (min 1; max 20) |
reduceOnly | boolean | No | true to close/reduce an existing position instead of opening |
previewId | string | No | From the preview step |
confirm | boolean | No | true ONLY after the user confirmed the preview (with leverage + exposure shown) |
swop_get_my_predictions
See my prediction bets · Sign-in: wallet.read · /mcp only · Read-only
The linked user's prediction-market (Polymarket) positions with live marks, their open limit orders, and their pUSD betting balance. Use it before selling (gives each position's tokenId and shares) or cancelling (gives orderId). To find new markets use swop_search_markets.
No inputs.
swop_prediction_order
Buy or sell a prediction outcome · Sign-in: predictions.trade · /mcp only · Preview, then confirm · Changes or moves things
Buy or sell a prediction-market outcome (Polymarket) from the linked user's wallet. TWO-STEP like swop_send: call WITHOUT confirm to preview (live-book price, shares, cost, worst price, payout, caps and limits that apply); show the user that summary and get an explicit yes; then call again with only previewId and confirm: true. Pick the outcome by tokenId — the clobTokenIds entry at the same index as the outcome in swop_search_markets / swop_get_event_markets results — or by eventSlug + outcome name. Size with amountUsd OR shares: each share pays $1 if the outcome wins. Omit limitPrice for a market order (fills now, never worse than maxSlippageCents); set limitPrice (0-1) for a resting limit order. BUYs obey the user's AI spending caps and their Goldman prediction limits; a refusal names the limit. To sell, pass side SELL and the position's tokenId from swop_get_my_predictions.
| Input | Type | Required | Description |
|---|---|---|---|
side | "BUY" | "SELL" | No | BUY to open/add, SELL to close/reduce. Required for a preview |
tokenId | string | No | Outcome token id: one entry of clobTokenIds |
eventSlug | string | No | Instead of tokenId: the eventSlug of a market result |
outcome | string | No | With eventSlug: outcome name, e.g. "Steelers" or "Yes" |
marketSlug | string | No | With eventSlug: the market slug, when several markets share outcome names (moneyline vs spread) |
amountUsd | number | No | Dollar size: spend (BUY) or raise (SELL) (max 1000; > 0) |
shares | number | No | Share size instead of amountUsd (> 0) |
limitPrice | number | No | Limit price as a probability, e.g. 0.42 = 42¢. Omit for a market order (> 0; < 1) |
maxSlippageCents | integer | No | Market orders: cents past the quoted price to accept, default 2 (min 0; max 5) |
previewId | string | No | From the preview step |
confirm | boolean | No | true ONLY after the user explicitly confirmed the preview |
swop_cancel_prediction_order
Cancel a prediction limit order · Sign-in: predictions.trade · /mcp only · Changes or moves things
Cancel one of the linked user's open prediction-market limit orders. Takes an orderId from swop_get_my_predictions; shares already filled stay filled. Confirm which order with the user first.
| Input | Type | Required | Description |
|---|---|---|---|
orderId | string | Yes | Order id from swop_get_my_predictions openOrders (pattern ^0x[a-fA-F0-9]\{64\}$) |