{"openapi":"3.1.0","info":{"title":"SupraFX Public API","version":"1.0.0","description":"Unauthenticated reads and signed-envelope council write endpoints exposed by SupraFX."},"servers":[{"url":"https://suprafx.ai"}],"paths":{"/api/suprafx/rfqs":{"get":{"summary":"List recent public platform RFQs","description":"Public by default when no session-auth headers are supplied. Results are newest first and capped at 200 rows per request. Pass pagination.nextBefore as before to fetch strictly older rows.","parameters":[{"name":"scope","in":"query","schema":{"type":"string","enum":["platform"]},"description":"Optional; platform is also the unauthenticated default."},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"pair","in":"query","schema":{"type":"string"}},{"name":"taker","in":"query","schema":{"type":"string"},"description":"Exact match against the lowercase taker_address value."},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Include rows whose created_at is greater than or equal to this timestamp."},{"name":"before","in":"query","schema":{"type":"string","format":"date-time"},"description":"Include rows whose created_at is strictly less than this timestamp."},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200}}],"responses":{"200":{"description":"RFQ page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RfqPage"}}}},"400":{"description":"Invalid scope or timestamp","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadError"}}}},"500":{"description":"Orderbook query failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadError"}}}}}}},"/api/platform/trade-stats":{"get":{"summary":"Get settled-trade totals","responses":{"200":{"description":"Totals, or null totals plus an error when computation fails","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradeStats"}}}}}}},"/api/platform/balances":{"get":{"summary":"Get public on-chain balance buckets for an address","parameters":[{"name":"address","in":"query","required":true,"schema":{"type":"string"}},{"name":"ledger","in":"query","schema":{"type":"boolean","default":false},"description":"The route includes ledger entries only when the literal query value is true."},{"name":"limit","in":"query","schema":{"type":"integer","default":20,"maximum":100},"description":"Ledger limit; used only with ledger=true."}],"responses":{"200":{"description":"Address balances","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Balances"}}}},"400":{"description":"Missing address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimpleError"}}}},"500":{"description":"Balance lookup error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimpleError"}}}}}}},"/api/council/my-open-orders":{"get":{"summary":"Get an address's mirror-open RFQs and quotes","parameters":[{"name":"address","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Open orders and chain-lock context","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenOrders"}}}},"400":{"description":"Missing address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimpleError"}}}},"500":{"description":"Lookup error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimpleError"}}}}}}},"/api/reserves":{"get":{"summary":"Get latest public proof-of-reserves attestations","responses":{"200":{"description":"Latest attestation per asset, or a no_data response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reserves"}}}},"500":{"description":"Attestation lookup error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimpleError"}}}}}}},"/api/council/submit-rfq":{"post":{"summary":"Forward a signed SubmitRfq BCS envelope to the council","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["submit_rfq_envelope_bcs_hex"],"properties":{"submit_rfq_envelope_bcs_hex":{"type":"string","description":"Hex-encoded client-signed BCS envelope."}},"additionalProperties":true}}}},"responses":{"200":{"description":"Accepted, council rejection, forwarding failure, or guarded internal error; inspect body.ok and body.code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvelopeResult"}}}},"400":{"$ref":"#/components/responses/EnvelopeClientError"},"409":{"$ref":"#/components/responses/EnvelopeClientError"},"413":{"$ref":"#/components/responses/EnvelopeClientError"},"429":{"$ref":"#/components/responses/EnvelopeClientError"}}}},"/api/council/cancel-rfq":{"post":{"summary":"Forward a signed CancelRfq BCS envelope to the council","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["cancel_rfq_envelope_bcs_hex"],"properties":{"cancel_rfq_envelope_bcs_hex":{"type":"string","description":"Hex-encoded client-signed BCS envelope."}},"additionalProperties":true}}}},"responses":{"200":{"description":"Accepted, council rejection, forwarding failure, or guarded internal error; inspect body.ok and body.code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvelopeResult"}}}},"400":{"$ref":"#/components/responses/EnvelopeClientError"},"409":{"$ref":"#/components/responses/EnvelopeClientError"},"413":{"$ref":"#/components/responses/EnvelopeClientError"},"429":{"$ref":"#/components/responses/EnvelopeClientError"}}}}},"components":{"responses":{"EnvelopeClientError":{"description":"Envelope rejected before council fan-out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvelopeFailure"}}}}},"schemas":{"ReadError":{"type":"object","required":["success","error"],"properties":{"success":{"type":"boolean","const":false},"error":{"type":"string"}}},"SimpleError":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"Rfq":{"type":"object","description":"A row from the public rfqs mirror with its selected quotes relation and computed quote_count.","required":["id","created_at","quote_count"],"properties":{"id":{"type":"string","format":"uuid"},"display_id":{"type":["string","null"]},"pair":{"type":["string","null"]},"taker_address":{"type":["string","null"]},"status":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"quotes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"maker_address":{"type":["string","null"]},"rate":{},"status":{"type":["string","null"]},"created_at":{"type":["string","null"],"format":"date-time"}}}},"quote_count":{"type":"integer"}},"additionalProperties":true},"RfqPage":{"type":"object","required":["success","data","count","hasMore","nextBefore","pagination"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Rfq"}},"count":{"type":"integer"},"hasMore":{"type":"boolean"},"nextBefore":{"type":["string","null"],"format":"date-time"},"pagination":{"type":"object","required":["limit","maxLimit","before","nextBefore","hasMore"],"properties":{"limit":{"type":"integer","maximum":200},"maxLimit":{"type":"integer","const":200},"before":{"type":["string","null"],"format":"date-time"},"nextBefore":{"type":["string","null"],"format":"date-time"},"hasMore":{"type":"boolean"}}}}},"TradeStats":{"type":"object","required":["totalSettled","totalVolumeUsd"],"properties":{"totalSettled":{"type":["integer","null"]},"totalVolumeUsd":{"type":["number","null"]},"truncated":{"type":"boolean"},"error":{"type":"string"}}},"Balance":{"type":"object","required":["asset","available","locked_in_orders","locked_in_rfq","locked_in_withdraw","total"],"properties":{"asset":{"type":"string"},"available":{},"locked_in_orders":{},"locked_in_rfq":{},"locked_in_withdraw":{},"total":{}}},"Balances":{"type":"object","required":["address","balances"],"properties":{"address":{"type":"string"},"balances":{"type":"array","items":{"$ref":"#/components/schemas/Balance"}},"ledger":{"type":"array","items":{"type":"object","additionalProperties":true}}}},"OpenOrders":{"type":"object","required":["address","rfqs","quotes","lockedOrders","counts","chainChecked"],"properties":{"address":{"type":"string"},"rfqs":{"type":"array","items":{"type":"object","additionalProperties":true}},"quotes":{"type":"array","items":{"type":"object","additionalProperties":true}},"lockedOrders":{"type":"array","items":{"type":"object","required":["asset","amount"],"properties":{"asset":{"type":"string"},"amount":{"type":"string"}}}},"counts":{"type":"object","required":["rfqs","quotes","lockedOrderAssets"],"properties":{"rfqs":{"type":"integer"},"quotes":{"type":"integer"},"lockedOrderAssets":{"type":"integer"}}},"chainChecked":{"type":"boolean"}}},"ReserveChain":{"type":"object","required":["chain","verified_at","batch_number","state_root","quorum","vault","balance"],"properties":{"chain":{"type":["string","null"]},"verified_at":{"type":"string","format":"date-time"},"batch_number":{},"state_root":{},"quorum":{"type":["string","null"]},"vault":{},"balance":{"type":"number"}}},"ReserveAsset":{"type":"object","required":["asset","internal_total","accumulated_fees","on_chain_total","ratio","status","surplus","chains"],"properties":{"asset":{"type":"string"},"internal_total":{"type":"number"},"accumulated_fees":{"type":"number"},"on_chain_total":{"type":"number"},"ratio":{"type":"number"},"status":{"type":"string"},"surplus":{"type":"number"},"chains":{"type":"array","items":{"$ref":"#/components/schemas/ReserveChain"}}}},"Reserves":{"type":"object","required":["assets","timestamp","status","invariant_holds"],"properties":{"assets":{"type":"array","items":{"$ref":"#/components/schemas/ReserveAsset"}},"timestamp":{"type":["string","null"],"format":"date-time"},"as_of":{"type":["string","null"],"format":"date-time"},"status":{"type":"string","enum":["fully_backed","underbacked","unverified","no_data"]},"invariant_holds":{"type":"boolean"}}},"EnvelopeSuccess":{"type":"object","required":["ok","accepted_by","rejected_by","submit_to_chain_ms"],"properties":{"ok":{"type":"boolean","const":true},"accepted_by":{"type":"array","items":{}},"rejected_by":{"type":"array","items":{}},"submit_to_chain_ms":{"type":"number"}}},"EnvelopeFailure":{"type":"object","required":["ok","code","detail"],"properties":{"ok":{"type":"boolean","const":false},"code":{"type":"string","enum":["body_too_large","rate_limited","body_parse_error","missing_envelope","envelope_too_large","envelope_decode_error","auth_failed","event_decode_error","event_kind_not_user_signable","rfq_expired","forward_threw","no_quorum","internal_error"]},"detail":{"type":"string"},"per_validator":{"type":"array","items":{}},"submit_to_chain_ms":{"type":"number"}}},"EnvelopeResult":{"oneOf":[{"$ref":"#/components/schemas/EnvelopeSuccess"},{"$ref":"#/components/schemas/EnvelopeFailure"}]}}}}