{
  "schema_version": 1,
  "graph_version": "1.0",
  "contract_version": "1.1",
  "entry_node": "discover_capabilities",
  "authority": {
    "permission_source": "external_agent_owner",
    "signing_location": "external",
    "accepts_private_keys": false
  },
  "nodes": [
    {
      "id": "discover_capabilities",
      "kind": "discovery",
      "summary": "Read the live capabilities that currently expose Strata operations.",
      "required_capabilities": [],
      "available": true,
      "operation": {
        "method": "GET",
        "path": "/sonar/capabilities",
        "mcp_tool": "strata_capabilities"
      }
    },
    {
      "id": "discover_markets",
      "kind": "discovery",
      "summary": "Discover ready markets, token decimals, and public operation paths.",
      "required_capabilities": [
        "markets.read"
      ],
      "available": true,
      "operation": {
        "method": "GET",
        "path": "/sonar/markets",
        "mcp_tool": "strata_markets"
      }
    },
    {
      "id": "discover_action_graph",
      "kind": "discovery",
      "summary": "Read the executable topology, live node availability, external signing steps, and transition conditions.",
      "required_capabilities": [],
      "available": true,
      "operation": {
        "method": "GET",
        "path": "/sonar/action-graph",
        "mcp_tool": "strata_action_graph"
      }
    },
    {
      "id": "discover_platform_capabilities",
      "kind": "discovery",
      "summary": "Read the versioned capabilities available through the official SDK.",
      "required_capabilities": [],
      "available": true,
      "operation": {
        "method": "GET",
        "path": "/v2/capabilities"
      }
    },
    {
      "id": "discover_platform_markets",
      "kind": "discovery",
      "summary": "Discover opaque market IDs and current market status.",
      "required_capabilities": [
        "markets.read"
      ],
      "available": true,
      "operation": {
        "method": "GET",
        "path": "/v2/markets"
      }
    },
    {
      "id": "read_book",
      "kind": "read",
      "summary": "Read a sequenced Strata book snapshot.",
      "required_capabilities": [
        "books.read"
      ],
      "available": true,
      "operation": {
        "method": "GET",
        "path": "/v2/markets/{market_id}/book"
      }
    },
    {
      "id": "read_market_status",
      "kind": "read",
      "summary": "Read tick size, minimum order size, and current market status.",
      "required_capabilities": [
        "books.read"
      ],
      "available": true,
      "operation": {
        "method": "GET",
        "path": "/v2/markets/{market_id}/status"
      }
    },
    {
      "id": "read_best_bid_ask",
      "kind": "read",
      "summary": "Read the current best bid and ask.",
      "required_capabilities": [
        "books.read"
      ],
      "available": true,
      "operation": {
        "method": "GET",
        "path": "/v2/markets/{market_id}/bbo"
      }
    },
    {
      "id": "read_fees",
      "kind": "read",
      "summary": "Read the market fee schedule.",
      "required_capabilities": [
        "books.read"
      ],
      "available": true,
      "operation": {
        "method": "GET",
        "path": "/v2/markets/{market_id}/fees"
      }
    },
    {
      "id": "read_trades",
      "kind": "read",
      "summary": "Read recent anonymized trades.",
      "required_capabilities": [
        "books.read"
      ],
      "available": true,
      "operation": {
        "method": "GET",
        "path": "/v2/markets/{market_id}/trades"
      }
    },
    {
      "id": "stream_market",
      "kind": "read",
      "summary": "Subscribe to book changes, trades, and heartbeats with automatic recovery.",
      "required_capabilities": [
        "books.read"
      ],
      "available": true,
      "operation": {
        "method": "WEBSOCKET",
        "path": "/v2/markets/{market_id}/stream"
      }
    },
    {
      "id": "authorize_account_read",
      "kind": "external_signature",
      "summary": "The agent owner's configured signer authorizes the exact account request or stream challenge.",
      "required_capabilities": [],
      "available": true
    },
    {
      "id": "read_account",
      "kind": "read",
      "summary": "Read the owner's sanitized open orders and fills for a Strata market.",
      "required_capabilities": [
        "account.read"
      ],
      "available": true,
      "operation": {
        "method": "GET",
        "path": "/v2/markets/{market_id}/account/{wallet_address}"
      }
    },
    {
      "id": "stream_account",
      "kind": "read",
      "summary": "Subscribe to signed, sequenced order and fill state for the owner.",
      "required_capabilities": [
        "account.read"
      ],
      "available": true,
      "operation": {
        "method": "WEBSOCKET",
        "path": "/v2/markets/{market_id}/account/{wallet_address}/stream"
      }
    },
    {
      "id": "request_quote",
      "kind": "read",
      "summary": "Request economics bound to a market, side, exact input atoms, and tolerance.",
      "required_capabilities": [
        "quotes.read"
      ],
      "available": true,
      "operation": {
        "method": "POST",
        "path": "/sonar/markets/{market}/quote",
        "mcp_tool": "strata_quote"
      }
    },
    {
      "id": "request_execution_challenge",
      "kind": "prepare",
      "summary": "Request canonical authorization bytes for an unexpired quote and external signer.",
      "required_capabilities": [
        "trade.prepare"
      ],
      "available": true,
      "operation": {
        "method": "POST",
        "path": "/sonar/markets/{market}/execution/challenge",
        "mcp_tool": "strata_execution_challenge"
      }
    },
    {
      "id": "sign_authorization",
      "kind": "external_signature",
      "summary": "The agent owner's configured signer signs the returned authorization bytes externally.",
      "required_capabilities": [],
      "available": true
    },
    {
      "id": "prepare_execution",
      "kind": "prepare",
      "summary": "Exchange the authorization signature for a quote-bound partially signed transaction.",
      "required_capabilities": [
        "trade.prepare"
      ],
      "available": true,
      "operation": {
        "method": "POST",
        "path": "/sonar/markets/{market}/execution/prepare",
        "mcp_tool": "strata_execution_prepare"
      }
    },
    {
      "id": "sign_transaction",
      "kind": "external_signature",
      "summary": "The external signer verifies and fills its signature slot without sending key material to Strata.",
      "required_capabilities": [],
      "available": true
    },
    {
      "id": "submit_execution",
      "kind": "submit",
      "summary": "Submit the signed transaction with an idempotency key.",
      "required_capabilities": [
        "trade.submit"
      ],
      "available": true,
      "operation": {
        "method": "POST",
        "path": "/sonar/markets/{market}/execution/submit",
        "mcp_tool": "strata_execution_submit"
      }
    },
    {
      "id": "receive_receipt",
      "kind": "receipt",
      "summary": "Receive the execution ID, Solana signature, and submitted status.",
      "required_capabilities": [],
      "available": true
    },
    {
      "id": "request_order_challenge",
      "kind": "prepare",
      "summary": "Bind a product-level place, cancel, bounded cancel-all, atomic replace, or atomic batch operation to canonical authorization bytes.",
      "required_capabilities": [
        "orders.prepare"
      ],
      "available": false,
      "operation": {
        "method": "POST",
        "path": "/v2/markets/{market_id}/orders/challenge",
        "mcp_tool": "strata_order_challenge"
      }
    },
    {
      "id": "sign_order_authorization",
      "kind": "external_signature",
      "summary": "The agent owner's configured session signer verifies the exact order set and signs externally.",
      "required_capabilities": [],
      "available": true
    },
    {
      "id": "prepare_order_control",
      "kind": "prepare",
      "summary": "Exchange the order authorization signature for a partially signed transaction.",
      "required_capabilities": [
        "orders.prepare"
      ],
      "available": false,
      "operation": {
        "method": "POST",
        "path": "/v2/markets/{market_id}/orders/prepare",
        "mcp_tool": "strata_order_prepare"
      }
    },
    {
      "id": "sign_order_transaction",
      "kind": "external_signature",
      "summary": "The external session signer verifies and fills only its transaction signature slot.",
      "required_capabilities": [],
      "available": true
    },
    {
      "id": "submit_order_control",
      "kind": "submit",
      "summary": "Submit the unchanged signed order transaction with an idempotency key.",
      "required_capabilities": [
        "orders.submit"
      ],
      "available": false,
      "operation": {
        "method": "POST",
        "path": "/v2/markets/{market_id}/orders/submit",
        "mcp_tool": "strata_order_submit"
      }
    },
    {
      "id": "receive_order_receipt",
      "kind": "receipt",
      "summary": "Receive the opaque order IDs, transaction signature, and submitted status.",
      "required_capabilities": [],
      "available": true
    },
    {
      "id": "open_order_command_stream",
      "kind": "prepare",
      "summary": "Authenticate one persistent sequenced order channel for low-latency commands, explicit self-trade policy, and pushed confirmation.",
      "required_capabilities": [
        "orders.prepare",
        "orders.submit"
      ],
      "available": false,
      "operation": {
        "method": "WEBSOCKET",
        "path": "/v2/markets/{market_id}/orders/stream"
      }
    },
    {
      "id": "maintain_dead_man",
      "kind": "submit",
      "summary": "Arm and heartbeat an exact pre-signed cancel-all that executes if the agent stops responding.",
      "required_capabilities": [
        "orders.prepare",
        "orders.submit"
      ],
      "available": false,
      "operation": {
        "method": "WEBSOCKET",
        "path": "/v2/markets/{market_id}/orders/stream"
      }
    },
    {
      "id": "certify_order_command_slo",
      "kind": "read",
      "summary": "Measure authenticated command latency, concurrency, sequence integrity, and error rate without submitting a trade.",
      "required_capabilities": [
        "orders.prepare",
        "orders.submit"
      ],
      "available": false,
      "operation": {
        "method": "WEBSOCKET",
        "path": "/v2/markets/{market_id}/orders/stream"
      }
    },
    {
      "id": "recover_order_status",
      "kind": "read",
      "summary": "Recover durable submitting, submitted, or failed status after a timeout or restart.",
      "required_capabilities": [
        "orders.submit"
      ],
      "available": false,
      "operation": {
        "method": "POST",
        "path": "/v2/markets/{market_id}/orders/status",
        "mcp_tool": "strata_order_status"
      }
    }
  ],
  "edges": [
    {
      "from": "discover_capabilities",
      "to": "discover_action_graph",
      "condition": "the returned contract version is supported"
    },
    {
      "from": "discover_action_graph",
      "to": "discover_markets",
      "condition": "markets.read is enabled"
    },
    {
      "from": "discover_action_graph",
      "to": "discover_platform_capabilities",
      "condition": "the versioned SDK contract is supported"
    },
    {
      "from": "discover_platform_capabilities",
      "to": "discover_platform_markets",
      "condition": "markets.read is enabled"
    },
    {
      "from": "discover_platform_markets",
      "to": "read_book",
      "condition": "books.read is enabled and the market is active"
    },
    {
      "from": "discover_platform_markets",
      "to": "read_market_status",
      "condition": "books.read is enabled"
    },
    {
      "from": "discover_platform_markets",
      "to": "read_best_bid_ask",
      "condition": "books.read is enabled"
    },
    {
      "from": "discover_platform_markets",
      "to": "read_fees",
      "condition": "books.read is enabled"
    },
    {
      "from": "discover_platform_markets",
      "to": "read_trades",
      "condition": "books.read is enabled"
    },
    {
      "from": "read_book",
      "to": "stream_market",
      "condition": "books.read is enabled and the snapshot sequence is accepted"
    },
    {
      "from": "discover_platform_markets",
      "to": "authorize_account_read",
      "condition": "account.read is enabled and the owner-configured signer is available"
    },
    {
      "from": "authorize_account_read",
      "to": "read_account",
      "condition": "the signature binds the wallet, market, request time, and fill limit"
    },
    {
      "from": "read_account",
      "to": "stream_account",
      "condition": "the stream challenge is signed by the same owner-configured signer"
    },
    {
      "from": "discover_markets",
      "to": "request_quote",
      "condition": "quotes.read is enabled and the market is ready"
    },
    {
      "from": "request_quote",
      "to": "request_execution_challenge",
      "condition": "trade.prepare is enabled and the quote is unexpired"
    },
    {
      "from": "request_execution_challenge",
      "to": "sign_authorization",
      "condition": "the challenge bindings match the quote and signer"
    },
    {
      "from": "sign_authorization",
      "to": "prepare_execution",
      "condition": "a valid external authorization signature is available"
    },
    {
      "from": "prepare_execution",
      "to": "sign_transaction",
      "condition": "the prepared transaction preserves the signed bindings"
    },
    {
      "from": "sign_transaction",
      "to": "submit_execution",
      "condition": "trade.submit is enabled and the signed transaction is unmodified"
    },
    {
      "from": "submit_execution",
      "to": "receive_receipt",
      "condition": "the execution ID and idempotency key match"
    },
    {
      "from": "discover_platform_markets",
      "to": "open_order_command_stream",
      "condition": "orders.prepare and orders.submit advertise websocket transport and the owner-configured session signer is available"
    },
    {
      "from": "open_order_command_stream",
      "to": "request_order_challenge",
      "condition": "signed socket authentication succeeds and an explicit self-trade prevention policy is selected"
    },
    {
      "from": "open_order_command_stream",
      "to": "maintain_dead_man",
      "condition": "the exact cancel-all authorization and transaction are externally verified and signed"
    },
    {
      "from": "open_order_command_stream",
      "to": "certify_order_command_slo",
      "condition": "a release or recurring production load certificate is required"
    },
    {
      "from": "discover_platform_markets",
      "to": "request_order_challenge",
      "condition": "orders.prepare is enabled and the market accepts order control"
    },
    {
      "from": "request_order_challenge",
      "to": "sign_order_authorization",
      "condition": "the action and exact opaque order set match owner intent"
    },
    {
      "from": "sign_order_authorization",
      "to": "prepare_order_control",
      "condition": "a valid external authorization signature is available"
    },
    {
      "from": "prepare_order_control",
      "to": "sign_order_transaction",
      "condition": "the prepared transaction preserves the signed order bindings"
    },
    {
      "from": "sign_order_transaction",
      "to": "submit_order_control",
      "condition": "orders.submit is enabled and the signed transaction is unmodified"
    },
    {
      "from": "submit_order_control",
      "to": "receive_order_receipt",
      "condition": "the control ID and idempotency key match"
    },
    {
      "from": "submit_order_control",
      "to": "recover_order_status",
      "condition": "the submission result is ambiguous or either process restarted"
    },
    {
      "from": "submit_order_control",
      "to": "maintain_dead_man",
      "condition": "the agent has resting exposure that must fail closed on disconnect"
    },
    {
      "from": "recover_order_status",
      "to": "receive_order_receipt",
      "condition": "durable status is submitted"
    }
  ]
}
