{
  "schema": "suprafx-agent-skill/1",
  "name": "suprafx",
  "version": "sdk-0.4.1",
  "description": "Trade on SupraFX — an RFQ venue for cross-chain and same-chain swaps on Supra, Ethereum, Robinhood Chain, Arc and Tempo, settled by a BFT Settlement Council. Works with any agent: MCP clients use the bundled server; other frameworks call the same tools through the TypeScript SDK or sign envelopes over raw REST.",
  "homepage": "https://suprafx.ai/agents",
  "network": "mainnet",
  "install": {
    "mcp_server": {
      "npm_package": "suprafx-agent-sdk",
      "min_version": "0.4.1",
      "install": "npm install -g suprafx-agent-sdk",
      "configure": "suprafx-mcp init",
      "command": "suprafx-mcp",
      "transport": "stdio",
      "note": "Do NOT install the scoped `@suprafx/agent-sdk` — it is abandoned at 0.1.1."
    },
    "sdk": {
      "npm_package": "suprafx-agent-sdk",
      "import": "SupraFxClient, DelegateSigner",
      "repo": "https://github.com/jtobkin/suprafx-agent-sdk"
    },
    "raw_rest": {
      "signing_recipe": "https://github.com/jtobkin/suprafx-agent-sdk/blob/main/INTEGRATING-AGENTS.md",
      "openapi": "https://suprafx.ai/openapi.json"
    }
  },
  "docs": {
    "start_here": "https://suprafx.ai/agent-setup.md",
    "guide": "https://suprafx.ai/agents",
    "llms_index": "https://suprafx.ai/llms.txt",
    "llms_full": "https://suprafx.ai/llms-full.txt",
    "openapi": "https://suprafx.ai/openapi.json",
    "cookbook": "https://github.com/jtobkin/suprafx-agent-sdk/tree/main/cookbook"
  },
  "chains": [
    {
      "name": "Supra",
      "tag": "supra",
      "status": "Live",
      "assets": "SUPRA, iUSDC, iUSDT"
    },
    {
      "name": "Ethereum",
      "tag": "ethereum",
      "status": "Live",
      "assets": "ETH, USDC, USDT"
    },
    {
      "name": "Robinhood Chain",
      "tag": "robinhood",
      "status": "Live",
      "assets": "USDG + tokenized stocks: AAPL, NVDA, TSLA, AMZN, MSFT, META, SPY, QCOM"
    },
    {
      "name": "Arc",
      "tag": "arc",
      "status": "Live",
      "assets": "USDC (listed as USDC.arc), EURC — stablecoins only"
    },
    {
      "name": "Tempo",
      "tag": "tempo",
      "status": "Live",
      "assets": "pathUSD, USDC.e, USDT0 — stablecoins only"
    }
  ],
  "chains_note": "An asset is tradeable once `list_assets` returns it. Use suprafx-agent-sdk 0.4.1 or later: before 0.3.3 the SDK derives the wrong asset id for Robinhood, Arc and Tempo (the trade is rejected), before 0.4.0 it cannot choose an order's expiry, and before 0.4.1 its default expiry is a fixed 545 batches — about 5 minutes at today's ~0.6 s blocks.",
  "setup": {
    "model": "A master wallet (StarKey) authorizes a local ed25519 DELEGATE key on chain with per-asset caps, allowed pairs and an expiry. The agent only ever holds the delegate key; it can trade within the caps but cannot withdraw funds.",
    "steps": [
      "Connect StarKey: Open this site, connect your master wallet.",
      "Open Profile → Delegates: Right-side panel, top navigation.",
      "Click Create Delegate, then Generate: Generates an ed25519 keypair locally and pre-fills the form. The JSON file with the private key downloads ONLY after step 5, when the master signature is committed to chain.",
      "Set per-asset caps + expiry: Bound what the delegate can do: max trade size, max cumulative earmark per asset, allowed pairs, expiry batch. Caps must be positive — a value of 0 means 'no trades allowed for this asset' (fail-closed).",
      "Sign the policy with StarKey: One signature. The DelegatePolicyCreated event commits to chain in ~1 second. The JSON download triggers AFTER the on-chain commit succeeds — keep it safe, this is the only copy.",
      "Pass the JSON to suprafx-mcp init: The wizard prompts for the path; it never sends the key anywhere."
    ],
    "first_calls": [
      "get_setup_status",
      "preflight",
      "list_assets",
      "get_balances"
    ]
  },
  "direction": "A pair is written BASE/QUOTE. The taker (RFQ creator) sells BASE and receives QUOTE. A maker quoting on that RFQ pays QUOTE and receives BASE. Read the pair before every write.",
  "tools": [
    {
      "name": "get_setup_status",
      "kind": "read",
      "moves_money": false,
      "description": "Where you are in setup and the single next step. Call it first."
    },
    {
      "name": "preflight",
      "kind": "read",
      "moves_money": false,
      "description": "Nine checks that decide whether it is safe to trade right now, each with the action that clears it: venue reachable, venue batch actually advancing (not just the L1), assets resolving to registered ids, oracle freshness, custody, sequence drift, funding, and stale own-RFQs still holding collateral."
    },
    {
      "name": "list_my_open_orders",
      "kind": "read",
      "moves_money": false,
      "description": "Every order of yours still holding locked funds — RFQs and quotes — each with the exact call that releases it. The answer to 'where did my money go'."
    },
    {
      "name": "get_deposit_status",
      "kind": "read",
      "moves_money": false,
      "description": "Is a deposit still crediting, credited, or failed? One deposit by chain + tx_hash, or every claim of the master. state is pending | credited | rejected | expired; stale on a pending claim is the fresh-wallet delay (15+ min), NOT a failure — wait and re-read, never re-send. found:false means no claim was recorded; the deposit can still credit, read get_balances."
    },
    {
      "name": "get_master_address",
      "kind": "read",
      "moves_money": false,
      "description": "The master address the server is configured with. Balances and locks live on the master, never on the delegate."
    },
    {
      "name": "get_oracle_price",
      "kind": "read",
      "moves_money": false,
      "description": "Venue fair value for a pair WITH the quote's age and a stale flag. Never quote against a stale oracle (older than 120s)."
    },
    {
      "name": "get_chain_info",
      "kind": "read",
      "moves_money": false,
      "description": "Chain ID hash + threshold + validator count"
    },
    {
      "name": "get_current_batch",
      "kind": "read",
      "moves_money": false,
      "description": "Current committed batch height (chain health probe)"
    },
    {
      "name": "get_sequence_number",
      "kind": "read",
      "moves_money": false,
      "description": "Next strict-monotonic seq an address must use"
    },
    {
      "name": "list_assets",
      "kind": "read",
      "moves_money": false,
      "description": "All supported assets with chain ID + decimals"
    },
    {
      "name": "get_balances",
      "kind": "read",
      "moves_money": false,
      "description": "A master's available + locked balances per asset. The tie-breaker read whenever a write reports an unknown outcome."
    },
    {
      "name": "get_orderbook",
      "kind": "read",
      "moves_money": false,
      "description": "Open RFQs with optional pair / status / taker / since / before / limit filters"
    },
    {
      "name": "get_my_identity",
      "kind": "read",
      "moves_money": false,
      "description": "Your delegate address + current sequence number"
    },
    {
      "name": "submit_rfq",
      "kind": "write",
      "moves_money": true,
      "description": "Open an RFQ as taker. Locks sell-asset from master balance. Supports auto-accept (pre-commit a target rate → qualifying quotes settle with no accept step) and partial fills (allow_partial_fills + min_fill_size → fill in slices)."
    },
    {
      "name": "place_quote",
      "kind": "write",
      "moves_money": true,
      "description": "Quote on an open RFQ as maker. Locks quote-asset."
    },
    {
      "name": "accept_quote",
      "kind": "write",
      "moves_money": true,
      "description": "As taker, pick a maker's quote → settle."
    },
    {
      "name": "cancel_rfq",
      "kind": "write",
      "moves_money": true,
      "description": "As taker, withdraw your open RFQ. Returns locked balance."
    },
    {
      "name": "withdraw_quote",
      "kind": "write",
      "moves_money": true,
      "description": "As maker, pull a pending quote off the book. NOT a fund withdrawal — the delegate key cannot move money off the platform."
    }
  ],
  "rules": {
    "write_outcomes": [
      "ok:true is not proof: A write is accepted at ingress before validators apply it, and can still be rejected on chain with nothing to tell you. So every write returns a `lifecycle`: `applied` (a state read confirmed it), `rejected` (ingress refused it), or `unknown` (accepted, not yet confirmed).",
      "unknown is not a failure: `unknown` means 'I do not know yet' — the write may still commit, and may already have locked funds. Do NOT retry blindly. Read state back with get_balances and list_my_open_orders.",
      "Guarded by default: Money tools require `acknowledged: true` on every call. An unattended loop opts out once, at launch, with --allow-dangerous. A monitor that must never trade runs with --tools=read; --tools=read,cancel is release-only."
    ],
    "order_expiry": [
      "Every order expires: RFQs and quotes carry an expiry in council batches. On suprafx.ai the default is about 30 minutes, converted to batches from the chain's live pace (so it stays ~30 min as blocks get faster). `submit_rfq` and `place_quote` take `expires_in_batches` (minimum 12, maximum 200,000); omit it and SDK 0.4.1+ asks the venue for the same ~30-minute default (older SDKs use a fixed 545 batches — about 5 minutes at today's ~0.6 s blocks — so upgrade or pass a value). Expiry is chain state, not a local clock.",
      "Funds come back on their own: When an order expires, or can no longer fill, the chain releases its locked funds — no cancel needed. Losing quotes are released as soon as another quote wins. A quote can never outlive its parent RFQ.",
      "Statuses to expect: `Expired` and `Unfillable` are final and hold no funds. `list_my_open_orders` lists only orders still locking money, with the call that releases each one.",
      "Check it is live: `preflight` and `get_setup_status` read `/api/council/consensus-params` and report whether expiry is active; GET `https://suprafx.ai/api/council/consensus-params` shows `lock_release_activation_batch` and the limits above."
    ],
    "security": [
      "Local key only: Delegate private key stored at ~/.suprafx/config.json (mode 0600). MCP transport is stdio. The key never touches the network.",
      "Bounded on chain: Master's DelegatePolicyCreated sets per-asset caps (0 = no trades for that asset), allowed pairs, expiry. A leaked key cannot exceed these bounds and is auto-expired at the deadline.",
      "Cannot withdraw: The delegate key routes only the five trade endpoints. Moving funds off SupraFX is a master-signed action from the dApp, so a compromised agent key can trade within its caps but cannot take the money out.",
      "Instant revoke: Profile → Delegates → Deactivate. One master signature. Every subsequent envelope from the delegate is rejected within ~2 seconds."
    ],
    "fees": [
      "Trade fee: Flat, the same for everyone (council-rust crates/protocol/src/fees.rs). The taker pays 5 bps (0.05%) of the quote amount (size × rate); the maker RECEIVES a 1 bp (0.01%) rebate on every fill; the protocol keeps the 4 bp difference. No volume tiers. Netted at settlement — it does not change the on-chain rate. Price quotes to clear your costs plus this.",
      "Withdrawal fee: Currently FREE — waived since 2026-07-18. If it is switched back on it is a flat amount of SUPRA (not a USD peg), always paid in SUPRA even for non-SUPRA assets. Read GET /api/platform/withdraw/fee-quote before promising a figure: it returns the exact SUPRA the chain will debit and waived: true while it is free. Master-side only: there is no withdraw tool and the delegate key cannot withdraw."
    ]
  },
  "system_prompt": "You trade on SupraFX (mainnet, real money) through the SupraFX tools. Start every session with get_setup_status, then preflight; do not trade if preflight says it is unsafe. Use list_assets as the source of truth for what is tradeable and pass symbols exactly as it returns them (e.g. USDC.arc is Arc USDC, a different asset from Ethereum USDC). Before any write, state the pair direction in plain words (what you give, what you get), the size, the rate versus get_oracle_price, and the expiry, and get the user's confirmation unless they explicitly started an unattended loop with limits. A write's ok:true is not proof — read its lifecycle; on `unknown`, re-read get_balances and list_my_open_orders instead of retrying. Orders expire on chain and refund themselves; use list_my_open_orders to see what still holds funds. You cannot withdraw funds; withdrawals are a master-wallet action in the SupraFX app."
}
