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

# Quote an order

> Preview a buy/sell quote for a tokenized **equity** (Ondo, e.g. `TSLAon`).

Read-only price preview: returns the expected input/output amounts and a
system-recommended slippage tolerance to carry into `/order`. Equities only —
RWA yield tokens (Midas) have no quote step and are rejected with `422 Wrong
trade flow`; trade them via `/transact/buy` and `/transact/sell`.



## OpenAPI

````yaml /v2/combined_spec.json post /v2/tokenized_assets/quote
openapi: 3.1.0
info:
  title: Compass API
  description: Compass Labs DeFi API
  version: 0.0.1
servers:
  - url: https://api.compasslabs.ai
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /v2/tokenized_assets/quote:
    post:
      tags:
        - Tokenized Assets
      summary: Quote an order
      description: >-
        Preview a buy/sell quote for a tokenized **equity** (Ondo, e.g.
        `TSLAon`).


        Read-only price preview: returns the expected input/output amounts and a

        system-recommended slippage tolerance to carry into `/order`. Equities
        only —

        RWA yield tokens (Midas) have no quote step and are rejected with `422
        Wrong

        trade flow`; trade them via `/transact/buy` and `/transact/sell`.
      operationId: v2_tokenized_assets_quote
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenizedAssetsQuoteRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenizedAssetsQuoteResponse'
        '400':
          description: >-
            `Tokenized Assets Account not deployed` — the requesting `owner`
            does not have a Tokenized Assets Account on Ethereum mainnet. Call
            `POST /v2/tokenized_assets/create_account` first.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenizedAssetsErrorResponse'
        '404':
          description: '`Market not found.` — `from_token`/`to_token` is unsupported.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenizedAssetsErrorResponse'
        '409':
          description: >-
            `Insufficient liquidity` — no market maker could fill the trade. Try
            a different size or retry shortly.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenizedAssetsErrorResponse'
        '422':
          description: >-
            `Wrong trade flow` — an RWA yield token (mTBILL/mBASIS/mBTC) was
            passed to the equity quote endpoint. Quote/trade it via the swap
            endpoints (`/transact/buy`, `/transact/sell`) instead. (Standard
            input-validation 422s use FastAPI's `{detail: [...]}` shape.)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenizedAssetsErrorResponse'
        '502':
          description: >-
            `Swap service unavailable` — the swap service is temporarily
            unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenizedAssetsErrorResponse'
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from compass_api_sdk import CompassAPI


            with CompassAPI(
                api_key_auth="<YOUR_API_KEY_HERE>",
            ) as compass_api:

                res = compass_api.tokenized_assets.tokenized_assets_quote(from_token="<value>", to_token="<value>", amount="98.06", owner="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { CompassApiSDK } from "@compass-labs/api-sdk";

            const compassApiSDK = new CompassApiSDK({
              apiKeyAuth: "<YOUR_API_KEY_HERE>",
            });

            async function run() {
              const result = await compassApiSDK.tokenizedAssets.tokenizedAssetsQuote({
                fromToken: "<value>",
                toToken: "<value>",
                amount: "98.06",
                owner: "<value>",
              });

              console.log(result);
            }

            run();
components:
  schemas:
    TokenizedAssetsQuoteRequest:
      properties:
        from_token:
          type: string
          title: Token
          description: >-
            Token the sender is paying. Either an on-chain symbol (e.g.
            `TSLAon`), the literal `USDC`, or a 0x-prefixed token address.
          examples:
            - USDC
            - WETH
            - '0xA0b86a33E6441ccF30EE5DdEF1E9b652C91ac1c8'
        to_token:
          type: string
          title: Token
          description: Token the sender is receiving. Same accepted forms as `from_token`.
          examples:
            - USDC
            - WETH
            - '0xA0b86a33E6441ccF30EE5DdEF1E9b652C91ac1c8'
        amount:
          type: string
          title: Amount
          description: >-
            Human-readable amount of `from_token` to swap (decimal string).
            Decimals are applied server-side.
        owner:
          type: string
          title: Owner
          description: >-
            Wallet that owns the Tokenized Assets Account. Used to verify the
            account is deployed before quoting; the account address is derived
            deterministically from this owner.
      type: object
      required:
        - from_token
        - to_token
        - amount
        - owner
      title: TokenizedAssetsQuoteRequest
      description: >-
        Preview a buy or sell quote for a tokenized equity.


        Read-only: this previews a quote without consuming a ``quote_id`` or

        committing an order. Use it to surface expected output, fees, and a

        thin-liquidity warning before the user confirms; pass

        the same body (plus ``slippage_bps``) to ``POST
        /tokenized_assets/order``

        when they do.
      example:
        amount: '100'
        from_token: USDC
        owner: '0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B'
        to_token: TSLAon
    TokenizedAssetsQuoteResponse:
      properties:
        quote:
          $ref: '#/components/schemas/Quote'
          description: >-
            Preview of input/output amounts and fees. Identical shape to the
            `quote` block on `POST /tokenized_assets/order`.
        recommended_slippage_bps:
          type: integer
          title: Recommended Slippage Bps
          description: >-
            Slippage tolerance in basis points (1 bp = 0.01%) the UI should echo
            back as `slippage_bps` on `POST /tokenized_assets/order`. Derived
            from the on-chain auction range (`auctionEndAmount` vs
            `toTokenAmount`) plus a small buffer; capped at 5000 bps.
        auction_range_bps:
          type: integer
          title: Auction Range Bps
          description: >-
            Worst-case basis-points gap between the auction's end amount and the
            reference quote amount. Surfaces as a thin-liquidity warning before
            the user signs.
      type: object
      required:
        - quote
        - recommended_slippage_bps
        - auction_range_bps
      title: TokenizedAssetsQuoteResponse
      description: Preview of input/output amounts plus auction-derived risk hints.
      example:
        auction_range_bps: 50
        quote:
          est_fill_seconds: 180
          fee:
            amount_usd: '0.06'
            bps: 6
          input:
            amount: '100'
            amount_usd: '100.00'
            contract_address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
            symbol: USDC
          output:
            amount: '0.281678'
            amount_usd: '99.94'
            contract_address: '0xf6b1117ec07684D3958caD8BEb1b302bfD21103f'
            symbol: TSLAon
        recommended_slippage_bps: 100
    TokenizedAssetsErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: >-
            Short human-readable error label (e.g. `Market not found.`,
            `Insufficient liquidity`, `Order not found.`).
        message:
          type: string
          title: Message
          description: Human-readable explanation.
      type: object
      required:
        - error
        - message
      title: TokenizedAssetsErrorResponse
      description: >-
        Standard error envelope returned by every non-2xx response.


        Surfaced in OpenAPI ``responses`` declarations so SDK consumers can
        decode

        failures uniformly without inspecting per-status-code shapes.
    Quote:
      properties:
        input:
          $ref: '#/components/schemas/TokenAmount'
          description: Token the sender is paying.
        output:
          $ref: '#/components/schemas/TokenAmount'
          description: Token the sender is receiving.
        fee:
          $ref: '#/components/schemas/QuoteFee'
          description: Aggregate fee.
        est_fill_seconds:
          type: integer
          title: Est Fill Seconds
          description: Estimated upper bound on time-to-fill, in seconds.
      type: object
      required:
        - input
        - output
        - fee
        - est_fill_seconds
      title: Quote
      description: Quote preview returned alongside an order.
    TokenAmount:
      properties:
        symbol:
          type: string
          title: Symbol
          description: On-chain token symbol (e.g. `USDC`, `TSLAon`).
        contract_address:
          type: string
          title: Contract Address
          description: Ethereum mainnet ERC-20 address.
        amount:
          type: string
          title: Amount
          description: Human-readable amount as a decimal string.
        amount_usd:
          anyOf:
            - type: string
            - type: 'null'
          title: Amount Usd
          description: USD value of `amount`.
      type: object
      required:
        - symbol
        - contract_address
        - amount
      title: TokenAmount
      description: A token + amount pair for one leg of the quote.
    QuoteFee:
      properties:
        amount_usd:
          anyOf:
            - type: string
            - type: 'null'
          title: Amount Usd
          description: Total fee in USD as a decimal string.
        bps:
          anyOf:
            - type: integer
            - type: 'null'
          title: Bps
          description: Fee as basis points of the input amount.
      type: object
      title: QuoteFee
      description: Aggregate fee charged for the order.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your Compass API Key. Get your key
        [here](https://www.compasslabs.ai/dashboard).

````