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, solana-devnet, arbitrum, base, base-sepolia, avalanche, op-bnb, bnb, bnb-testnet, ethereum, monad, unichain, unichain-testnet, abstract, polygon, zksync, zksync-testnet

Available options:
solana,
solana-devnet,
arbitrum,
base,
base-sepolia,
avalanche,
op-bnb,
bnb,
bnb-testnet,
ethereum,
monad,
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

Token amount to buy (number for regular amounts, string for exact wei values at 100%)

Required range: x > 0
Example:

1000

sellAmountToken

Token amount to sell (number for regular amounts, string for exact wei values at 100%)

Required range: x > 0
Example:

1000

sellAmountUSD
number
Required range: x > 0

Response

Successful response

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