openapi: 3.1.0
info:
  title: Quote.Trade Public API
  version: 0.1.0
  description: >-
    Public Quote.Trade market-data API for an AI-native crypto dark-pool DEX.
    Quote.Trade uses private bilateral IOC/FOK execution with public smart-contract
    funding, withdrawals, balances, and position state. Funding-contract balances
    are point-in-time collateral measurements; private orders and fills remain in
    authenticated execution records. Quotes are size-aware and all-in, with no
    separate trading commission added after the quote.
  x-quote-trade-architecture:
    execution: private bilateral IOC/FOK
    funding: V6 smart contracts on Ethereum and XDC
    positionState: PositionManager on Polygon and XDC
    versioning: direct non-upgradeable deployments with explicit migrations
  x-quote-trade-pricing:
    standardTargetBpsFromMidPerSide: 13
    liveQuoteAuthoritative: true
    comparisonMethod: completed immediate taker execution at the same size
  x-quote-trade-agent-workflows:
    canonicalPrivateInterface: hosted MCP or documented authenticated REST/WebSocket
    withdrawalsSupported: true
    withdrawalDestination: registered-login-wallet
    orderApprovalText: APPROVE QUOTE.TRADE LIVE ORDER
    withdrawalApprovalText: APPROVE QUOTE.TRADE LIVE WITHDRAW
  x-quote-trade-verification:
    fundingCore: "0xfb41c4f731a064fb3911d16d529be0c2958d5fc6"
    viewsCompanion: "0x228d706e0651038dd8ec151e2f639b3e47ffecb6"
    positionManager: "0xf857aC7bed76B43c5457f56483803C4CebbD7eff"
    fundingNetworks: [Ethereum, XDC]
    positionNetworks: [Polygon, XDC]
    coverageMethod: physical assets compared with aggregate positive published withdrawal balances
    publishedBalanceVerification: >-
      Polygon and XDC position snapshots reconcile against balances published in V6;
      those balances are compared with actual USDC/USDT held in the Ethereum and XDC
      funding contracts, mathematically verifying published balances and collateral coverage
      while private trades, counterparties, routing, and volume remain private.
    v6Versioning: >-
      V6 is the new non-upgradeable contract version. New contract logic requires a new
      deployment and migration instead of modifying the existing contract in place.
    reconciliationMap:
      ethereumFunding: V6 Ethereum USDC/USDT assets and published balances
      ethereumPositions: corresponding completed Polygon PositionManager state
      xdcFunding: V6 XDC USDC assets and published balances
      xdcPositions: corresponding completed XDC PositionManager state
    snapshotRequirements:
      - complete publication
      - processedBatches equals totalBatches
      - lastSyncedTime current relative to syncFrequency
      - aligned wallet, user, asset, scale, composite, snapshot, and timestamp
    operationalKeyProtections:
      - direct non-upgradeable core
      - separated publisher and withdrawal roles
      - registered-wallet settlement
      - three observations at least 22 hours apart
      - shared lowest-observation 1.5x cap
      - complete multipart publication and cooldown
      - replay and physical-liquidity checks
      - exact debit and recipient-credit invariants
      - timelocked composite changes
      - emergency signer-epoch rotation
servers:
  - url: https://app.quote.trade/api
security: []
tags:
  - name: Public Market Data
paths:
  /status:
    get:
      tags: [Public Market Data]
      operationId: getStatus
      summary: Get public Quote.Trade platform status
      security: []
      responses:
        '200':
          description: Platform status
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
              examples:
                ok:
                  value:
                    system: operational
                    serverTime: 1765168545978
                    features:
                      leveraged_trading: true
                      dark_pool_mode: true
                      bridge_required: false
  /exchangeInfo:
    get:
      tags: [Public Market Data]
      operationId: getExchangeInfo
      summary: Get public exchange metadata and supported symbols when available
      security: []
      responses:
        '200':
          description: Exchange metadata
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                properties:
                  exchangeFilters:
                    type: array
                    items: { type: object, additionalProperties: true }
                  rateLimits:
                    type: array
                    items: { type: object, additionalProperties: true }
                  serverTime: { type: integer }
                  symbols:
                    type: array
                    items: { $ref: '#/components/schemas/Symbol' }
  /getInstrumentPairs:
    get:
      tags: [Public Market Data]
      operationId: getInstrumentPairs
      summary: Get public instrument pair metadata when available
      security: []
      parameters:
        - name: limit
          in: query
          required: false
          schema: { type: integer, minimum: 1, maximum: 5000, default: 100 }
      responses:
        '200':
          description: Instrument pair list
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                properties:
                  instrumentPairs:
                    type: array
                    items: { $ref: '#/components/schemas/Symbol' }
  /ticker:
    get:
      tags: [Public Market Data]
      operationId: getTicker
      summary: Get public ticker for a symbol
      security: []
      parameters:
        - name: symbol
          in: query
          required: true
          schema: { type: string, examples: [BTC] }
      responses:
        '200':
          description: Ticker
          content:
            application/json:
              schema: { $ref: '#/components/schemas/Ticker' }
              examples:
                btc:
                  value:
                    symbol: BTC
                    lastUpdateId: '1765169207049'
                    price: '91201.73'
                    bid: '90928.07'
                    ask: '91475.39'
        '400': { $ref: '#/components/responses/APIError' }
        '429': { $ref: '#/components/responses/RateLimitError' }
  /depth:
    get:
      tags: [Public Market Data]
      operationId: getOrderBook
      summary: Get public order book depth for a symbol
      security: []
      parameters:
        - name: symbol
          in: query
          required: true
          schema: { type: string, examples: [BTC] }
        - name: limit
          in: query
          required: false
          schema: { type: integer, minimum: 1, default: 100 }
      responses:
        '200':
          description: Order book
          content:
            application/json:
              schema: { $ref: '#/components/schemas/OrderBook' }
        '400': { $ref: '#/components/responses/APIError' }
        '429': { $ref: '#/components/responses/RateLimitError' }
components:
  responses:
    APIError:
      description: API error
      content:
        application/json:
          schema: { $ref: '#/components/schemas/APIError' }
    RateLimitError:
      description: Rate limit or temporary ban; honor Retry-After
      headers:
        Retry-After:
          schema: { type: string }
      content:
        application/json:
          schema: { $ref: '#/components/schemas/RateLimitError' }
  schemas:
    Symbol:
      type: object
      additionalProperties: true
      properties:
        id: { type: integer }
        symbol: { type: string, examples: [BTC] }
        status: { type: string, examples: [TRADING] }
        baseAsset: { type: string, examples: [BTC] }
        quoteAsset: { type: string, examples: [USD] }
        name: { type: string, examples: [Bitcoin] }
        quantityScale: { type: integer }
        address: { type: string }
        url: { type: string, format: uri }
      required: [symbol]
    Ticker:
      type: object
      additionalProperties: true
      properties:
        symbol: { type: string, examples: [BTC] }
        lastUpdateId: { type: string }
        price: { type: string, examples: ['91201.73'] }
        bid: { type: string, examples: ['90928.07'] }
        ask: { type: string, examples: ['91475.39'] }
      required: [symbol, price]
    OrderBook:
      type: object
      additionalProperties: true
      properties:
        symbol: { type: string, examples: [BTC] }
        lastUpdateId: { type: string }
        bids:
          type: array
          items:
            type: array
            prefixItems: [{ type: string }, { type: string }]
            minItems: 2
            maxItems: 2
        asks:
          type: array
          items:
            type: array
            prefixItems: [{ type: string }, { type: string }]
            minItems: 2
            maxItems: 2
      required: [symbol, bids, asks]
    APIError:
      type: object
      properties:
        error: { type: string, examples: [Invalid symbol.] }
      required: [error]
    RateLimitError:
      type: object
      properties:
        error: { type: string }
        retryAfter: { type: string }
externalDocs:
  description: Quote.Trade API, agent, MCP, trading, withdrawal, and verification documentation
  url: https://quote.trade/for-agents
