Skip to main content
POST
Python (SDK)

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Body

application/json

Build a buy or sell order for a tokenized equity.

from_token
string
required

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
string
required

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

Examples:

"USDC"

"WETH"

"0xA0b86a33E6441ccF30EE5DdEF1E9b652C91ac1c8"

amount
string
required

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

owner
string
required

Wallet that owns the Tokenized Assets Account. The product account address is derived deterministically from this owner. The owner signs the EIP-712 payloads returned by this endpoint (the optional approval and the order itself).

slippage_bps
integer
default:50

Max acceptable slippage in basis points (1 bp = 0.01%). Range 1-5000 (0.01%-50%); defaults to 50 (0.5%). The upper bound is intentionally wide so callers can clear the wide auction floors quoted for thinly-traded tokenized stocks.

Required range: 1 <= x <= 5000

Response

Successful Response

Quote, optional approval payload, and the EIP-712 order to sign.

quote
Quote · object
required

Preview of input/output amounts and fees for the proposed order.

order
OrderToSign · object
required

Order metadata plus the EIP-712 payload to sign. The owner signs order.safe_message_eip712 and submits the resulting signature to /order/submit along with the rest of the order fields.

approval_safe_tx_eip712
BatchedSafeOperationsResponse · object | null

EIP-712 payload that authorizes a one-time max-approve of from_token to the settlement contract. Populated when the Tokenized Assets Account's existing allowance is below amount. The owner signs it, then it is broadcast via POST /v2/gas_sponsorship/prepare (or directly by the owner) to set the allowance on-chain. null when the allowance is already sufficient.

Example: