Skip to main content
POST
Trade tokens (buy or sell)

Authorizations

Authorization
string
header
required

JWT token or API key

Body

application/json
tokenId
string<uuid>
required
chainSlug
enum<string>
required

Blockchain identifier. Supported chains: solana-devnet, base, base-sepolia, avalanche, bnb, bnb-testnet, unichain, unichain-testnet, abstract, polygon, zkSync, zkSync-testnet

Available options:
solana-devnet,
base,
base-sepolia,
avalanche,
bnb,
bnb-testnet,
unichain,
unichain-testnet,
abstract,
polygon,
zkSync,
zkSync-testnet
Example:

"base-sepolia"

direction
enum<string>
required
Available options:
buy,
sell
userAddress
string

User wallet address (optional - if not provided, will use user's Privy wallet from user_wallets table)

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"

builder
object

Builder attribution information (optional). Includes address and fee in bps.

token_referral
string

Token referral address for attribution (optional - defaults to zero address). Used to attribute referral fees to a specific address.

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"

buyAmountUSD
number
Required range: x > 0
buyAmountToken
number
Required range: x > 0
sellAmountToken
number
Required range: x > 0
sellAmountUSD
number
Required range: x > 0

Response

Successful response

success
enum<boolean>
required
Available options:
true
transaction
object
required