Skip to main content

GET /leokit/quote

Get swap quotes from multiple protocols in a single request.

Request Parameters

Response Format

Status Code: 200 OK

Helper Fields (top-level on each quote)

The server adds these fields to every quote to simplify client-side sorting and filtering. They are computed once per response by the optimal-route ranker.

Quote Flags

Quotes are automatically tagged with performance indicators:
  • FASTEST - Lowest totalSwapSeconds
  • CHEAPEST - Lowest totalFeesUsd
  • OPTIMAL - Highest expectedAmountOutNum (tie-broken by fees, then speed)
  • BEST_OUTPUT - Highest output across all quotes (alias of OPTIMAL on the winning quote)

Fee Breakdown Examples

Each quote includes a detailed fee breakdown with the following structure:
Common Fee Types:
  • Affiliate Fee - Revenue sharing with integrators
  • Outbound Fee - Blockchain network fee for sending output
  • Network Fee - Protocol or router fee
  • Deposit Fee - Fee for depositing into protocol
  • Broadcast Fee - Fee for broadcasting transaction to destination chain

Error Responses

Missing Required Parameters (400)
No Quotes Available (404)
Internal Server Error (500)

GET /leokit/streaming-quotes

Stream quotes as Server-Sent Events (SSE) for real-time updates as protocols respond.

Request Parameters

Same as /leokit/quote endpoint.

Response Format

Content-Type: text/event-stream Event Stream:

Event Types

Stream Characteristics

  • Safety Timeout: 7 seconds maximum
  • Connection: Keep-alive with heartbeat
  • Cache-Control: no-cache
  • Client Disconnect: Gracefully handled, quote still logged to database

Error Event