{
	"openapi": "3.1.0",
	"info": {
		"title": "Khalani API v3",
		"version": "1.4.0",
		"description": "The chain-neutral order API: one flow for EVM contract deposits and non-EVM transfers. Every route needs\nyour API key, the same one `/v2` takes, and your commercial terms and order deadline apply to every order.\nGuides, a quickstart and Markdown copies for coding agents are at https://docs.khalani.network (start an agent at\nhttps://docs.khalani.network/llms.txt).\n\n| Base URL | Authentication |\n|---|---|\n| `https://api.hyperstream.dev` | Your API key in the `X-API-Key` header, from your backend only. |\n\n- The optional `API-Revision` header names the revision you're built against; `0` is the only one. Without it, a\n  request gets the revision that was current when your integration was set up. A breaking change ships as the next one.\n- Chains are CAIP-2 ids and assets CAIP-19 ids, as `/v3/catalog` lists them. An `Account` is `{ chain, address }`.\n- Solana USDT (six decimals) uses `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB`; check the catalog for availability.\n- An `AssetAmount` is `{ asset, amount }`: `asset` is an `Asset`, `{ id, chain, symbol, decimals }`, and `amount` a decimal\n  string of integer base units, which is all a request takes. Times are RFC 3339 UTC. A `TransactionRef` is `{ chain, hash }`.\n- Fields are present unless marked optional; `null` means unknown or not applicable. Ignore fields you don't know.\n- A request with a field or query parameter its route doesn't take is a `400 VALIDATION_FAILED` naming it in `field`.\n- A list described as open can gain values: show an unknown value as is. Every other list is closed; values marked reserved\n  aren't sent yet.\n- Every error is an `ApiError`. Its `recovery` says what to do next, whatever the `code`, a code you don't know included:\n  `retry` waits `retryAfterSeconds` when set. Quote `requestId` when you contact Khalani.\n- No request takes an `Idempotency-Key`. A quote option makes one order and an order has one cancel signature, so\n  sending the same request again never does anything twice. Whether it can help is the error's `recovery`.\n\n### 0G USDC.e\nChain `eip155:16661`; asset `eip155:16661/erc20:0x1f3AA82227281cA364bFb3d253B0f1af1Da6473E`, with 6 decimals.\nUSDC.e is USDC bridged through Chainlink CCIP, backed by USDC locked on Ethereum; it is not Circle-issued USDC on 0G.\nDelivery into 0G typically takes about 20 minutes and needs at least 30 minutes left before the order's deadline.\nFund promptly. An unfilled remainder expires at `fillBy` and is returned through normal settlement. Orders out of 0G are fast.\nCheck the live catalog before using these illustrative quote requests; trade size must fit the quoted range.\n\nBase USDC to 0G USDC.e\n```json\n{\n  \"send\": {\n    \"asset\": \"eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\",\n    \"amount\": \"5000000\"\n  },\n  \"receive\": {\n    \"asset\": \"eip155:16661/erc20:0x1f3AA82227281cA364bFb3d253B0f1af1Da6473E\"\n  }\n}\n```\n\n0G USDC.e to Base USDC\n```json\n{\n  \"send\": {\n    \"asset\": \"eip155:16661/erc20:0x1f3AA82227281cA364bFb3d253B0f1af1Da6473E\",\n    \"amount\": \"5000000\"\n  },\n  \"receive\": {\n    \"asset\": \"eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\"\n  }\n}\n```"
	},
	"servers": [
		{
			"url": "https://api.hyperstream.dev"
		}
	],
	"paths": {
		"/v3/catalog": {
			"get": {
				"operationId": "getCatalog",
				"summary": "List the chains and assets",
				"description": "The chains and assets v3 trades, each asset with its flat fees, and your operator fee and commission. Any listed asset\ntrades against any other, so pairs are not listed. Quote with these ids.",
				"security": [
					{
						"ApiKeyAuth": []
					}
				],
				"parameters": [
					{
						"$ref": "#/components/parameters/ApiRevision"
					}
				],
				"responses": {
					"200": {
						"description": "The catalog.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Catalog"
								},
								"example": {
									"chains": [
										{
											"id": "eip155:42161",
											"name": "Arbitrum One"
										},
										{
											"id": "eip155:8453",
											"name": "Base"
										},
										{
											"id": "eip155:16661",
											"name": "0G Mainnet"
										}
									],
									"assets": [
										{
											"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
											"chain": "eip155:42161",
											"symbol": "USDC",
											"decimals": 6,
											"depositFee": "150000",
											"withdrawFee": "150000"
										},
										{
											"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
											"chain": "eip155:8453",
											"symbol": "USDC",
											"decimals": 6,
											"depositFee": "150000",
											"withdrawFee": "150000"
										},
										{
											"id": "eip155:16661/erc20:0x1f3AA82227281cA364bFb3d253B0f1af1Da6473E",
											"chain": "eip155:16661",
											"symbol": "USDC.e",
											"decimals": 6,
											"depositFee": "0",
											"withdrawFee": "0"
										}
									],
									"operatorFeeBps": 3,
									"commissionBps": 2
								}
							}
						}
					},
					"400": {
						"description": "`VALIDATION_FAILED`: an unsupported `API-Revision` header or a query parameter the route doesn't take. `field` names the invalid input.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "VALIDATION_FAILED",
									"message": "Unknown API-Revision. Valid values are [\"0\"]",
									"details": null,
									"field": "API-Revision",
									"recovery": "fix_request",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"401": {
						"description": "`UNAUTHENTICATED`: the `X-API-Key` header is missing.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "UNAUTHENTICATED",
									"message": "X-API-Key required",
									"details": null,
									"field": null,
									"recovery": "fix_request",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"403": {
						"description": "`FORBIDDEN`: the key is unknown or inactive, or your terms can't be used. It is about your account: don't retry.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "FORBIDDEN",
									"message": "Unknown or inactive integrator",
									"details": null,
									"field": null,
									"recovery": "contact_support",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"429": {
						"description": "`RATE_LIMITED`: too many requests from your IP, or, on quote and create-order, from your integrator. Retry after `retryAfterSeconds`.",
						"headers": {
							"Retry-After": {
								"description": "Seconds to wait.",
								"schema": {
									"type": "integer"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "RATE_LIMITED",
									"message": "Too many requests, retry later",
									"details": null,
									"field": null,
									"recovery": "retry",
									"retryAfterSeconds": 60,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"500": {
						"description": "`INTERNAL`: an unexpected failure that sending the request again won't fix. Contact Khalani with `requestId`.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "INTERNAL",
									"message": "Internal error",
									"details": null,
									"field": null,
									"recovery": "contact_support",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"503": {
						"description": "`UPSTREAM_UNAVAILABLE`: your terms couldn't be read. Retry later.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "UPSTREAM_UNAVAILABLE",
									"message": "Integrator terms are temporarily unreadable",
									"details": null,
									"field": null,
									"recovery": "retry",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					}
				}
			}
		},
		"/v3/quote": {
			"post": {
				"operationId": "quote",
				"summary": "Quote a trade",
				"description": "Prices sending `send.amount` of one asset for another and returns the options to create an order from. Nothing is stored.\n\nPass an option's `id` to `POST /orders` unchanged before `expiresAt`. An option makes one order. Skip an option whose\n`requires` names a capability you lack. A size out of range is a `422` carrying the range that would quote.",
				"security": [
					{
						"ApiKeyAuth": []
					}
				],
				"parameters": [
					{
						"$ref": "#/components/parameters/ApiRevision"
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/QuoteRequest"
							},
							"example": {
								"send": {
									"asset": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
									"amount": "100000000"
								},
								"receive": {
									"asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The options.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/QuoteResponse"
								},
								"example": {
									"expiresAt": "2026-08-17T20:53:20Z",
									"options": [
										{
											"id": "opt_eyJ2IjoxLC4uLn0",
											"requires": ["format:evm_call"],
											"roles": [
												{
													"role": "payer",
													"chain": "eip155:42161",
													"required": true,
													"defaultFrom": null,
													"constraint": "sender_bound"
												},
												{
													"role": "recipient",
													"chain": "eip155:8453",
													"required": true,
													"defaultFrom": null,
													"constraint": null
												},
												{
													"role": "refundTo",
													"chain": "eip155:42161",
													"required": false,
													"defaultFrom": "payer",
													"constraint": null
												}
											],
											"terms": {
												"send": {
													"asset": {
														"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
														"chain": "eip155:42161",
														"symbol": "USDC",
														"decimals": 6
													},
													"amount": "100000000"
												},
												"receiveAsset": {
													"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
													"chain": "eip155:8453",
													"symbol": "USDC",
													"decimals": 6
												},
												"minRate": "0.99620254",
												"slippageBps": 0,
												"fundWithinSeconds": 2400,
												"fillWithinSeconds": 3600
											},
											"display": {
												"send": {
													"asset": {
														"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
														"chain": "eip155:42161",
														"symbol": "USDC",
														"decimals": 6
													},
													"amount": "100000000"
												},
												"receive": {
													"asset": {
														"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
														"chain": "eip155:8453",
														"symbol": "USDC",
														"decimals": 6
													},
													"amount": "99620254"
												},
												"receiveMin": {
													"asset": {
														"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
														"chain": "eip155:8453",
														"symbol": "USDC",
														"decimals": 6
													},
													"amount": "99620254"
												},
												"protocolFee": {
													"asset": {
														"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
														"chain": "eip155:42161",
														"symbol": "USDC",
														"decimals": 6
													},
													"amount": "329910"
												},
												"flatFee": {
													"asset": {
														"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
														"chain": "eip155:42161",
														"symbol": "USDC",
														"decimals": 6
													},
													"amount": "300000"
												},
												"relayFee": {
													"asset": {
														"id": "eip155:42161/slip44:60",
														"chain": "eip155:42161",
														"symbol": "ETH",
														"decimals": 18
													},
													"amount": "100000000000000"
												}
											},
											"actions": {
												"cancel": {
													"available": true,
													"reason": null,
													"signer": "refundTo",
													"format": "eip191_cancel_proof"
												}
											}
										}
									]
								}
							}
						}
					},
					"400": {
						"description": "`VALIDATION_FAILED`, `UNSUPPORTED_ASSET` (not in the catalog) or `UNSUPPORTED_PAIR` (the same asset twice, a deadline that leaves no time to fund, or a pair that can't be quoted).",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "UNSUPPORTED_ASSET",
									"message": "eip155:1/erc20:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 is not in the catalog",
									"details": null,
									"field": "send.asset",
									"recovery": "fix_request",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"401": {
						"description": "`UNAUTHENTICATED`: the `X-API-Key` header is missing.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "UNAUTHENTICATED",
									"message": "X-API-Key required",
									"details": null,
									"field": null,
									"recovery": "fix_request",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"403": {
						"description": "`FORBIDDEN`: the key is unknown or inactive, or your terms can't be used. It is about your account: don't retry.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "FORBIDDEN",
									"message": "Unknown or inactive integrator",
									"details": null,
									"field": null,
									"recovery": "contact_support",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"422": {
						"description": "`AMOUNT_TOO_SMALL` or `AMOUNT_TOO_LARGE`, with the range that would quote in `details`. At or below the flat fee, `minAmount` only clears the fee and `maxAmount` is null: quote again at `minAmount` for the full range.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "AMOUNT_TOO_SMALL",
									"message": "Requested amount is below what the solver will fill",
									"details": {
										"minAmount": {
											"asset": {
												"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
												"chain": "eip155:42161",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "5000000"
										},
										"maxAmount": {
											"asset": {
												"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
												"chain": "eip155:42161",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "250000000000"
										}
									},
									"field": "send.amount",
									"recovery": "fix_request",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"429": {
						"description": "`RATE_LIMITED`: too many requests from your IP, or, on quote and create-order, from your integrator. Retry after `retryAfterSeconds`.",
						"headers": {
							"Retry-After": {
								"description": "Seconds to wait.",
								"schema": {
									"type": "integer"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "RATE_LIMITED",
									"message": "Too many requests, retry later",
									"details": null,
									"field": null,
									"recovery": "retry",
									"retryAfterSeconds": 60,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"500": {
						"description": "`INTERNAL`: an unexpected failure that sending the request again won't fix. Contact Khalani with `requestId`.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "INTERNAL",
									"message": "Internal error",
									"details": null,
									"field": null,
									"recovery": "contact_support",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"503": {
						"description": "`MAINTENANCE`: order creation is paused. `UPSTREAM_UNAVAILABLE`, `PRICE_UNAVAILABLE`, `NO_CAPACITY`: a dependency, our storage or the market can't serve the request now. Retry later.",
						"headers": {
							"Retry-After": {
								"description": "Seconds to wait.",
								"schema": {
									"type": "integer"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "MAINTENANCE",
									"message": "Order creation is paused for maintenance",
									"details": null,
									"field": null,
									"recovery": "retry",
									"retryAfterSeconds": 300,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					}
				}
			}
		},
		"/v3/orders": {
			"post": {
				"operationId": "createOrder",
				"summary": "Create an order",
				"description": "Creates the order an option describes, for the accounts you give, and returns it with the steps that fund it.\n\n- EVM source: `payer` is required and must send the deposit. `refundTo` defaults to `payer`.\n- Non-EVM source: no `payer`, since anyone may send the transfer. `refundTo` is required.\n\nZcash funding, recipients and refund accounts require transparent addresses. Unified and Sapling addresses are rejected.\nZEC pairs cannot cancel early.\n\nWhen early cancellation is available, `refundTo` signs cancels: an account one key controls, or on EVM a contract wallet\nthat signs through EIP-1271, such as a Safe. Not an exchange address.\n\nAn option makes one order, so an identical repeat is always safe: send one after a lost answer, or after an error whose\n`recovery` is `retry`. If the first one created the order, you get it back, even after the quote expired: `200`, or `201`\nwhen this request finished creating it. If creation reserved the option but did not finish, an identical repeat resumes\nwith the same IDs and original deadlines, even after quote expiry, while the original funding window remains open.\nIf no reservation was made, the quote must still be valid. `410 QUOTE_EXPIRED` means the quote expired before reservation\nor the reserved order's funding window closed before creation finished. A repeat is identical when it names the same accounts, however it writes their\naddresses, and leaving `refundTo` out is the same as giving its default; a Stellar `M…` address and its `G…` account\nare different accounts. The same option with other accounts is a\n`409 QUOTE_USED` once the option is reserved, whether creation is unfinished or completed: request a new quote.\nUnfinished creations are hidden from order reads and lists; completed orders can be listed with `GET /orders?account=…`.\nA request that arrives while the first is still running gets `409 IDEMPOTENCY_IN_PROGRESS`: send it\nagain after `retryAfterSeconds`.",
				"security": [
					{
						"ApiKeyAuth": []
					}
				],
				"parameters": [
					{
						"$ref": "#/components/parameters/ApiRevision"
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/CreateOrderRequest"
							},
							"example": {
								"option": "opt_eyJ2IjoxLC4uLn0",
								"accounts": {
									"payer": {
										"chain": "eip155:42161",
										"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
									},
									"recipient": {
										"chain": "eip155:8453",
										"address": "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2"
									}
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The order a repeat of the request made, as it is now.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Order"
								},
								"example": {
									"id": "ord_3f9a1c2b7d4e5f60718293a4b5c6d7e8",
									"protocolId": "0x35dc8d390877c71baacadb4001eea0055804cfc306f599fbfc97c1d69d64d30a",
									"version": 1,
									"createdAt": "2026-08-17T20:48:20Z",
									"updatedAt": "2026-08-17T20:48:20Z",
									"status": "awaiting_funding",
									"outcome": null,
									"liveAt": null,
									"summary": {
										"actionNeeded": {
											"kind": "send_transaction",
											"executor": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"steps": ["approve", "deposit"]
										},
										"notices": [],
										"payout": {
											"amount": null,
											"status": "pending",
											"tx": null,
											"withoutTx": null
										},
										"refund": {
											"amount": null,
											"status": "pending",
											"tx": null,
											"withoutTx": null
										},
										"pollAfterSeconds": 15
									},
									"terms": {
										"send": {
											"asset": {
												"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
												"chain": "eip155:42161",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "100000000"
										},
										"receiveAsset": {
											"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
											"chain": "eip155:8453",
											"symbol": "USDC",
											"decimals": 6
										},
										"minRate": "0.99620254",
										"slippageBps": 0,
										"fundBy": "2026-08-17T21:28:20Z",
										"fillBy": "2026-08-17T21:48:20Z",
										"receive": {
											"asset": {
												"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
												"chain": "eip155:8453",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "99620254"
										},
										"receiveMin": {
											"asset": {
												"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
												"chain": "eip155:8453",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "99620254"
										},
										"flatFee": {
											"asset": {
												"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
												"chain": "eip155:42161",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "300000"
										}
									},
									"accounts": {
										"payer": {
											"chain": "eip155:42161",
											"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
										},
										"recipient": {
											"chain": "eip155:8453",
											"address": "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2"
										},
										"refundTo": {
											"chain": "eip155:42161",
											"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
										}
									},
									"steps": [
										{
											"id": "approve",
											"type": "transaction",
											"status": "pending",
											"chain": "eip155:42161",
											"actor": "payer",
											"executor": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"instruction": {
												"format": "evm_call",
												"payload": {
													"chainId": 42161,
													"from": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",
													"to": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
													"data": "0x095ea7b300000000000000000000000011111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000005f5e100",
													"value": "0",
													"gasLimit": "100000"
												},
												"approval": {
													"spender": "0x1111111111111111111111111111111111111111",
													"amount": {
														"asset": {
															"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
															"chain": "eip155:42161",
															"symbol": "USDC",
															"decimals": 6
														},
														"amount": "100000000"
													}
												},
												"allowance": null
											}
										},
										{
											"id": "deposit",
											"type": "transaction",
											"status": "pending",
											"chain": "eip155:42161",
											"actor": "payer",
											"executor": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"instruction": {
												"format": "evm_call",
												"payload": {
													"chainId": 42161,
													"from": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",
													"to": "0x1111111111111111111111111111111111111111",
													"data": "0xf3125a1f000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e58310000000000000000000000000000000000000000000000000000000005f5e100",
													"value": "100000000000000",
													"gasLimit": "250000"
												},
												"approval": null,
												"allowance": {
													"spender": "0x1111111111111111111111111111111111111111",
													"amount": {
														"asset": {
															"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
															"chain": "eip155:42161",
															"symbol": "USDC",
															"decimals": 6
														},
														"amount": "100000000"
													}
												}
											}
										}
									],
									"receipts": [],
									"fills": [],
									"obligations": [
										{
											"id": "payout",
											"kind": "payout",
											"status": "pending",
											"to": {
												"chain": "eip155:8453",
												"address": "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2"
											},
											"amount": null,
											"evidence": [],
											"problem": null
										},
										{
											"id": "refund",
											"kind": "refund",
											"status": "pending",
											"to": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"amount": null,
											"evidence": [],
											"problem": null
										}
									],
									"invocations": [],
									"requirements": [],
									"actions": {
										"cancel": {
											"available": false,
											"reason": {
												"code": "NOT_LIVE",
												"message": "The order has not published yet",
												"details": null
											},
											"signer": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"proof": null
										}
									},
									"charges": null
								}
							}
						}
					},
					"201": {
						"description": "The new order, waiting for its funding steps.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Order"
								},
								"example": {
									"id": "ord_3f9a1c2b7d4e5f60718293a4b5c6d7e8",
									"protocolId": "0x35dc8d390877c71baacadb4001eea0055804cfc306f599fbfc97c1d69d64d30a",
									"version": 1,
									"createdAt": "2026-08-17T20:48:20Z",
									"updatedAt": "2026-08-17T20:48:20Z",
									"status": "awaiting_funding",
									"outcome": null,
									"liveAt": null,
									"summary": {
										"actionNeeded": {
											"kind": "send_transaction",
											"executor": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"steps": ["approve", "deposit"]
										},
										"notices": [],
										"payout": {
											"amount": null,
											"status": "pending",
											"tx": null,
											"withoutTx": null
										},
										"refund": {
											"amount": null,
											"status": "pending",
											"tx": null,
											"withoutTx": null
										},
										"pollAfterSeconds": 15
									},
									"terms": {
										"send": {
											"asset": {
												"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
												"chain": "eip155:42161",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "100000000"
										},
										"receiveAsset": {
											"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
											"chain": "eip155:8453",
											"symbol": "USDC",
											"decimals": 6
										},
										"minRate": "0.99620254",
										"slippageBps": 0,
										"fundBy": "2026-08-17T21:28:20Z",
										"fillBy": "2026-08-17T21:48:20Z",
										"receive": {
											"asset": {
												"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
												"chain": "eip155:8453",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "99620254"
										},
										"receiveMin": {
											"asset": {
												"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
												"chain": "eip155:8453",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "99620254"
										},
										"flatFee": {
											"asset": {
												"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
												"chain": "eip155:42161",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "300000"
										}
									},
									"accounts": {
										"payer": {
											"chain": "eip155:42161",
											"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
										},
										"recipient": {
											"chain": "eip155:8453",
											"address": "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2"
										},
										"refundTo": {
											"chain": "eip155:42161",
											"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
										}
									},
									"steps": [
										{
											"id": "approve",
											"type": "transaction",
											"status": "pending",
											"chain": "eip155:42161",
											"actor": "payer",
											"executor": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"instruction": {
												"format": "evm_call",
												"payload": {
													"chainId": 42161,
													"from": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",
													"to": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
													"data": "0x095ea7b300000000000000000000000011111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000005f5e100",
													"value": "0",
													"gasLimit": "100000"
												},
												"approval": {
													"spender": "0x1111111111111111111111111111111111111111",
													"amount": {
														"asset": {
															"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
															"chain": "eip155:42161",
															"symbol": "USDC",
															"decimals": 6
														},
														"amount": "100000000"
													}
												},
												"allowance": null
											}
										},
										{
											"id": "deposit",
											"type": "transaction",
											"status": "pending",
											"chain": "eip155:42161",
											"actor": "payer",
											"executor": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"instruction": {
												"format": "evm_call",
												"payload": {
													"chainId": 42161,
													"from": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",
													"to": "0x1111111111111111111111111111111111111111",
													"data": "0xf3125a1f000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e58310000000000000000000000000000000000000000000000000000000005f5e100",
													"value": "100000000000000",
													"gasLimit": "250000"
												},
												"approval": null,
												"allowance": {
													"spender": "0x1111111111111111111111111111111111111111",
													"amount": {
														"asset": {
															"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
															"chain": "eip155:42161",
															"symbol": "USDC",
															"decimals": 6
														},
														"amount": "100000000"
													}
												}
											}
										}
									],
									"receipts": [],
									"fills": [],
									"obligations": [
										{
											"id": "payout",
											"kind": "payout",
											"status": "pending",
											"to": {
												"chain": "eip155:8453",
												"address": "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2"
											},
											"amount": null,
											"evidence": [],
											"problem": null
										},
										{
											"id": "refund",
											"kind": "refund",
											"status": "pending",
											"to": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"amount": null,
											"evidence": [],
											"problem": null
										}
									],
									"invocations": [],
									"requirements": [],
									"actions": {
										"cancel": {
											"available": false,
											"reason": {
												"code": "NOT_LIVE",
												"message": "The order has not published yet",
												"details": null
											},
											"signer": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"proof": null
										}
									},
									"charges": null
								}
							}
						}
					},
					"400": {
						"description": "`VALIDATION_FAILED`, `OPTION_INVALID` (not issued to you, or changed), `ACCOUNT_INVALID`, `ROLE_MISSING` or `UNSUPPORTED_PAIR` (the pair stopped trading since the quote: request a new quote).",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "ROLE_MISSING",
									"message": "payer is required for an EVM source",
									"details": null,
									"field": "accounts.payer",
									"recovery": "fix_request",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"401": {
						"description": "`UNAUTHENTICATED`: the `X-API-Key` header is missing.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "UNAUTHENTICATED",
									"message": "X-API-Key required",
									"details": null,
									"field": null,
									"recovery": "fix_request",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"403": {
						"description": "`FORBIDDEN`: the key is unknown or inactive, or your terms can't be used. It is about your account: don't retry.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "FORBIDDEN",
									"message": "Unknown or inactive integrator",
									"details": null,
									"field": null,
									"recovery": "contact_support",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"409": {
						"description": "`QUOTE_USED` (the option is reserved for other accounts, whether creation is unfinished or completed: request a new quote), `REQUOTE_REQUIRED` (the fees or the order's deadlines changed since the quote) or `IDEMPOTENCY_IN_PROGRESS` (send it again after `retryAfterSeconds`).",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "QUOTE_USED",
									"message": "This quote is reserved for other accounts; request a new quote",
									"details": null,
									"field": "option",
									"recovery": "requote",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"410": {
						"description": "`QUOTE_EXPIRED`: request a new quote.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "QUOTE_EXPIRED",
									"message": "The quote has expired; request a new one",
									"details": null,
									"field": "option",
									"recovery": "requote",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"422": {
						"description": "`AMOUNT_TOO_SMALL`, `ACCOUNT_NOT_ACTIVATED` (a TRON account that never received TRX or a token) or `ACCOUNT_NOT_READY` (a Stellar account that can't take the payment, or an EVM account whose code rejects a plain transfer of the native coin).",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "ACCOUNT_NOT_ACTIVATED",
									"message": "Not an activated TRON account: it must receive TRX or a token once before it can be paid",
									"details": null,
									"field": "accounts.recipient",
									"recovery": "fix_request",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"429": {
						"description": "`RATE_LIMITED`: too many requests from your IP, or, on quote and create-order, from your integrator. Retry after `retryAfterSeconds`.",
						"headers": {
							"Retry-After": {
								"description": "Seconds to wait.",
								"schema": {
									"type": "integer"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "RATE_LIMITED",
									"message": "Too many requests, retry later",
									"details": null,
									"field": null,
									"recovery": "retry",
									"retryAfterSeconds": 60,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"500": {
						"description": "`INTERNAL`: an unexpected failure that sending the request again won't fix. Contact Khalani with `requestId`.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "INTERNAL",
									"message": "Internal error",
									"details": null,
									"field": null,
									"recovery": "contact_support",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"503": {
						"description": "`MAINTENANCE`: order creation is paused. `UPSTREAM_UNAVAILABLE`, `PRICE_UNAVAILABLE`, `NO_CAPACITY`: a dependency, our storage or the market can't serve the request now. Retry later.",
						"headers": {
							"Retry-After": {
								"description": "Seconds to wait.",
								"schema": {
									"type": "integer"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "MAINTENANCE",
									"message": "Order creation is paused for maintenance",
									"details": null,
									"field": null,
									"recovery": "retry",
									"retryAfterSeconds": 300,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					}
				}
			},
			"get": {
				"operationId": "listOrders",
				"summary": "List or sync your orders",
				"description": "Your orders, in pages of up to 50, with the filters you pass. Repeat `status` to list orders in any of several.\n\n- `sort=createdAt`, the default: newest first. `cursor` is null after the last page. Stop only then: a page before it\n  can come back empty.\n- `sort=updatedAt`: sync. Each page holds the orders that changed after the cursor, each once and in its current state,\n  oldest change first. Keep the last cursor. You are caught up once a page comes back empty with the cursor you sent:\n  ask again later. An empty page with a new cursor means ask again now. A cursor that can no longer be used answers\n  `410 CURSOR_EXPIRED`: sync again with no cursor, which returns every order in its current state. A cursor doesn't\n  expire with time. `status` can't be used here, since an order that left the status would never be listed again.\n\nKeep the sort and filters unchanged while paging.",
				"security": [
					{
						"ApiKeyAuth": []
					}
				],
				"parameters": [
					{
						"$ref": "#/components/parameters/ApiRevision"
					},
					{
						"name": "status",
						"in": "query",
						"required": false,
						"description": "Only orders in this status, or in any of the statuses given by repeating it. Not with `sort=updatedAt`.",
						"schema": {
							"anyOf": [
								{
									"type": "string",
									"enum": ["awaiting_funding", "confirming", "trading", "settling", "delivering", "done", "expired"],
									"description": "`confirming`: the deposit is seen and the order is publishing. `trading`: published, solvers can fill it. `settling`: trading ended. `delivering`: the hub has settled, and a leg can still be on its way. `done`: every leg delivered. `expired`: the order didn't publish by `fillBy`, and routine polling can stop; a deposit that came for it shows as the `NOT_PUBLISHED` notice, and Khalani refunds it by hand. Once refunded, the order shows the refund in `summary.refund`, `delivering` and then `done`, or straight to `done` if delivery is already confirmed."
								},
								{
									"minItems": 1,
									"type": "array",
									"items": {
										"type": "string",
										"enum": ["awaiting_funding", "confirming", "trading", "settling", "delivering", "done", "expired"],
										"description": "`confirming`: the deposit is seen and the order is publishing. `trading`: published, solvers can fill it. `settling`: trading ended. `delivering`: the hub has settled, and a leg can still be on its way. `done`: every leg delivered. `expired`: the order didn't publish by `fillBy`, and routine polling can stop; a deposit that came for it shows as the `NOT_PUBLISHED` notice, and Khalani refunds it by hand. Once refunded, the order shows the refund in `summary.refund`, `delivering` and then `done`, or straight to `done` if delivery is already confirmed."
									}
								}
							]
						}
					},
					{
						"name": "account",
						"in": "query",
						"required": false,
						"description": "CAIP-10 account. Only orders in which it is the payer, the recipient or the refund account.",
						"schema": {
							"type": "string",
							"minLength": 1,
							"maxLength": 320
						}
					},
					{
						"name": "sendAsset",
						"in": "query",
						"required": false,
						"description": "CAIP-19 id. Only orders that send this asset.",
						"schema": {
							"type": "string",
							"minLength": 1,
							"maxLength": 256
						}
					},
					{
						"name": "receiveAsset",
						"in": "query",
						"required": false,
						"description": "CAIP-19 id. Only orders that receive this asset.",
						"schema": {
							"type": "string",
							"minLength": 1,
							"maxLength": 256
						}
					},
					{
						"name": "sort",
						"in": "query",
						"required": false,
						"description": "`createdAt`: newest first. `updatedAt`: oldest change first, each order once, in its current state: sync.",
						"schema": {
							"default": "createdAt",
							"type": "string",
							"enum": ["createdAt", "updatedAt"]
						},
						"example": "updatedAt"
					},
					{
						"name": "cursor",
						"in": "query",
						"required": false,
						"description": "`cursor` from the previous page, with the same sort and filters.",
						"schema": {
							"type": "string",
							"minLength": 1,
							"maxLength": 128
						},
						"example": "1041"
					}
				],
				"responses": {
					"200": {
						"description": "A page of orders.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/OrderList"
								},
								"example": {
									"orders": [
										{
											"id": "ord_3f9a1c2b7d4e5f60718293a4b5c6d7e8",
											"protocolId": "0x35dc8d390877c71baacadb4001eea0055804cfc306f599fbfc97c1d69d64d30a",
											"version": 3,
											"createdAt": "2026-08-17T20:48:20Z",
											"updatedAt": "2026-08-17T20:49:05Z",
											"status": "trading",
											"outcome": null,
											"liveAt": "2026-08-17T20:49:05Z",
											"summary": {
												"actionNeeded": null,
												"notices": [],
												"payout": {
													"amount": null,
													"status": "pending",
													"tx": null,
													"withoutTx": null
												},
												"refund": {
													"amount": null,
													"status": "pending",
													"tx": null,
													"withoutTx": null
												},
												"pollAfterSeconds": 15
											},
											"terms": {
												"send": {
													"asset": {
														"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
														"chain": "eip155:42161",
														"symbol": "USDC",
														"decimals": 6
													},
													"amount": "100000000"
												},
												"receiveAsset": {
													"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
													"chain": "eip155:8453",
													"symbol": "USDC",
													"decimals": 6
												},
												"minRate": "0.99620254",
												"slippageBps": 0,
												"fundBy": "2026-08-17T21:28:20Z",
												"fillBy": "2026-08-17T21:48:20Z",
												"receive": {
													"asset": {
														"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
														"chain": "eip155:8453",
														"symbol": "USDC",
														"decimals": 6
													},
													"amount": "99620254"
												},
												"receiveMin": {
													"asset": {
														"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
														"chain": "eip155:8453",
														"symbol": "USDC",
														"decimals": 6
													},
													"amount": "99620254"
												},
												"flatFee": {
													"asset": {
														"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
														"chain": "eip155:42161",
														"symbol": "USDC",
														"decimals": 6
													},
													"amount": "300000"
												}
											},
											"accounts": {
												"payer": {
													"chain": "eip155:42161",
													"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
												},
												"recipient": {
													"chain": "eip155:8453",
													"address": "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2"
												},
												"refundTo": {
													"chain": "eip155:42161",
													"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
												}
											},
											"steps": [
												{
													"id": "approve",
													"type": "transaction",
													"status": "completed",
													"chain": "eip155:42161",
													"actor": "payer",
													"executor": {
														"chain": "eip155:42161",
														"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
													},
													"instruction": {
														"format": "evm_call",
														"payload": {
															"chainId": 42161,
															"from": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",
															"to": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
															"data": "0x095ea7b300000000000000000000000011111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000005f5e100",
															"value": "0",
															"gasLimit": "100000"
														},
														"approval": {
															"spender": "0x1111111111111111111111111111111111111111",
															"amount": {
																"asset": {
																	"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
																	"chain": "eip155:42161",
																	"symbol": "USDC",
																	"decimals": 6
																},
																"amount": "100000000"
															}
														},
														"allowance": null
													}
												},
												{
													"id": "deposit",
													"type": "transaction",
													"status": "completed",
													"chain": "eip155:42161",
													"actor": "payer",
													"executor": {
														"chain": "eip155:42161",
														"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
													},
													"instruction": {
														"format": "evm_call",
														"payload": {
															"chainId": 42161,
															"from": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",
															"to": "0x1111111111111111111111111111111111111111",
															"data": "0xf3125a1f000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e58310000000000000000000000000000000000000000000000000000000005f5e100",
															"value": "100000000000000",
															"gasLimit": "250000"
														},
														"approval": null,
														"allowance": {
															"spender": "0x1111111111111111111111111111111111111111",
															"amount": {
																"asset": {
																	"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
																	"chain": "eip155:42161",
																	"symbol": "USDC",
																	"decimals": 6
																},
																"amount": "100000000"
															}
														}
													}
												}
											],
											"receipts": [
												{
													"id": "deposit_receipt",
													"tx": {
														"chain": "eip155:42161",
														"hash": "0xa37fc5f866fdd03a6443129b95f5a328eba3a36b0c4d68c467849e846775a04d"
													},
													"amount": {
														"asset": {
															"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
															"chain": "eip155:42161",
															"symbol": "USDC",
															"decimals": 6
														},
														"amount": "100000000"
													},
													"from": [
														{
															"chain": "eip155:42161",
															"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
														}
													],
													"observation": "final",
													"at": "2026-08-17T20:48:40Z"
												}
											],
											"fills": [],
											"obligations": [
												{
													"id": "payout",
													"kind": "payout",
													"status": "pending",
													"to": {
														"chain": "eip155:8453",
														"address": "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2"
													},
													"amount": null,
													"evidence": [],
													"problem": null
												},
												{
													"id": "refund",
													"kind": "refund",
													"status": "pending",
													"to": {
														"chain": "eip155:42161",
														"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
													},
													"amount": null,
													"evidence": [],
													"problem": null
												}
											],
											"invocations": [],
											"requirements": [],
											"actions": {
												"cancel": {
													"available": true,
													"reason": null,
													"signer": {
														"chain": "eip155:42161",
														"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
													},
													"proof": {
														"format": "eip191_cancel_proof",
														"message": "Cancel Khalani order ord_3f9a1c2b7d4e5f60718293a4b5c6d7e8\nChain: eip155:42161\nRefund to: 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
													}
												}
											},
											"charges": null
										}
									],
									"cursor": "1042"
								}
							}
						}
					},
					"400": {
						"description": "`VALIDATION_FAILED` (including `status` with `sort=updatedAt`, a cursor from the other sort, or a query parameter the route doesn't take), `ACCOUNT_INVALID` or `UNSUPPORTED_ASSET`.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "VALIDATION_FAILED",
									"message": "status can't filter a list in order of last change",
									"details": null,
									"field": "status",
									"recovery": "fix_request",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"401": {
						"description": "`UNAUTHENTICATED`: the `X-API-Key` header is missing.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "UNAUTHENTICATED",
									"message": "X-API-Key required",
									"details": null,
									"field": null,
									"recovery": "fix_request",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"403": {
						"description": "`FORBIDDEN`: the key is unknown or inactive, or your terms can't be used. It is about your account: don't retry.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "FORBIDDEN",
									"message": "Unknown or inactive integrator",
									"details": null,
									"field": null,
									"recovery": "contact_support",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"410": {
						"description": "`CURSOR_EXPIRED`: a cursor the API can no longer use, such as one from another environment or from before a restore. Sync again with no cursor, which returns every order in its current state, and continue from the cursor it gives.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "CURSOR_EXPIRED",
									"message": "This cursor can no longer be used; sync again with no cursor",
									"details": null,
									"field": "cursor",
									"recovery": "restart_sync",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"429": {
						"description": "`RATE_LIMITED`: too many requests from your IP, or, on quote and create-order, from your integrator. Retry after `retryAfterSeconds`.",
						"headers": {
							"Retry-After": {
								"description": "Seconds to wait.",
								"schema": {
									"type": "integer"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "RATE_LIMITED",
									"message": "Too many requests, retry later",
									"details": null,
									"field": null,
									"recovery": "retry",
									"retryAfterSeconds": 60,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"500": {
						"description": "`INTERNAL`: an unexpected failure that sending the request again won't fix. Contact Khalani with `requestId`.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "INTERNAL",
									"message": "Internal error",
									"details": null,
									"field": null,
									"recovery": "contact_support",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"503": {
						"description": "`UPSTREAM_UNAVAILABLE`: our storage is briefly unavailable. Send the same request again after `retryAfterSeconds`.",
						"headers": {
							"Retry-After": {
								"description": "Seconds to wait.",
								"schema": {
									"type": "integer"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "UPSTREAM_UNAVAILABLE",
									"message": "Storage is briefly unavailable; send the same request again",
									"details": null,
									"field": null,
									"recovery": "retry",
									"retryAfterSeconds": 1,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					}
				}
			}
		},
		"/v3/orders/{id}": {
			"get": {
				"operationId": "getOrder",
				"summary": "Get an order",
				"description": "One of your orders, by either id. Track it from your backend: like every route, it needs your key.\n\nPoll after `summary.pollAfterSeconds` until it is null: routine polling can stop for `done` or `expired` orders.\nKeep syncing with `sort=updatedAt` for later deposit and refund updates to expired orders. An order that hasn't published\nby `terms.fillBy`, such as one nobody funds, ends `expired` a little after it.\nA deposit that still comes for an `expired` order is refunded by hand, and the order then moves to `delivering` and `done`, or straight to `done` if delivery is already confirmed.\n`delivering` doesn't mean the user has been paid: `outcome` says how the order ended, and `summary.payout`\nand `summary.refund` what each leg settled and whether it landed.",
				"security": [
					{
						"ApiKeyAuth": []
					}
				],
				"parameters": [
					{
						"$ref": "#/components/parameters/ApiRevision"
					},
					{
						"name": "id",
						"in": "path",
						"required": true,
						"description": "A v3 order's `ord_` id, or any order's `0x` protocol id, `/v2` orders included.",
						"schema": {
							"type": "string"
						},
						"example": "ord_3f9a1c2b7d4e5f60718293a4b5c6d7e8"
					}
				],
				"responses": {
					"200": {
						"description": "The order.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Order"
								},
								"example": {
									"id": "ord_3f9a1c2b7d4e5f60718293a4b5c6d7e8",
									"protocolId": "0x35dc8d390877c71baacadb4001eea0055804cfc306f599fbfc97c1d69d64d30a",
									"version": 3,
									"createdAt": "2026-08-17T20:48:20Z",
									"updatedAt": "2026-08-17T20:49:05Z",
									"status": "trading",
									"outcome": null,
									"liveAt": "2026-08-17T20:49:05Z",
									"summary": {
										"actionNeeded": null,
										"notices": [],
										"payout": {
											"amount": null,
											"status": "pending",
											"tx": null,
											"withoutTx": null
										},
										"refund": {
											"amount": null,
											"status": "pending",
											"tx": null,
											"withoutTx": null
										},
										"pollAfterSeconds": 15
									},
									"terms": {
										"send": {
											"asset": {
												"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
												"chain": "eip155:42161",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "100000000"
										},
										"receiveAsset": {
											"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
											"chain": "eip155:8453",
											"symbol": "USDC",
											"decimals": 6
										},
										"minRate": "0.99620254",
										"slippageBps": 0,
										"fundBy": "2026-08-17T21:28:20Z",
										"fillBy": "2026-08-17T21:48:20Z",
										"receive": {
											"asset": {
												"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
												"chain": "eip155:8453",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "99620254"
										},
										"receiveMin": {
											"asset": {
												"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
												"chain": "eip155:8453",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "99620254"
										},
										"flatFee": {
											"asset": {
												"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
												"chain": "eip155:42161",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "300000"
										}
									},
									"accounts": {
										"payer": {
											"chain": "eip155:42161",
											"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
										},
										"recipient": {
											"chain": "eip155:8453",
											"address": "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2"
										},
										"refundTo": {
											"chain": "eip155:42161",
											"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
										}
									},
									"steps": [
										{
											"id": "approve",
											"type": "transaction",
											"status": "completed",
											"chain": "eip155:42161",
											"actor": "payer",
											"executor": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"instruction": {
												"format": "evm_call",
												"payload": {
													"chainId": 42161,
													"from": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",
													"to": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
													"data": "0x095ea7b300000000000000000000000011111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000005f5e100",
													"value": "0",
													"gasLimit": "100000"
												},
												"approval": {
													"spender": "0x1111111111111111111111111111111111111111",
													"amount": {
														"asset": {
															"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
															"chain": "eip155:42161",
															"symbol": "USDC",
															"decimals": 6
														},
														"amount": "100000000"
													}
												},
												"allowance": null
											}
										},
										{
											"id": "deposit",
											"type": "transaction",
											"status": "completed",
											"chain": "eip155:42161",
											"actor": "payer",
											"executor": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"instruction": {
												"format": "evm_call",
												"payload": {
													"chainId": 42161,
													"from": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",
													"to": "0x1111111111111111111111111111111111111111",
													"data": "0xf3125a1f000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e58310000000000000000000000000000000000000000000000000000000005f5e100",
													"value": "100000000000000",
													"gasLimit": "250000"
												},
												"approval": null,
												"allowance": {
													"spender": "0x1111111111111111111111111111111111111111",
													"amount": {
														"asset": {
															"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
															"chain": "eip155:42161",
															"symbol": "USDC",
															"decimals": 6
														},
														"amount": "100000000"
													}
												}
											}
										}
									],
									"receipts": [
										{
											"id": "deposit_receipt",
											"tx": {
												"chain": "eip155:42161",
												"hash": "0xa37fc5f866fdd03a6443129b95f5a328eba3a36b0c4d68c467849e846775a04d"
											},
											"amount": {
												"asset": {
													"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
													"chain": "eip155:42161",
													"symbol": "USDC",
													"decimals": 6
												},
												"amount": "100000000"
											},
											"from": [
												{
													"chain": "eip155:42161",
													"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
												}
											],
											"observation": "final",
											"at": "2026-08-17T20:48:40Z"
										}
									],
									"fills": [],
									"obligations": [
										{
											"id": "payout",
											"kind": "payout",
											"status": "pending",
											"to": {
												"chain": "eip155:8453",
												"address": "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2"
											},
											"amount": null,
											"evidence": [],
											"problem": null
										},
										{
											"id": "refund",
											"kind": "refund",
											"status": "pending",
											"to": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"amount": null,
											"evidence": [],
											"problem": null
										}
									],
									"invocations": [],
									"requirements": [],
									"actions": {
										"cancel": {
											"available": true,
											"reason": null,
											"signer": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"proof": {
												"format": "eip191_cancel_proof",
												"message": "Cancel Khalani order ord_3f9a1c2b7d4e5f60718293a4b5c6d7e8\nChain: eip155:42161\nRefund to: 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											}
										}
									},
									"charges": null
								}
							}
						}
					},
					"400": {
						"description": "`VALIDATION_FAILED`: an unsupported `API-Revision` header or a query parameter the route doesn't take. `field` names the invalid input.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "VALIDATION_FAILED",
									"message": "Unknown API-Revision. Valid values are [\"0\"]",
									"details": null,
									"field": "API-Revision",
									"recovery": "fix_request",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"401": {
						"description": "`UNAUTHENTICATED`: the `X-API-Key` header is missing.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "UNAUTHENTICATED",
									"message": "X-API-Key required",
									"details": null,
									"field": null,
									"recovery": "fix_request",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"403": {
						"description": "`FORBIDDEN`: the key is unknown or inactive, or your terms can't be used. It is about your account: don't retry.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "FORBIDDEN",
									"message": "Unknown or inactive integrator",
									"details": null,
									"field": null,
									"recovery": "contact_support",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"404": {
						"description": "`NOT_FOUND`: no such order of yours.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "NOT_FOUND",
									"message": "Order not found",
									"details": null,
									"field": null,
									"recovery": "fix_request",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"429": {
						"description": "`RATE_LIMITED`: too many requests from your IP, or, on quote and create-order, from your integrator. Retry after `retryAfterSeconds`.",
						"headers": {
							"Retry-After": {
								"description": "Seconds to wait.",
								"schema": {
									"type": "integer"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "RATE_LIMITED",
									"message": "Too many requests, retry later",
									"details": null,
									"field": null,
									"recovery": "retry",
									"retryAfterSeconds": 60,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"500": {
						"description": "`INTERNAL`: an unexpected failure that sending the request again won't fix. Contact Khalani with `requestId`.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "INTERNAL",
									"message": "Internal error",
									"details": null,
									"field": null,
									"recovery": "contact_support",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"503": {
						"description": "`UPSTREAM_UNAVAILABLE`: our storage is briefly unavailable. Send the same request again after `retryAfterSeconds`.",
						"headers": {
							"Retry-After": {
								"description": "Seconds to wait.",
								"schema": {
									"type": "integer"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "UPSTREAM_UNAVAILABLE",
									"message": "Storage is briefly unavailable; send the same request again",
									"details": null,
									"field": null,
									"recovery": "retry",
									"retryAfterSeconds": 1,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					}
				}
			}
		},
		"/v3/orders/{id}/changes": {
			"get": {
				"operationId": "listOrderChanges",
				"summary": "Get an order's history",
				"description": "The changes to one of your orders, oldest first, each with the steps and records it set. Once the hub has settled, only\nevents are listed: an `updated` change is left out, so versions can skip. The order itself is the current state. A\n`funding_closed` change is `fundBy` passing with no deposit seen, and names the steps it closed.",
				"security": [
					{
						"ApiKeyAuth": []
					}
				],
				"parameters": [
					{
						"$ref": "#/components/parameters/ApiRevision"
					},
					{
						"name": "id",
						"in": "path",
						"required": true,
						"description": "A v3 order's `ord_` id, or any order's `0x` protocol id, `/v2` orders included.",
						"schema": {
							"type": "string"
						},
						"example": "ord_3f9a1c2b7d4e5f60718293a4b5c6d7e8"
					}
				],
				"responses": {
					"200": {
						"description": "The changes.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/OrderChanges"
								},
								"example": {
									"changes": [
										{
											"version": 0,
											"at": "2026-08-17T20:48:20Z",
											"kind": "created",
											"records": []
										},
										{
											"version": 1,
											"at": "2026-08-17T20:48:20Z",
											"kind": "updated",
											"records": []
										},
										{
											"version": 2,
											"at": "2026-08-17T20:49:05Z",
											"kind": "published",
											"records": ["approve", "deposit"]
										},
										{
											"version": 3,
											"at": "2026-08-17T20:49:05Z",
											"kind": "deposit_seen",
											"records": ["deposit_receipt"]
										},
										{
											"version": 4,
											"at": "2026-08-17T20:49:20Z",
											"kind": "cancel_requested",
											"records": ["cancel"]
										}
									]
								}
							}
						}
					},
					"400": {
						"description": "`VALIDATION_FAILED`: an unsupported `API-Revision` header or a query parameter the route doesn't take. `field` names the invalid input.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "VALIDATION_FAILED",
									"message": "Unknown API-Revision. Valid values are [\"0\"]",
									"details": null,
									"field": "API-Revision",
									"recovery": "fix_request",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"401": {
						"description": "`UNAUTHENTICATED`: the `X-API-Key` header is missing.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "UNAUTHENTICATED",
									"message": "X-API-Key required",
									"details": null,
									"field": null,
									"recovery": "fix_request",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"403": {
						"description": "`FORBIDDEN`: the key is unknown or inactive, or your terms can't be used. It is about your account: don't retry.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "FORBIDDEN",
									"message": "Unknown or inactive integrator",
									"details": null,
									"field": null,
									"recovery": "contact_support",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"404": {
						"description": "`NOT_FOUND`: no such order of yours.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "NOT_FOUND",
									"message": "Order not found",
									"details": null,
									"field": null,
									"recovery": "fix_request",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"429": {
						"description": "`RATE_LIMITED`: too many requests from your IP, or, on quote and create-order, from your integrator. Retry after `retryAfterSeconds`.",
						"headers": {
							"Retry-After": {
								"description": "Seconds to wait.",
								"schema": {
									"type": "integer"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "RATE_LIMITED",
									"message": "Too many requests, retry later",
									"details": null,
									"field": null,
									"recovery": "retry",
									"retryAfterSeconds": 60,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"500": {
						"description": "`INTERNAL`: an unexpected failure that sending the request again won't fix. Contact Khalani with `requestId`.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "INTERNAL",
									"message": "Internal error",
									"details": null,
									"field": null,
									"recovery": "contact_support",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"503": {
						"description": "`UPSTREAM_UNAVAILABLE`: our storage is briefly unavailable. Send the same request again after `retryAfterSeconds`.",
						"headers": {
							"Retry-After": {
								"description": "Seconds to wait.",
								"schema": {
									"type": "integer"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "UPSTREAM_UNAVAILABLE",
									"message": "Storage is briefly unavailable; send the same request again",
									"details": null,
									"field": null,
									"recovery": "retry",
									"retryAfterSeconds": 1,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					}
				}
			}
		},
		"/v3/orders/{id}/actions": {
			"post": {
				"operationId": "cancelOrder",
				"summary": "Cancel an order",
				"description": "Cancels the order early with `refundTo`'s signature over `actions.cancel.proof.message`. Any filled part is paid out and\nthe rest refunded to `refundTo`, less the flat fee. The message has no nonce or expiry, so the same signature can always\nbe sent again: after a lost answer, or after an error whose `recovery` is `retry`.\n\n| The order | Answer |\n|---|---|\n| Trading, with no cancel yet | `202`: relayed, and the request is `pending` in `invocations` |\n| A cancel recorded already | `200`, without a second relay, however the order went since |\n| Stopped short of a full fill, with no cancel recorded | `409 ACTION_UNAVAILABLE` with `details.reason` `TRADING_ENDED` |\n| Filled in full, with no cancel recorded | `409 ACTION_UNAVAILABLE` with `details.reason` `ORDER_OVERTAKEN` |\n| Not published yet, or early cancel disabled | `409 ACTION_UNAVAILABLE` with the reason |\n| The settlement service is unavailable or hasn't seen the order yet, a contract `refundTo`'s chain can't be read, or storage is briefly unavailable | `503 UPSTREAM_UNAVAILABLE`: the cancel may have gone through |\n\nA `200` or `202` means the cancel is recorded, and `invocations` says how it went: `pending`, then `accepted` once the order\nstops short of a full fill, or `rejected` with `ORDER_OVERTAKEN` if a full fill got there first. After a `503` or a lost\nanswer, send the same signature again: a `409 TRADING_ENDED` then means the order stopped without a recorded cancel, so\nread it to see how it ended. Any other refusal from the settlement service is a `500 INTERNAL`.",
				"security": [
					{
						"ApiKeyAuth": []
					}
				],
				"parameters": [
					{
						"$ref": "#/components/parameters/ApiRevision"
					},
					{
						"name": "id",
						"in": "path",
						"required": true,
						"description": "A v3 order's `ord_` id, or any order's `0x` protocol id, `/v2` orders included.",
						"schema": {
							"type": "string"
						},
						"example": "ord_3f9a1c2b7d4e5f60718293a4b5c6d7e8"
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/OrderActionRequest"
							},
							"example": {
								"kind": "cancel",
								"signature": "0x60ce0a47bc64e07a5437de5fd4e6008bce46756d4d7c971710283924888b2a137a91ed09461b5848bb2b7341f5c258da3f97853e73662275f047e0c3c20882211b"
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "A cancel was recorded already: the order, with how it went in `invocations`. The signature isn't checked again.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Order"
								},
								"example": {
									"id": "ord_3f9a1c2b7d4e5f60718293a4b5c6d7e8",
									"protocolId": "0x35dc8d390877c71baacadb4001eea0055804cfc306f599fbfc97c1d69d64d30a",
									"version": 6,
									"createdAt": "2026-08-17T20:48:20Z",
									"updatedAt": "2026-08-17T20:49:20Z",
									"status": "settling",
									"outcome": "none",
									"liveAt": "2026-08-17T20:49:05Z",
									"summary": {
										"actionNeeded": null,
										"notices": [],
										"payout": {
											"amount": null,
											"status": "pending",
											"tx": null,
											"withoutTx": null
										},
										"refund": {
											"amount": null,
											"status": "pending",
											"tx": null,
											"withoutTx": null
										},
										"pollAfterSeconds": 15
									},
									"terms": {
										"send": {
											"asset": {
												"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
												"chain": "eip155:42161",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "100000000"
										},
										"receiveAsset": {
											"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
											"chain": "eip155:8453",
											"symbol": "USDC",
											"decimals": 6
										},
										"minRate": "0.99620254",
										"slippageBps": 0,
										"fundBy": "2026-08-17T21:28:20Z",
										"fillBy": "2026-08-17T21:48:20Z",
										"receive": {
											"asset": {
												"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
												"chain": "eip155:8453",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "99620254"
										},
										"receiveMin": {
											"asset": {
												"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
												"chain": "eip155:8453",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "99620254"
										},
										"flatFee": {
											"asset": {
												"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
												"chain": "eip155:42161",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "300000"
										}
									},
									"accounts": {
										"payer": {
											"chain": "eip155:42161",
											"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
										},
										"recipient": {
											"chain": "eip155:8453",
											"address": "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2"
										},
										"refundTo": {
											"chain": "eip155:42161",
											"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
										}
									},
									"steps": [
										{
											"id": "approve",
											"type": "transaction",
											"status": "completed",
											"chain": "eip155:42161",
											"actor": "payer",
											"executor": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"instruction": {
												"format": "evm_call",
												"payload": {
													"chainId": 42161,
													"from": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",
													"to": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
													"data": "0x095ea7b300000000000000000000000011111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000005f5e100",
													"value": "0",
													"gasLimit": "100000"
												},
												"approval": {
													"spender": "0x1111111111111111111111111111111111111111",
													"amount": {
														"asset": {
															"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
															"chain": "eip155:42161",
															"symbol": "USDC",
															"decimals": 6
														},
														"amount": "100000000"
													}
												},
												"allowance": null
											}
										},
										{
											"id": "deposit",
											"type": "transaction",
											"status": "completed",
											"chain": "eip155:42161",
											"actor": "payer",
											"executor": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"instruction": {
												"format": "evm_call",
												"payload": {
													"chainId": 42161,
													"from": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",
													"to": "0x1111111111111111111111111111111111111111",
													"data": "0xf3125a1f000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e58310000000000000000000000000000000000000000000000000000000005f5e100",
													"value": "100000000000000",
													"gasLimit": "250000"
												},
												"approval": null,
												"allowance": {
													"spender": "0x1111111111111111111111111111111111111111",
													"amount": {
														"asset": {
															"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
															"chain": "eip155:42161",
															"symbol": "USDC",
															"decimals": 6
														},
														"amount": "100000000"
													}
												}
											}
										}
									],
									"receipts": [
										{
											"id": "deposit_receipt",
											"tx": {
												"chain": "eip155:42161",
												"hash": "0xa37fc5f866fdd03a6443129b95f5a328eba3a36b0c4d68c467849e846775a04d"
											},
											"amount": {
												"asset": {
													"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
													"chain": "eip155:42161",
													"symbol": "USDC",
													"decimals": 6
												},
												"amount": "100000000"
											},
											"from": [
												{
													"chain": "eip155:42161",
													"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
												}
											],
											"observation": "final",
											"at": "2026-08-17T20:48:40Z"
										}
									],
									"fills": [],
									"obligations": [
										{
											"id": "payout",
											"kind": "payout",
											"status": "pending",
											"to": {
												"chain": "eip155:8453",
												"address": "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2"
											},
											"amount": null,
											"evidence": [],
											"problem": null
										},
										{
											"id": "refund",
											"kind": "refund",
											"status": "pending",
											"to": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"amount": null,
											"evidence": [],
											"problem": null
										}
									],
									"invocations": [
										{
											"id": "cancel",
											"kind": "cancel",
											"status": "accepted",
											"signer": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"at": "2026-08-17T20:49:20Z",
											"problem": null
										}
									],
									"requirements": [],
									"actions": {
										"cancel": {
											"available": false,
											"reason": {
												"code": "TRADING_ENDED",
												"message": "The order has stopped trading",
												"details": null
											},
											"signer": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"proof": null
										}
									},
									"charges": null
								}
							}
						}
					},
					"202": {
						"description": "The cancel is on its way.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Order"
								},
								"example": {
									"id": "ord_3f9a1c2b7d4e5f60718293a4b5c6d7e8",
									"protocolId": "0x35dc8d390877c71baacadb4001eea0055804cfc306f599fbfc97c1d69d64d30a",
									"version": 4,
									"createdAt": "2026-08-17T20:48:20Z",
									"updatedAt": "2026-08-17T20:49:20Z",
									"status": "trading",
									"outcome": null,
									"liveAt": "2026-08-17T20:49:05Z",
									"summary": {
										"actionNeeded": null,
										"notices": [],
										"payout": {
											"amount": null,
											"status": "pending",
											"tx": null,
											"withoutTx": null
										},
										"refund": {
											"amount": null,
											"status": "pending",
											"tx": null,
											"withoutTx": null
										},
										"pollAfterSeconds": 15
									},
									"terms": {
										"send": {
											"asset": {
												"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
												"chain": "eip155:42161",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "100000000"
										},
										"receiveAsset": {
											"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
											"chain": "eip155:8453",
											"symbol": "USDC",
											"decimals": 6
										},
										"minRate": "0.99620254",
										"slippageBps": 0,
										"fundBy": "2026-08-17T21:28:20Z",
										"fillBy": "2026-08-17T21:48:20Z",
										"receive": {
											"asset": {
												"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
												"chain": "eip155:8453",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "99620254"
										},
										"receiveMin": {
											"asset": {
												"id": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
												"chain": "eip155:8453",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "99620254"
										},
										"flatFee": {
											"asset": {
												"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
												"chain": "eip155:42161",
												"symbol": "USDC",
												"decimals": 6
											},
											"amount": "300000"
										}
									},
									"accounts": {
										"payer": {
											"chain": "eip155:42161",
											"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
										},
										"recipient": {
											"chain": "eip155:8453",
											"address": "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2"
										},
										"refundTo": {
											"chain": "eip155:42161",
											"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
										}
									},
									"steps": [
										{
											"id": "approve",
											"type": "transaction",
											"status": "completed",
											"chain": "eip155:42161",
											"actor": "payer",
											"executor": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"instruction": {
												"format": "evm_call",
												"payload": {
													"chainId": 42161,
													"from": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",
													"to": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
													"data": "0x095ea7b300000000000000000000000011111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000005f5e100",
													"value": "0",
													"gasLimit": "100000"
												},
												"approval": {
													"spender": "0x1111111111111111111111111111111111111111",
													"amount": {
														"asset": {
															"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
															"chain": "eip155:42161",
															"symbol": "USDC",
															"decimals": 6
														},
														"amount": "100000000"
													}
												},
												"allowance": null
											}
										},
										{
											"id": "deposit",
											"type": "transaction",
											"status": "completed",
											"chain": "eip155:42161",
											"actor": "payer",
											"executor": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"instruction": {
												"format": "evm_call",
												"payload": {
													"chainId": 42161,
													"from": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",
													"to": "0x1111111111111111111111111111111111111111",
													"data": "0xf3125a1f000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e58310000000000000000000000000000000000000000000000000000000005f5e100",
													"value": "100000000000000",
													"gasLimit": "250000"
												},
												"approval": null,
												"allowance": {
													"spender": "0x1111111111111111111111111111111111111111",
													"amount": {
														"asset": {
															"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
															"chain": "eip155:42161",
															"symbol": "USDC",
															"decimals": 6
														},
														"amount": "100000000"
													}
												}
											}
										}
									],
									"receipts": [
										{
											"id": "deposit_receipt",
											"tx": {
												"chain": "eip155:42161",
												"hash": "0xa37fc5f866fdd03a6443129b95f5a328eba3a36b0c4d68c467849e846775a04d"
											},
											"amount": {
												"asset": {
													"id": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
													"chain": "eip155:42161",
													"symbol": "USDC",
													"decimals": 6
												},
												"amount": "100000000"
											},
											"from": [
												{
													"chain": "eip155:42161",
													"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
												}
											],
											"observation": "final",
											"at": "2026-08-17T20:48:40Z"
										}
									],
									"fills": [],
									"obligations": [
										{
											"id": "payout",
											"kind": "payout",
											"status": "pending",
											"to": {
												"chain": "eip155:8453",
												"address": "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2"
											},
											"amount": null,
											"evidence": [],
											"problem": null
										},
										{
											"id": "refund",
											"kind": "refund",
											"status": "pending",
											"to": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"amount": null,
											"evidence": [],
											"problem": null
										}
									],
									"invocations": [
										{
											"id": "cancel",
											"kind": "cancel",
											"status": "pending",
											"signer": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"at": "2026-08-17T20:49:20Z",
											"problem": null
										}
									],
									"requirements": [],
									"actions": {
										"cancel": {
											"available": false,
											"reason": {
												"code": "CANCEL_PENDING",
												"message": "A cancel is already on its way",
												"details": null
											},
											"signer": {
												"chain": "eip155:42161",
												"address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"
											},
											"proof": null
										}
									},
									"charges": null
								}
							}
						}
					},
					"400": {
						"description": "`VALIDATION_FAILED`, or `INVALID_SIGNATURE`: on an order that can take a cancel, not `refundTo`'s signature over this order's message, in its chain's standard.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "INVALID_SIGNATURE",
									"message": "The signature isn't refundTo's over this order's cancel message",
									"details": null,
									"field": "signature",
									"recovery": "fix_request",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"401": {
						"description": "`UNAUTHENTICATED`: the `X-API-Key` header is missing.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "UNAUTHENTICATED",
									"message": "X-API-Key required",
									"details": null,
									"field": null,
									"recovery": "fix_request",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"403": {
						"description": "`FORBIDDEN`: the key is unknown or inactive, or your terms can't be used. It is about your account: don't retry.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "FORBIDDEN",
									"message": "Unknown or inactive integrator",
									"details": null,
									"field": null,
									"recovery": "contact_support",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"404": {
						"description": "`NOT_FOUND`: no such order of yours.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "NOT_FOUND",
									"message": "Order not found",
									"details": null,
									"field": null,
									"recovery": "fix_request",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"409": {
						"description": "`ACTION_UNAVAILABLE`, with no cancel recorded, and the reason in `details.reason`: `NOT_LIVE`, `EARLY_CANCEL_DISABLED`, `TRADING_ENDED` or `ORDER_OVERTAKEN`.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "ACTION_UNAVAILABLE",
									"message": "The order filled in full",
									"details": {
										"reason": "ORDER_OVERTAKEN"
									},
									"field": null,
									"recovery": "read_order",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"429": {
						"description": "`RATE_LIMITED`: too many requests from your IP, or, on quote and create-order, from your integrator. Retry after `retryAfterSeconds`.",
						"headers": {
							"Retry-After": {
								"description": "Seconds to wait.",
								"schema": {
									"type": "integer"
								}
							}
						},
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "RATE_LIMITED",
									"message": "Too many requests, retry later",
									"details": null,
									"field": null,
									"recovery": "retry",
									"retryAfterSeconds": 60,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"500": {
						"description": "`INTERNAL`: an unexpected failure that sending the request again won't fix. Contact Khalani with `requestId`.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "INTERNAL",
									"message": "Internal error",
									"details": null,
									"field": null,
									"recovery": "contact_support",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					},
					"503": {
						"description": "`UPSTREAM_UNAVAILABLE`: the settlement service is unavailable or hasn't seen the order yet, a contract `refundTo`'s signature couldn't be checked on its chain, or storage is briefly unavailable, which can happen after the cancel was relayed. Send the same signature again, and read the order.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/ApiError"
								},
								"example": {
									"code": "UPSTREAM_UNAVAILABLE",
									"message": "The cancel could not be relayed; send the same signature again",
									"details": null,
									"field": null,
									"recovery": "retry",
									"retryAfterSeconds": null,
									"requestId": "6f1d2c3b-4a5e-4f60-8718-293a4b5c6d7e"
								}
							}
						}
					}
				}
			}
		}
	},
	"components": {
		"parameters": {
			"ApiRevision": {
				"name": "API-Revision",
				"in": "header",
				"required": false,
				"description": "The revision of v3 the request is built against. Without it, the revision that was current when your integration was set up. An unknown value is a `400 VALIDATION_FAILED` naming `API-Revision`.",
				"schema": {
					"type": "string",
					"enum": ["0"]
				}
			}
		},
		"securitySchemes": {
			"ApiKeyAuth": {
				"type": "apiKey",
				"in": "header",
				"name": "X-API-Key",
				"description": "Your integrator API key. Backend only."
			}
		},
		"schemas": {
			"Account": {
				"type": "object",
				"properties": {
					"chain": {
						"type": "string",
						"pattern": "^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$",
						"description": "CAIP-2 chain id."
					},
					"address": {
						"type": "string"
					}
				},
				"required": ["chain", "address"]
			},
			"ActionUnavailableDetails": {
				"type": "object",
				"properties": {
					"reason": {
						"description": "Open list: `actions.cancel.reason.code`, or `ORDER_OVERTAKEN`.",
						"type": ["string", "null"]
					}
				},
				"required": ["reason"],
				"description": "`ACTION_UNAVAILABLE`'s details: why the action can't run."
			},
			"AmountRangeDetails": {
				"type": "object",
				"properties": {
					"minAmount": {
						"anyOf": [
							{
								"$ref": "#/components/schemas/AssetAmount"
							},
							{
								"type": "null"
							}
						]
					},
					"maxAmount": {
						"anyOf": [
							{
								"$ref": "#/components/schemas/AssetAmount"
							},
							{
								"type": "null"
							}
						]
					}
				},
				"required": ["minAmount", "maxAmount"],
				"description": "`AMOUNT_TOO_SMALL`'s and `AMOUNT_TOO_LARGE`'s details: the `send.amount` range that would quote."
			},
			"ApiError": {
				"type": "object",
				"properties": {
					"code": {
						"type": "string",
						"description": "Open list: handle a code you don't know by its `recovery`."
					},
					"message": {
						"type": "string"
					},
					"details": {
						"anyOf": [
							{
								"anyOf": [
									{
										"$ref": "#/components/schemas/ValidationDetails"
									},
									{
										"$ref": "#/components/schemas/AmountRangeDetails"
									},
									{
										"$ref": "#/components/schemas/ActionUnavailableDetails"
									},
									{
										"type": "object",
										"propertyNames": {
											"type": "string"
										},
										"additionalProperties": {}
									}
								]
							},
							{
								"type": "null"
							}
						],
						"description": "Read by `code`: `ValidationDetails` on a `VALIDATION_FAILED` from the request's schema, `AmountRangeDetails` on a quote's `AMOUNT_TOO_SMALL` or `AMOUNT_TOO_LARGE`, `ActionUnavailableDetails` on `ACTION_UNAVAILABLE`. Null otherwise, including a `VALIDATION_FAILED` for malformed JSON or for a check the route makes after its schema, such as `status` with `sort=updatedAt`."
					},
					"field": {
						"description": "The request field at fault, as a dotted path.",
						"type": ["string", "null"]
					},
					"recovery": {
						"type": "string",
						"enum": ["fix_request", "requote", "retry", "read_order", "restart_sync", "contact_support"],
						"description": "What to do next, whatever the code: `fix_request` (change the request), `requote` (get a new quote), `retry` (send the same request again), `read_order` (read the order to see where it stands), `restart_sync` (sync again with no cursor) or `contact_support` (with `requestId`)."
					},
					"retryAfterSeconds": {
						"anyOf": [
							{
								"type": "integer",
								"minimum": 0
							},
							{
								"type": "null"
							}
						],
						"description": "With `retry`: how long to wait first."
					},
					"requestId": {
						"type": "string"
					}
				},
				"required": ["code", "message", "details", "field", "recovery", "retryAfterSeconds", "requestId"],
				"description": "Every v3 error, whatever the route."
			},
			"Asset": {
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"pattern": "^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}\\/[-a-z0-9]{3,8}:[-.%a-zA-Z0-9]{1,128}$",
						"description": "CAIP-19 asset id."
					},
					"chain": {
						"type": "string",
						"pattern": "^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$",
						"description": "CAIP-2 chain id."
					},
					"symbol": {
						"type": "string"
					},
					"decimals": {
						"type": "integer",
						"minimum": 0
					}
				},
				"required": ["id", "chain", "symbol", "decimals"]
			},
			"AssetAmount": {
				"type": "object",
				"properties": {
					"asset": {
						"$ref": "#/components/schemas/Asset"
					},
					"amount": {
						"type": "string",
						"pattern": "^\\d+$",
						"description": "Base units."
					}
				},
				"required": ["asset", "amount"]
			},
			"Catalog": {
				"type": "object",
				"properties": {
					"chains": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"id": {
									"type": "string",
									"pattern": "^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$",
									"description": "CAIP-2 chain id."
								},
								"name": {
									"type": "string"
								}
							},
							"required": ["id", "name"]
						}
					},
					"assets": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"id": {
									"type": "string",
									"pattern": "^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}\\/[-a-z0-9]{3,8}:[-.%a-zA-Z0-9]{1,128}$",
									"description": "CAIP-19 asset id."
								},
								"chain": {
									"type": "string",
									"pattern": "^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$",
									"description": "CAIP-2 chain id."
								},
								"symbol": {
									"type": "string"
								},
								"decimals": {
									"type": "integer",
									"minimum": 0
								},
								"depositFee": {
									"type": "string",
									"pattern": "^\\d+$",
									"description": "Flat fee when this asset is an order's source, in its base units. Kept even if the order never fills."
								},
								"withdrawFee": {
									"type": "string",
									"pattern": "^\\d+$",
									"description": "Flat fee when this asset is an order's destination, in its base units. Charged in the source asset, converted at quote time, and kept even if the order never fills."
								}
							},
							"required": ["id", "chain", "symbol", "decimals", "depositFee", "withdrawFee"]
						},
						"description": "Every asset v3 trades. Any listed asset can be traded against any other."
					},
					"operatorFeeBps": {
						"type": "integer",
						"minimum": 0,
						"description": "The caller's operator fee, which differs by integrator."
					},
					"commissionBps": {
						"type": "integer",
						"minimum": 0,
						"description": "The caller's commission."
					}
				},
				"required": ["chains", "assets", "operatorFeeBps", "commissionBps"],
				"description": "The chains and assets v3 trades, with each asset's flat fees, and the caller's two bps fees. An order's flat fee is its source's `depositFee` plus its destination's `withdrawFee` in the source asset, which a quote shows as `display.flatFee`. Both bps fees are taken from the deposit less the flat fee, on the part that fills."
			},
			"CreateOrderRequest": {
				"type": "object",
				"properties": {
					"option": {
						"type": "string",
						"minLength": 1,
						"maxLength": 4096,
						"description": "An option id from /v3/quote, unchanged."
					},
					"accounts": {
						"type": "object",
						"properties": {
							"payer": {
								"description": "Sends the deposit, from this account. Required for an EVM source; a non-EVM source has none.",
								"anyOf": [
									{
										"type": "object",
										"properties": {
											"chain": {
												"type": "string",
												"minLength": 1,
												"maxLength": 64,
												"description": "CAIP-2 id of the account's chain."
											},
											"address": {
												"type": "string",
												"minLength": 1,
												"maxLength": 256
											}
										},
										"required": ["chain", "address"],
										"additionalProperties": false
									},
									{
										"type": "null"
									}
								]
							},
							"recipient": {
								"type": "object",
								"properties": {
									"chain": {
										"type": "string",
										"minLength": 1,
										"maxLength": 64,
										"description": "CAIP-2 id of the account's chain."
									},
									"address": {
										"type": "string",
										"minLength": 1,
										"maxLength": 256
									}
								},
								"required": ["chain", "address"],
								"additionalProperties": false,
								"description": "Receives the payout, on the destination chain."
							},
							"refundTo": {
								"description": "Receives refunds and signs cancels, on the source chain. Defaults to the payer on an EVM source and is required otherwise.",
								"anyOf": [
									{
										"type": "object",
										"properties": {
											"chain": {
												"type": "string",
												"minLength": 1,
												"maxLength": 64,
												"description": "CAIP-2 id of the account's chain."
											},
											"address": {
												"type": "string",
												"minLength": 1,
												"maxLength": 256
											}
										},
										"required": ["chain", "address"],
										"additionalProperties": false
									},
									{
										"type": "null"
									}
								]
							}
						},
						"required": ["recipient"],
						"additionalProperties": false
					}
				},
				"required": ["option", "accounts"],
				"additionalProperties": false
			},
			"Order": {
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"description": "`ord_…` for a v3 order; the hex `protocolId` for an order built through /v2."
					},
					"protocolId": {
						"type": "string",
						"pattern": "^0x[0-9a-f]{64}$",
						"description": "keccak256(depositor, nonce): the id /v2 and the chain use."
					},
					"version": {
						"type": "integer",
						"minimum": 0,
						"description": "Rises with every change to the order. Of two reads, keep the one with the higher `version`: two with the same `version` show the same order."
					},
					"createdAt": {
						"type": "string",
						"description": "RFC 3339 UTC time."
					},
					"updatedAt": {
						"type": "string",
						"description": "RFC 3339 UTC time."
					},
					"status": {
						"type": "string",
						"enum": ["awaiting_funding", "confirming", "trading", "settling", "delivering", "done", "expired"],
						"description": "`confirming`: the deposit is seen and the order is publishing. `trading`: published, solvers can fill it. `settling`: trading ended. `delivering`: the hub has settled, and a leg can still be on its way. `done`: every leg delivered. `expired`: the order didn't publish by `fillBy`, and routine polling can stop; a deposit that came for it shows as the `NOT_PUBLISHED` notice, and Khalani refunds it by hand. Once refunded, the order shows the refund in `summary.refund`, `delivering` and then `done`, or straight to `done` if delivery is already confirmed."
					},
					"outcome": {
						"anyOf": [
							{
								"type": "string",
								"enum": ["none", "partial", "full"]
							},
							{
								"type": "null"
							}
						],
						"description": "Set from `settling` on."
					},
					"liveAt": {
						"anyOf": [
							{
								"type": "string",
								"description": "RFC 3339 UTC time."
							},
							{
								"type": "null"
							}
						],
						"description": "When Khalani saw the order publish."
					},
					"summary": {
						"type": "object",
						"properties": {
							"actionNeeded": {
								"anyOf": [
									{
										"type": "object",
										"properties": {
											"kind": {
												"description": "`send_transaction`: `executor` sends the steps' transactions. `send_transfer`: anyone sends the transfer, from any account. `sign` is reserved.",
												"anyOf": [
													{
														"type": "string",
														"enum": ["send_transaction", "send_transfer", "sign"]
													},
													{
														"type": "string"
													}
												]
											},
											"executor": {
												"anyOf": [
													{
														"$ref": "#/components/schemas/Account"
													},
													{
														"type": "null"
													}
												],
												"description": "Who acts; null when anyone may."
											},
											"steps": {
												"type": "array",
												"items": {
													"type": "string"
												},
												"description": "The ids of the steps to run now, in order."
											}
										},
										"required": ["kind", "executor", "steps"]
									},
									{
										"type": "null"
									}
								],
								"description": "What to ask of the user now. Null once the deposit shows or the order publishes, or once funding closes at `fundBy`."
							},
							"notices": {
								"type": "array",
								"items": {
									"type": "object",
									"properties": {
										"code": {
											"type": "string",
											"description": "Open list, e.g. `DELIVERY_STUCK`."
										},
										"params": {
											"type": "object",
											"propertyNames": {
												"type": "string"
											},
											"additionalProperties": {}
										}
									},
									"required": ["code", "params"]
								},
								"description": "What Khalani is handling, to tell the user. Nothing for the user or the integrator to do."
							},
							"payout": {
								"type": "object",
								"properties": {
									"amount": {
										"anyOf": [
											{
												"$ref": "#/components/schemas/AssetAmount"
											},
											{
												"type": "null"
											}
										],
										"description": "What the hub settled for this leg: null until it settles, zero when nothing is owed."
									},
									"status": {
										"type": "string",
										"enum": ["pending", "in_flight", "completed"],
										"description": "`pending` until the hub settles, `in_flight` while the leg is on its way, `completed` once it lands."
									},
									"tx": {
										"anyOf": [
											{
												"$ref": "#/components/schemas/TransactionRef"
											},
											{
												"type": "null"
											}
										],
										"description": "The delivery, once seen."
									},
									"withoutTx": {
										"anyOf": [
											{
												"anyOf": [
													{
														"type": "string",
														"enum": ["sub_unit_amount", "tx_unknown"]
													},
													{
														"type": "string"
													}
												]
											},
											{
												"type": "null"
											}
										],
										"description": "Why a `completed` leg has no `tx`, else null. `sub_unit_amount`: the amount was smaller than the smallest unit on the chain the leg pays out on, so nothing was transferred. `tx_unknown`: the leg was delivered, but its transaction is unknown."
									}
								},
								"required": ["amount", "status", "tx", "withoutTx"],
								"description": "What the recipient is paid. Show it once its `amount` is above zero."
							},
							"refund": {
								"type": "object",
								"properties": {
									"amount": {
										"anyOf": [
											{
												"$ref": "#/components/schemas/AssetAmount"
											},
											{
												"type": "null"
											}
										],
										"description": "What the hub settled for this leg: null until it settles, zero when nothing is owed."
									},
									"status": {
										"type": "string",
										"enum": ["pending", "in_flight", "completed"],
										"description": "`pending` until the hub settles, `in_flight` while the leg is on its way, `completed` once it lands."
									},
									"tx": {
										"anyOf": [
											{
												"$ref": "#/components/schemas/TransactionRef"
											},
											{
												"type": "null"
											}
										],
										"description": "The delivery, once seen."
									},
									"withoutTx": {
										"anyOf": [
											{
												"anyOf": [
													{
														"type": "string",
														"enum": ["sub_unit_amount", "tx_unknown"]
													},
													{
														"type": "string"
													}
												]
											},
											{
												"type": "null"
											}
										],
										"description": "Why a `completed` leg has no `tx`, else null. `sub_unit_amount`: the amount was smaller than the smallest unit on the chain the leg pays out on, so nothing was transferred. `tx_unknown`: the leg was delivered, but its transaction is unknown."
									}
								},
								"required": ["amount", "status", "tx", "withoutTx"],
								"description": "What comes back to `refundTo`. Show it once its `amount` is above zero."
							},
							"pollAfterSeconds": {
								"anyOf": [
									{
										"type": "integer",
										"exclusiveMinimum": 0
									},
									{
										"type": "null"
									}
								],
								"description": "Null for done or expired: routine polling can stop. Sync with sort=updatedAt for later deposit and refund updates to expired orders."
							}
						},
						"required": ["actionNeeded", "notices", "payout", "refund", "pollAfterSeconds"]
					},
					"terms": {
						"type": "object",
						"properties": {
							"send": {
								"$ref": "#/components/schemas/AssetAmount"
							},
							"receiveAsset": {
								"$ref": "#/components/schemas/Asset"
							},
							"minRate": {
								"anyOf": [
									{
										"type": "string",
										"pattern": "^\\d+(\\.\\d+)?$",
										"description": "The least a full fill pays per token sent, in whole tokens, fees included."
									},
									{
										"type": "null"
									}
								],
								"description": "The least a full fill pays per token of `send`, the whole deposit: `receiveMin` divided by `send`. Null while `receiveMin` is."
							},
							"slippageBps": {
								"type": "integer",
								"minimum": 0
							},
							"fundBy": {
								"anyOf": [
									{
										"type": "string",
										"description": "RFC 3339 UTC time."
									},
									{
										"type": "null"
									}
								],
								"description": "Send the deposit by then. At `fundBy` an order that hasn't shown its deposit or published closes its funding: its steps show `closed` and `summary.actionNeeded` is null, so stop asking for payment. A deposit sent anyway still counts, but may have no time left to fill. Null for an order built through /v2."
							},
							"fillBy": {
								"type": "string",
								"description": "The deadline the order is signed with."
							},
							"receive": {
								"anyOf": [
									{
										"$ref": "#/components/schemas/AssetAmount"
									},
									{
										"type": "null"
									}
								],
								"description": "What a full fill pays at the quoted price, the amount the quote showed; `receiveMin` is the guarantee. Null until known."
							},
							"receiveMin": {
								"anyOf": [
									{
										"$ref": "#/components/schemas/AssetAmount"
									},
									{
										"type": "null"
									}
								],
								"description": "The least a full fill pays; null until known."
							},
							"flatFee": {
								"anyOf": [
									{
										"$ref": "#/components/schemas/AssetAmount"
									},
									{
										"type": "null"
									}
								],
								"description": "Kept once the order publishes, whatever fills, rounded up: a published order that doesn't fill refunds `send` less this. Recovery of a deposit that couldn't publish refunds the full deposit without a flat fee. Null for an order built through /v2."
							}
						},
						"required": ["send", "receiveAsset", "minRate", "slippageBps", "fundBy", "fillBy", "receive", "receiveMin", "flatFee"]
					},
					"accounts": {
						"type": "object",
						"properties": {
							"payer": {
								"anyOf": [
									{
										"$ref": "#/components/schemas/Account"
									},
									{
										"type": "null"
									}
								]
							},
							"recipient": {
								"$ref": "#/components/schemas/Account"
							},
							"refundTo": {
								"$ref": "#/components/schemas/Account"
							}
						},
						"required": ["payer", "recipient", "refundTo"]
					},
					"steps": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"id": {
									"type": "string",
									"enum": ["approve_reset", "approve", "deposit", "transfer"],
									"description": "What the step does: `approve_reset` clears a leftover allowance, `approve` sets the allowance, `deposit` makes the deposit and `transfer` pays a TRON, Stellar or Solana deposit address."
								},
								"type": {
									"type": "string",
									"enum": ["transfer", "transaction", "signature"],
									"description": "`signature` is reserved."
								},
								"status": {
									"type": "string",
									"enum": ["pending", "refresh_required", "submitted", "completed", "closed"],
									"description": "`closed`: funding closed at `fundBy` before the deposit showed, or Khalani couldn't take a TRON, Stellar or Solana transfer (`NOT_PUBLISHED`). `refresh_required` and `submitted` are reserved."
								},
								"chain": {
									"type": "string",
									"pattern": "^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$",
									"description": "CAIP-2 chain id."
								},
								"actor": {
									"type": "string",
									"description": "Open list: `payer`, or `anyone`."
								},
								"executor": {
									"anyOf": [
										{
											"$ref": "#/components/schemas/Account"
										},
										{
											"type": "null"
										}
									],
									"description": "Null when anyone can run it."
								},
								"instruction": {
									"description": "Open list by `format`: a step whose format you don't know can't be run.",
									"anyOf": [
										{
											"type": "object",
											"properties": {
												"format": {
													"type": "string",
													"const": "evm_call"
												},
												"payload": {
													"type": "object",
													"properties": {
														"chainId": {
															"type": "integer"
														},
														"from": {
															"type": "string",
															"description": "The payer: send the call from this account. A deposit from any other isn't credited to the order and waits for a manual refund."
														},
														"to": {
															"type": "string"
														},
														"data": {
															"type": "string"
														},
														"value": {
															"type": "string",
															"pattern": "^\\d+$",
															"description": "Wei sent with the call. A deposit's is the relay fee when the order was created, plus the amount for a native coin: if the fee rises before it lands, it reverts."
														},
														"gasLimit": {
															"type": "string",
															"pattern": "^\\d+$",
															"description": "Send the call with this gas limit."
														}
													},
													"required": ["chainId", "from", "to", "data", "value", "gasLimit"]
												},
												"approval": {
													"anyOf": [
														{
															"type": "object",
															"properties": {
																"spender": {
																	"type": "string"
																},
																"amount": {
																	"$ref": "#/components/schemas/AssetAmount"
																}
															},
															"required": ["spender", "amount"]
														},
														{
															"type": "null"
														}
													],
													"description": "What the call approves: `spender` may take `amount` from the payer. Null for a call that isn't an approval. Approvals follow the payer's allowance when the order was created: go by its allowance now, as the deposit's `allowance` says."
												},
												"allowance": {
													"anyOf": [
														{
															"type": "object",
															"properties": {
																"spender": {
																	"type": "string"
																},
																"amount": {
																	"$ref": "#/components/schemas/AssetAmount"
																}
															},
															"required": ["spender", "amount"]
														},
														{
															"type": "null"
														}
													],
													"description": "The allowance the call needs: `spender` may take `amount` from the payer. Null for an approval, and for a deposit of a native coin, which the call's `value` carries. Read the payer's allowance of the asset's token for `spender` before the approvals, and again if the call reverts: at least `amount`, send only this call; 0, approve `amount` first; anything between, approve 0, then `amount`. Some tokens, such as USDT on Ethereum, revert an approval from one nonzero allowance to another."
												}
											},
											"required": ["format", "payload", "approval", "allowance"]
										},
										{
											"type": "object",
											"properties": {
												"format": {
													"type": "string",
													"const": "transfer"
												},
												"to": {
													"description": "For Solana, this is the wallet owner: derive the owner’s ATA for the asset’s mint under the standard SPL Token program, create it idempotently if absent (sender pays rent), and send one exact payment without memo, split or top-up. For Zcash, pay the exact amount in one transparent output, with no memo or OP_RETURN. Otherwise pay exactly this address, with no memo. A Stellar deposit address is a muxed `M…` address: a payment to its `G…` account, or one with a memo, is not credited.",
													"$ref": "#/components/schemas/Account"
												},
												"amount": {
													"$ref": "#/components/schemas/AssetAmount"
												}
											},
											"required": ["format", "to", "amount"]
										},
										{
											"type": "object",
											"properties": {
												"format": {
													"type": "string"
												}
											},
											"required": ["format"]
										}
									]
								}
							},
							"required": ["id", "type", "status", "chain", "actor", "executor", "instruction"]
						},
						"description": "How to fund the order. Steps stay `pending` until the order shows the deposit or publishes, so a step still listed may have been sent: send one again only if your own transaction failed."
					},
					"receipts": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"id": {
									"type": "string"
								},
								"tx": {
									"$ref": "#/components/schemas/TransactionRef"
								},
								"amount": {
									"$ref": "#/components/schemas/AssetAmount"
								},
								"from": {
									"type": "array",
									"items": {
										"$ref": "#/components/schemas/Account"
									}
								},
								"observation": {
									"type": "string",
									"enum": ["detected", "included", "final", "dropped"],
									"description": "`detected` and `dropped` are reserved."
								},
								"at": {
									"type": "string",
									"description": "RFC 3339 UTC time."
								}
							},
							"required": ["id", "tx", "amount", "from", "observation", "at"]
						}
					},
					"fills": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"id": {
									"type": "string",
									"description": "The solved intent."
								},
								"at": {
									"type": "string",
									"description": "When the hub solved it, or, when the hub gave no time, when Khalani saw it."
								},
								"send": {
									"anyOf": [
										{
											"$ref": "#/components/schemas/AssetAmount"
										},
										{
											"type": "null"
										}
									],
									"description": "What the fill used of the deposit, its share of the bps fees included. The fills' `send`, the flat fee and the refund add up to the order's `send`, or a base unit short of it: each is rounded down. Null when not known, as on an order built through /v2."
								},
								"receive": {
									"anyOf": [
										{
											"$ref": "#/components/schemas/AssetAmount"
										},
										{
											"type": "null"
										}
									],
									"description": "What the fill pays the recipient. The fills add up to the payout. Null when not known."
								}
							},
							"required": ["id", "at", "send", "receive"]
						}
					},
					"obligations": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"id": {
									"type": "string"
								},
								"kind": {
									"type": "string",
									"enum": ["payout", "refund", "return"],
									"description": "`return` is reserved."
								},
								"status": {
									"type": "string",
									"enum": ["pending", "in_flight", "completed", "superseded", "written_off", "voided"],
									"description": "The last three are reserved."
								},
								"to": {
									"$ref": "#/components/schemas/Account"
								},
								"amount": {
									"anyOf": [
										{
											"$ref": "#/components/schemas/AssetAmount"
										},
										{
											"type": "null"
										}
									],
									"description": "From the hub settlement. Null until known."
								},
								"evidence": {
									"type": "array",
									"items": {
										"type": "object",
										"properties": {
											"tx": {
												"$ref": "#/components/schemas/TransactionRef"
											},
											"at": {
												"type": "string",
												"description": "RFC 3339 UTC time."
											}
										},
										"required": ["tx", "at"]
									}
								},
								"problem": {
									"anyOf": [
										{
											"type": "object",
											"properties": {
												"code": {
													"type": "string",
													"description": "Open list."
												},
												"message": {
													"type": "string"
												},
												"details": {
													"anyOf": [
														{
															"type": "object",
															"propertyNames": {
																"type": "string"
															},
															"additionalProperties": {}
														},
														{
															"type": "null"
														}
													]
												}
											},
											"required": ["code", "message", "details"]
										},
										{
											"type": "null"
										}
									]
								}
							},
							"required": ["id", "kind", "status", "to", "amount", "evidence", "problem"]
						}
					},
					"invocations": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"id": {
									"type": "string"
								},
								"kind": {
									"type": "string",
									"enum": ["cancel"]
								},
								"status": {
									"type": "string",
									"enum": ["pending", "accepted", "rejected"],
									"description": "`pending` until the order stops trading: then `accepted` if it stopped short of a full fill, or `rejected`, with `ORDER_OVERTAKEN`, if a full fill got there first."
								},
								"signer": {
									"$ref": "#/components/schemas/Account"
								},
								"at": {
									"type": "string",
									"description": "RFC 3339 UTC time."
								},
								"problem": {
									"anyOf": [
										{
											"type": "object",
											"properties": {
												"code": {
													"type": "string",
													"description": "Open list."
												},
												"message": {
													"type": "string"
												},
												"details": {
													"anyOf": [
														{
															"type": "object",
															"propertyNames": {
																"type": "string"
															},
															"additionalProperties": {}
														},
														{
															"type": "null"
														}
													]
												}
											},
											"required": ["code", "message", "details"]
										},
										{
											"type": "null"
										}
									]
								}
							},
							"required": ["id", "kind", "status", "signer", "at", "problem"]
						},
						"description": "Cancel requests made through this API: at most one per order."
					},
					"requirements": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"id": {
									"type": "string"
								},
								"code": {
									"type": "string",
									"description": "Open list."
								},
								"message": {
									"type": "string"
								},
								"blocks": {
									"type": "string",
									"enum": ["funding", "publication", "settlement", "delivery", "reconciliation", "closure"],
									"description": "`publication`, `settlement` and `delivery` are sent; the others are reserved."
								},
								"actionBy": {
									"type": "string",
									"description": "Open list, e.g. `khalani`."
								},
								"details": {
									"anyOf": [
										{
											"type": "object",
											"propertyNames": {
												"type": "string"
											},
											"additionalProperties": {}
										},
										{
											"type": "null"
										}
									]
								}
							},
							"required": ["id", "code", "message", "blocks", "actionBy", "details"]
						}
					},
					"actions": {
						"type": "object",
						"properties": {
							"cancel": {
								"type": "object",
								"properties": {
									"available": {
										"type": "boolean"
									},
									"reason": {
										"anyOf": [
											{
												"type": "object",
												"properties": {
													"code": {
														"type": "string",
														"description": "Open list."
													},
													"message": {
														"type": "string"
													},
													"details": {
														"anyOf": [
															{
																"type": "object",
																"propertyNames": {
																	"type": "string"
																},
																"additionalProperties": {}
															},
															{
																"type": "null"
															}
														]
													}
												},
												"required": ["code", "message", "details"]
											},
											{
												"type": "null"
											}
										]
									},
									"signer": {
										"anyOf": [
											{
												"$ref": "#/components/schemas/Account"
											},
											{
												"type": "null"
											}
										],
										"description": "The account that signs a cancel: `refundTo`, which on an EVM source defaults to the payer. On the quote, `signer` is the role."
									},
									"proof": {
										"anyOf": [
											{
												"type": "object",
												"properties": {
													"format": {
														"description": "With a format you don't know, the order can't be cancelled early.",
														"anyOf": [
															{
																"type": "string",
																"enum": ["eip191_cancel_proof", "tip191_cancel_proof", "sep53_cancel_proof"]
															},
															{
																"type": "string"
															}
														]
													},
													"message": {
														"type": "string",
														"description": "What `signer` signs with its wallet's sign-message call, for `POST /orders/{id}/actions`: `personal_sign` for `eip191_cancel_proof`, TronWeb's `signMessageV2` for `tip191_cancel_proof`, and a SEP-53 call such as Freighter's `signMessage` for `sep53_cancel_proof`. The same on every read."
													}
												},
												"required": ["format", "message"]
											},
											{
												"type": "null"
											}
										],
										"description": "Null while cancel is unavailable."
									}
								},
								"required": ["available", "reason", "signer", "proof"]
							}
						},
						"required": ["cancel"]
					},
					"charges": {
						"anyOf": [
							{
								"type": "object",
								"properties": {
									"protocolFee": {
										"$ref": "#/components/schemas/AssetAmount"
									}
								},
								"required": ["protocolFee"]
							},
							{
								"type": "null"
							}
						],
						"description": "Once settled. The protocol fee is rounded up, like `terms.flatFee`."
					}
				},
				"required": [
					"id",
					"protocolId",
					"version",
					"createdAt",
					"updatedAt",
					"status",
					"outcome",
					"liveAt",
					"summary",
					"terms",
					"accounts",
					"steps",
					"receipts",
					"fills",
					"obligations",
					"invocations",
					"requirements",
					"actions",
					"charges"
				],
				"description": "One order in the chain-neutral model."
			},
			"OrderActionRequest": {
				"type": "object",
				"properties": {
					"kind": {
						"type": "string",
						"const": "cancel",
						"description": "Cancel the order early: the unfilled part is refunded."
					},
					"signature": {
						"type": "string",
						"maxLength": 8194,
						"pattern": "^(0x([0-9a-fA-F]{2})*|[A-Za-z0-9+/]{86}==)$",
						"description": "`actions.cancel.signer`'s signature over `actions.cancel.proof.message`, as its wallet returns it. EIP-191: 65 bytes from a key, or a contract wallet's EIP-1271 signature of any length (`0x` from a Safe that approved the message on chain), in 0x-prefixed hex. TIP-191: 65 bytes in 0x-prefixed hex. SEP-53: 64 bytes in base64 or 0x-prefixed hex."
					}
				},
				"required": ["kind", "signature"],
				"additionalProperties": false
			},
			"OrderChanges": {
				"type": "object",
				"properties": {
					"changes": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"version": {
									"type": "integer",
									"minimum": 0
								},
								"at": {
									"type": "string",
									"description": "RFC 3339 UTC time."
								},
								"kind": {
									"type": "string",
									"description": "Open list: `created`, `imported` (the order as it stood when its history began), `deposit_seen`, `funding_closed`, `expired`, `not_published`, `published`, `cancel_requested`, `filled`, `trading_ended`, `settlement_stuck`, `settled`, `payout_delivered`, `refund_delivered`, `delivery_stuck`, `delivered`, or `updated` for any other change before `settled`."
								},
								"records": {
									"type": "array",
									"items": {
										"type": "string"
									},
									"description": "The ids of the steps and records the change set."
								}
							},
							"required": ["version", "at", "kind", "records"]
						}
					}
				},
				"required": ["changes"],
				"description": "The order's changes, oldest first. Once the hub has settled, only events are listed: an `updated` change is left out, so versions can skip."
			},
			"OrderList": {
				"type": "object",
				"properties": {
					"orders": {
						"type": "array",
						"items": {
							"$ref": "#/components/schemas/Order"
						}
					},
					"cursor": {
						"description": "Pass it back for the next page. Newest first, it is null after the last page. In order of last change it is never null: you are caught up once a page comes back empty with the cursor you sent, so keep it and ask again later. An empty page with a new cursor means ask again now.",
						"type": ["string", "null"]
					}
				},
				"required": ["orders", "cursor"],
				"description": "The caller's orders, newest first or in order of last change."
			},
			"QuoteRequest": {
				"type": "object",
				"properties": {
					"send": {
						"type": "object",
						"properties": {
							"asset": {
								"type": "string",
								"minLength": 1,
								"maxLength": 256,
								"description": "CAIP-19 id of the asset the user sends."
							},
							"amount": {
								"type": "string",
								"pattern": "^[1-9]\\d*$",
								"description": "What the user sends, in base units, fees included."
							}
						},
						"required": ["asset", "amount"],
						"additionalProperties": false
					},
					"receive": {
						"type": "object",
						"properties": {
							"asset": {
								"type": "string",
								"minLength": 1,
								"maxLength": 256,
								"description": "CAIP-19 id of the asset the user receives."
							}
						},
						"required": ["asset"],
						"additionalProperties": false
					}
				},
				"required": ["send", "receive"],
				"additionalProperties": false
			},
			"QuoteResponse": {
				"type": "object",
				"properties": {
					"expiresAt": {
						"type": "string",
						"description": "When the options stop being accepted by `POST /orders`."
					},
					"options": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"id": {
									"type": "string",
									"description": "A signed, expiring token. Pass it to `POST /orders` unchanged."
								},
								"requires": {
									"type": "array",
									"items": {
										"type": "string"
									},
									"description": "Capabilities the client needs to fund the order, e.g. `format:evm_call`, or `stellar:muxed_destination` to pay a Stellar `M…` address as given, with no memo. `solana:associated_token_account` requires deriving the returned owner’s ATA for the asset’s mint under the standard SPL Token program, creating it idempotently if absent (sender pays rent), and sending one exact payment without memo, split or top-up. Skip an option with one you lack."
								},
								"roles": {
									"type": "array",
									"items": {
										"type": "object",
										"properties": {
											"role": {
												"anyOf": [
													{
														"type": "string",
														"enum": ["payer", "recipient", "refundTo"]
													},
													{
														"type": "string"
													}
												]
											},
											"chain": {
												"type": "string",
												"pattern": "^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$",
												"description": "CAIP-2 chain id."
											},
											"required": {
												"type": "boolean"
											},
											"defaultFrom": {
												"anyOf": [
													{
														"anyOf": [
															{
																"type": "string",
																"enum": ["payer"]
															},
															{
																"type": "string"
															}
														]
													},
													{
														"type": "null"
													}
												],
												"description": "The role this one defaults to when left out."
											},
											"constraint": {
												"anyOf": [
													{
														"anyOf": [
															{
																"type": "string",
																"enum": ["sender_bound"]
															},
															{
																"type": "string"
															}
														]
													},
													{
														"type": "null"
													}
												],
												"description": "`sender_bound`: the deposit must come from this account. An option with a constraint you don't know can't be used."
											}
										},
										"required": ["role", "chain", "required", "defaultFrom", "constraint"]
									}
								},
								"terms": {
									"type": "object",
									"properties": {
										"send": {
											"$ref": "#/components/schemas/AssetAmount"
										},
										"receiveAsset": {
											"$ref": "#/components/schemas/Asset"
										},
										"minRate": {
											"type": "string",
											"pattern": "^\\d+(\\.\\d+)?$",
											"description": "The least a full fill pays per token sent, in whole tokens, fees included."
										},
										"slippageBps": {
											"type": "integer",
											"minimum": 0
										},
										"fundWithinSeconds": {
											"type": "integer",
											"exclusiveMinimum": 0,
											"description": "From creation to `fundBy`: the time to send the deposit by, after which the funding steps close."
										},
										"fillWithinSeconds": {
											"type": "integer",
											"exclusiveMinimum": 0,
											"description": "From creation to `fillBy`, the deadline the order is signed with."
										}
									},
									"required": ["send", "receiveAsset", "minRate", "slippageBps", "fundWithinSeconds", "fillWithinSeconds"]
								},
								"display": {
									"type": "object",
									"properties": {
										"send": {
											"$ref": "#/components/schemas/AssetAmount"
										},
										"receive": {
											"description": "At the current price: the amount to show.",
											"$ref": "#/components/schemas/AssetAmount"
										},
										"receiveMin": {
											"description": "Guaranteed on a full fill: the slippage floor.",
											"$ref": "#/components/schemas/AssetAmount"
										},
										"protocolFee": {
											"description": "The flat fee plus the operator fee, rounded up.",
											"$ref": "#/components/schemas/AssetAmount"
										},
										"flatFee": {
											"description": "The source's `depositFee` plus the destination's `withdrawFee`, in the source asset and rounded up. Kept whatever fills: an order that doesn't fill refunds `send` less this. Show the user that refund before they pay.",
											"$ref": "#/components/schemas/AssetAmount"
										},
										"relayFee": {
											"anyOf": [
												{
													"$ref": "#/components/schemas/AssetAmount"
												},
												{
													"type": "null"
												}
											],
											"description": "Paid on top of `send` by an EVM deposit, in the chain's gas token: an estimate. The deposit step's `value` carries the fee when the order is created, and for a native coin `send` too."
										}
									},
									"required": ["send", "receive", "receiveMin", "protocolFee", "flatFee", "relayFee"]
								},
								"actions": {
									"type": "object",
									"properties": {
										"cancel": {
											"type": "object",
											"properties": {
												"available": {
													"type": "boolean",
													"description": "Whether an order from this option can be cancelled once it publishes."
												},
												"reason": {
													"anyOf": [
														{
															"type": "object",
															"properties": {
																"code": {
																	"type": "string",
																	"description": "Open list."
																},
																"message": {
																	"type": "string"
																},
																"details": {
																	"anyOf": [
																		{
																			"type": "object",
																			"propertyNames": {
																				"type": "string"
																			},
																			"additionalProperties": {}
																		},
																		{
																			"type": "null"
																		}
																	]
																}
															},
															"required": ["code", "message", "details"]
														},
														{
															"type": "null"
														}
													]
												},
												"signer": {
													"description": "The role whose account signs cancels. On the order, `actions.cancel.signer` is that account.",
													"anyOf": [
														{
															"type": "string",
															"enum": ["payer", "recipient", "refundTo"]
														},
														{
															"type": "string"
														}
													]
												},
												"format": {
													"anyOf": [
														{
															"anyOf": [
																{
																	"type": "string",
																	"enum": ["eip191_cancel_proof", "tip191_cancel_proof", "sep53_cancel_proof"]
																},
																{
																	"type": "string"
																}
															]
														},
														{
															"type": "null"
														}
													],
													"description": "The proof a cancel will need. With a format you don't know, the order can't be cancelled early."
												}
											},
											"required": ["available", "reason", "signer", "format"]
										}
									},
									"required": ["cancel"]
								}
							},
							"required": ["id", "requires", "roles", "terms", "display", "actions"]
						}
					}
				},
				"required": ["expiresAt", "options"],
				"description": "Ways to make the trade. Each option is priced now; nothing is stored."
			},
			"TransactionRef": {
				"type": "object",
				"properties": {
					"chain": {
						"type": "string",
						"pattern": "^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$",
						"description": "CAIP-2 chain id."
					},
					"hash": {
						"type": "string"
					}
				},
				"required": ["chain", "hash"]
			},
			"ValidationDetails": {
				"type": "object",
				"properties": {
					"issues": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"field": {
									"type": "string",
									"description": "The field at fault, as a dotted path."
								},
								"message": {
									"type": "string"
								},
								"code": {
									"type": "string",
									"description": "Open list."
								}
							},
							"required": ["field", "message", "code"]
						}
					}
				},
				"required": ["issues"],
				"description": "`VALIDATION_FAILED`'s details when the request fails its schema: every field it got wrong."
			}
		}
	}
}
