{
  "openapi": "3.1.0",
  "info": {
    "title": "Orbit Native Pool Routing API",
    "version": "1.0.0",
    "description": "A direct Uniswap v4 liquidity source on Robinhood Chain. External platforms must integrate/approve the source. Public quotes never sign, approve or broadcast. See the source manifest for current verified-registration addresses."
  },
  "servers": [
    {
      "url": "https://orbitlaunch.io"
    }
  ],
  "paths": {
    "/api/routes": {
      "get": {
        "summary": "Get a wallet-free price or recipient-bound unsigned pool route",
        "parameters": [
          {
            "name": "chainId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                4663
              ],
              "default": 4663
            }
          },
          {
            "name": "fromToken",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            }
          },
          {
            "name": "toToken",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            }
          },
          {
            "name": "fromAmount",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,38}$",
              "description": "Raw token input units, strictly smaller than 2^127 (quoter signed input bound)."
            }
          },
          {
            "name": "slippageBps",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "recipient",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$",
              "description": "Optional actual receiving/trading wallet. Omit for a price preview without a transaction."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Same-block exact-input quote, optionally with unsigned protected calldata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RouteQuote"
                }
              }
            }
          },
          "400": {
            "description": "Invalid amount, input, chain, recipient or slippage."
          },
          "404": {
            "description": "No direct/two-pool route or no liquid fill."
          },
          "429": {
            "description": "Per-IP quota. Honor retryAt epoch milliseconds."
          },
          "503": {
            "description": "Source verification, RPC or identical quote still in progress; honor code/retryAt."
          }
        }
      },
      "post": {
        "summary": "Quote the same public unsigned route using a JSON body",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RouteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Same-block exact-input quote, optionally with unsigned protected calldata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RouteQuote"
                }
              }
            }
          },
          "400": {
            "description": "Invalid amount, input, chain, recipient or slippage."
          },
          "404": {
            "description": "No direct/two-pool route or no liquid fill."
          },
          "429": {
            "description": "Per-IP quota. Honor retryAt epoch milliseconds."
          },
          "503": {
            "description": "Source verification, RPC or identical quote still in progress; honor code/retryAt."
          }
        }
      }
    },
    "/.well-known/orbit-route.json": {
      "get": {
        "summary": "Source capabilities, current contracts and integration resources",
        "responses": {
          "200": {
            "description": "Manifest; external listing requires acceptance, no registration is asserted."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "RouteRequest": {
        "type": "object",
        "required": [
          "fromToken",
          "toToken",
          "fromAmount"
        ],
        "properties": {
          "chainId": {
            "type": "integer",
            "enum": [
              4663
            ],
            "default": 4663
          },
          "fromToken": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$"
          },
          "toToken": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$"
          },
          "fromAmount": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,38}$",
            "description": "Raw token input units, strictly smaller than 2^127 (quoter signed input bound)."
          },
          "slippageBps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "default": 50
          },
          "recipient": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$",
            "description": "Optional actual receiving/trading wallet. Omit for a price preview without a transaction."
          }
        }
      },
      "RouteQuote": {
        "type": "object",
        "required": [
          "schemaVersion",
          "source",
          "chainId",
          "input",
          "amountOut",
          "minimum",
          "pools",
          "transaction",
          "fees",
          "expiresAt",
          "requiresWalletSimulation"
        ],
        "properties": {
          "schemaVersion": {
            "const": 1
          },
          "source": {
            "const": "orbit-pools"
          },
          "chainId": {
            "const": 4663
          },
          "input": {
            "$ref": "#/components/schemas/RouteRequest"
          },
          "amountOut": {
            "type": "string"
          },
          "minimum": {
            "type": "string"
          },
          "pools": {
            "type": "array",
            "minItems": 1,
            "maxItems": 2,
            "items": {
              "type": "object"
            }
          },
          "transaction": {
            "type": [
              "object",
              "null"
            ],
            "description": "Unsigned swapRoute calldata, or null for a public price. Never a funded simulation."
          },
          "fees": {
            "type": "object",
            "description": "1% existing fee per native pool leg, including 0.1% owner. No extra API routing fee."
          },
          "expiresAt": {
            "type": "integer",
            "description": "Epoch milliseconds. Client must reject expired quotes; current router has no on-chain deadline."
          },
          "requiresWalletSimulation": {
            "const": true
          },
          "gasEstimate": {
            "type": "object",
            "description": "Quoter-only gas, excluding router, collection and approvals."
          },
          "deadlineEnforcedOnChain": {
            "const": false
          }
        }
      }
    }
  }
}
