> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lean.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Quote a transfer

> What moving cash from one venue of this key’s trading account to the other would cost and deliver, the smallest amount the route accepts and what the sending venue holds. It needs only the read scope and creates nothing.



## OpenAPI

````yaml api-reference/openapi.json POST /transfers/quote
openapi: 3.0.0
info:
  title: Lean API
  version: 0.1.0
  description: >-
    Programmatic access to Lean: canonical sports markets, quotes, orders,
    positions and balances.
servers:
  - url: '{baseUrl}/v1'
    description: Lean API
    variables:
      baseUrl:
        default: https://api.lean.xyz
        description: >-
          The Lean API base URL, without /v1. Same value as LEAN_API_URL in the
          guides.
security:
  - apiKey: []
paths:
  /transfers/quote:
    post:
      tags:
        - Transfers
      summary: Quote a transfer
      description: >-
        What moving cash from one venue of this key’s trading account to the
        other would cost and deliver, the smallest amount the route accepts and
        what the sending venue holds. It needs only the read scope and creates
        nothing.
      operationId: quoteTransfer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                from_venue:
                  type: string
                  enum:
                    - polymarket
                    - hyperliquid
                  description: The venue the cash leaves.
                to_venue:
                  type: string
                  enum:
                    - polymarket
                    - hyperliquid
                  description: >-
                    The venue the cash arrives on, credited to this trading
                    account’s own balance there.
                amount_usd:
                  type: string
                  description: >-
                    How much leaves from_venue, in dollars, with at most 6
                    decimal places.
              required:
                - from_venue
                - to_venue
                - amount_usd
              additionalProperties: false
            example:
              from_venue: polymarket
              to_venue: hyperliquid
              amount_usd: '25'
      responses:
        '200':
          description: The quote
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      success:
                        type: boolean
                        enum:
                          - true
                      data:
                        type: object
                        properties:
                          from_venue:
                            type: string
                            enum:
                              - polymarket
                              - hyperliquid
                          to_venue:
                            type: string
                            enum:
                              - polymarket
                              - hyperliquid
                          amount_usd:
                            type: string
                            minLength: 1
                          fee_usd:
                            type: string
                            minLength: 1
                            description: What the move costs, taken out of amount_usd.
                          receive_usd:
                            type: string
                            minLength: 1
                            description: What arrives on to_venue.
                          minimum_usd:
                            type: string
                            minLength: 1
                            description: The smallest amount_usd this route accepts.
                          available_usd:
                            type: string
                            minLength: 1
                            description: What from_venue can send right now.
                          estimated_seconds:
                            type: integer
                            minimum: 0
                          expires_at:
                            type: string
                            format: date-time
                            description: >-
                              Until when a transfer created now can be
                              authorized.
                          warnings:
                            type: array
                            items:
                              type: object
                              properties:
                                code:
                                  type: string
                                  enum:
                                    - BELOW_VENUE_MINIMUM
                                    - INSUFFICIENT_FUNDS
                                message:
                                  type: string
                                  minLength: 1
                              required:
                                - code
                                - message
                            description: >-
                              Why POST /v1/transfers would refuse this amount on
                              this route: under minimum_usd or over
                              available_usd. Empty means the amount fits the
                              route; creating the transfer can still be refused
                              under the key's notional limits, allowed venues or
                              a placement block.
                          livemode:
                            type: boolean
                        required:
                          - from_venue
                          - to_venue
                          - amount_usd
                          - fee_usd
                          - receive_usd
                          - minimum_usd
                          - available_usd
                          - estimated_seconds
                          - expires_at
                          - warnings
                          - livemode
                      meta:
                        type: object
                        properties:
                          timestampMs:
                            type: integer
                            minimum: 0
                          requestId:
                            type: string
                            minLength: 1
                          traceId:
                            type: string
                            minLength: 1
                          cachedAtMs:
                            type: integer
                            minimum: 0
                          source:
                            type: string
                            enum:
                              - cache
                              - database
                              - clickhouse
                              - upstream
                              - fallback
                              - internal
                        required:
                          - timestampMs
                          - requestId
                    required:
                      - success
                      - data
                      - meta
                  - $ref: '#/components/schemas/ApiError'
              example:
                success: true
                data:
                  from_venue: polymarket
                  to_venue: hyperliquid
                  amount_usd: '25'
                  fee_usd: '0.1'
                  receive_usd: '24.9'
                  minimum_usd: '2'
                  available_usd: '10000'
                  estimated_seconds: 0
                  expires_at: '2026-11-11T15:02:00.000Z'
                  warnings: []
                  livemode: false
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
        '400':
          description: Same venue twice, an unknown venue or an invalid amount
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                success: false
                error:
                  code: VALIDATION_ERROR
                  message: Same venue twice, an unknown venue or an invalid amount
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
        '401':
          description: Missing, invalid, expired or revoked API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid, expired or revoked API key
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
        '403':
          description: The key lacks the read scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: This API key lacks the scope this route needs
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
        '429':
          description: API error
          headers:
            Retry-After:
              description: Seconds remaining in the upstream read cooldown, when available
              schema:
                type: integer
                minimum: 0
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                success: false
                error:
                  code: RATE_LIMITED
                  message: Too many requests for this API key
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
        '500':
          description: API error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                success: false
                error:
                  code: INTERNAL_ERROR
                  message: An internal error occurred.
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
        '503':
          description: >-
            FEATURE_DISABLED with details.reason LIVE_TRANSFERS_UNAVAILABLE for
            a live key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                success: false
                error:
                  code: FEATURE_DISABLED
                  message: A required service is temporarily unavailable.
                meta:
                  timestampMs: 1792771200000
                  requestId: 7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17
components:
  schemas:
    ApiError:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - VALIDATION_ERROR
                - NOT_FOUND
                - UNAUTHORIZED
                - FORBIDDEN
                - CONFLICT
                - UPSTREAM_ERROR
                - RATE_LIMITED
                - INTERNAL_ERROR
                - FEATURE_DISABLED
                - CONDITIONAL_SELL_REJECTED
                - CONDITIONAL_SELL_ACTIVE
            message:
              type: string
              minLength: 1
            details:
              nullable: true
          required:
            - code
            - message
        meta:
          type: object
          properties:
            timestampMs:
              type: integer
              minimum: 0
            requestId:
              type: string
              minLength: 1
            traceId:
              type: string
              minLength: 1
            cachedAtMs:
              type: integer
              minimum: 0
            source:
              type: string
              enum:
                - cache
                - database
                - clickhouse
                - upstream
                - fallback
                - internal
          required:
            - timestampMs
            - requestId
      required:
        - success
        - error
        - meta
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        A Lean API key, sent as `Authorization: Bearer <key>`. A test key
        (`lean_sk_test_...`) simulates orders and fills with no money; a live
        key (`lean_sk_live_...`) trades for real within the key's limits. Every
        successful response says which mode answered in `data.livemode`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.