Skip to main content
POST
/
v2
/
tokenized_assets
/
order
Python (SDK)
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_order(from_token="<value>", to_token="<value>", amount="578.28", owner="<value>", slippage_bps=50)

    # Handle response
    print(res)
{
  "approval_safe_tx_eip712": {
    "domain": {
      "chainId": 1,
      "verifyingContract": "0x2ed5C9c14E1F8baA94CD3e9b5b6e3F8e3D27504F"
    },
    "message": {
      "baseGas": "0",
      "data": "0x095ea7b3000000000000000000000000111111125421ca6dc452d289314280a0f8842a65ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
      "gasPrice": "0",
      "gasToken": "0x0000000000000000000000000000000000000000",
      "nonce": "0",
      "operation": 0,
      "refundReceiver": "0x0000000000000000000000000000000000000000",
      "safeTxGas": "0",
      "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "value": "0"
    },
    "primaryType": "SafeTx",
    "types": {
      "EIP712Domain": [
        {
          "name": "chainId",
          "type": "uint256"
        },
        {
          "name": "verifyingContract",
          "type": "address"
        }
      ],
      "SafeTx": [
        {
          "name": "to",
          "type": "address"
        },
        {
          "name": "value",
          "type": "uint256"
        },
        {
          "name": "data",
          "type": "bytes"
        },
        {
          "name": "operation",
          "type": "uint8"
        },
        {
          "name": "safeTxGas",
          "type": "uint256"
        },
        {
          "name": "baseGas",
          "type": "uint256"
        },
        {
          "name": "gasPrice",
          "type": "uint256"
        },
        {
          "name": "gasToken",
          "type": "address"
        },
        {
          "name": "refundReceiver",
          "type": "address"
        },
        {
          "name": "nonce",
          "type": "uint256"
        }
      ]
    }
  },
  "order": {
    "extension": "0x000000a4000000a4000000a40000005200000000",
    "order_hash": "0x14459af3a06abf6f7a0d3c2c1fa3b64d2e1b8a7c5e3d2b1f0a9876543210596b",
    "order_message": {
      "maker": "0x2ed5C9c14E1F8baA94CD3e9b5b6e3F8e3D27504F",
      "makerAsset": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "makerTraits": "0",
      "makingAmount": "100000000",
      "receiver": "0x399740157391a9f1bf4e9921a8834f9bc8f2678e",
      "salt": "102030405060708090",
      "takerAsset": "0xf6b1117ec07684D3958caD8BEb1b302bfD21103f",
      "takingAmount": "281678000000000000"
    },
    "quote_id": "9afa6d80-9216-4bcd-b762-87151f9dae51",
    "safe_message_eip712": {
      "domain": {
        "chainId": 1,
        "verifyingContract": "0x2ed5C9c14E1F8baA94CD3e9b5b6e3F8e3D27504F"
      },
      "message": {
        "message": "0x14459af3a06abf6f7a0d3c2c1fa3b64d2e1b8a7c5e3d2b1f0a9876543210596b"
      },
      "primaryType": "SafeMessage",
      "types": {
        "EIP712Domain": [
          {
            "name": "chainId",
            "type": "uint256"
          },
          {
            "name": "verifyingContract",
            "type": "address"
          }
        ],
        "SafeMessage": [
          {
            "name": "message",
            "type": "bytes"
          }
        ]
      }
    }
  },
  "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"
    }
  }
}

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.

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Body

application/json

Build a buy/sell order against the 1inch Fusion intent flow.

from_token
string
required

Token the sender is paying. Either an on-chain Ondo symbol (e.g. TSLAon), the literal USDC, or a 0x-prefixed Ethereum address.

to_token
string
required

Token the sender is receiving. Same accepted forms as from_token.

amount
string
required

Human-readable amount of from_token to swap (decimal string). Decimals are applied server-side.

owner
string
required

EOA that owns the Tokenized Assets Account. Determines the product account address and signs the EIP-712 envelopes returned by this endpoint (the approve SafeTx and the SafeMessage wrapping the order hash).

slippage_bps
integer
default:50

Max acceptable slippage in basis points (1 bp = 0.01%).

Required range: 1 <= x <= 1000

Response

Successful Response

Composed response: quote + optional approval SafeTx + EIP-712 order to sign.

quote
Quote · object
required

Quote preview.

order
OrderToSign · object
required

Order metadata plus the SafeMessage EIP-712 to sign. The owner signs order.safe_message_eip712 and POSTs the resulting 65-byte ECDSA to /order/submit along with the rest of the order fields.

approval_safe_tx_eip712
BatchedSafeOperationsResponse · object

EIP-712 Safe.execTransaction wrapping USDC.approve(LOP_v4, max_uint256). Populated when the Tokenized Assets Account's allowance to LOP v4 is below amount; sign with wallet.signTypedData(...) and relay via POST /v2/gas_sponsorship/prepare. null when allowance is already sufficient.

Example:
{
"domain": {
"chainId": 8453,
"verifyingContract": "0x6B90E8B4E3E971E74C1A47a3a20976377E2dB4b1"
},
"message": {
"baseGas": "0",
"data": "0x8d80ff0a0000000000000000000000000000000000000000000000000000000000000020",
"gasPrice": "0",
"gasToken": "0x0000000000000000000000000000000000000000",
"nonce": "7",
"operation": 1,
"refundReceiver": "0x0000000000000000000000000000000000000000",
"safeTxGas": "0",
"to": "0x93C23AAE4793C14D6DF35D2A2A2234204e1559dA",
"value": "0"
},
"primaryType": "SafeTx",
"types": {
"EIP712Domain": [
{ "name": "chainId", "type": "uint256" },
{
"name": "verifyingContract",
"type": "address"
}
],
"SafeTx": [
{ "name": "to", "type": "address" },
{ "name": "value", "type": "uint256" },
{ "name": "data", "type": "bytes" },
{ "name": "operation", "type": "uint8" },
{ "name": "safeTxGas", "type": "uint256" },
{ "name": "baseGas", "type": "uint256" },
{ "name": "gasPrice", "type": "uint256" },
{ "name": "gasToken", "type": "address" },
{
"name": "refundReceiver",
"type": "address"
},
{ "name": "nonce", "type": "uint256" }
]
}
}