Trades are signed by your connected wallet. The API prepares and initiates the transaction, but your wallet must approve it before it is broadcast to the network. If you have configured a delegated signing key in your Big Brain Ape account, approval happens automatically without a manual wallet confirmation step.
POST /trades
Initiate a token swap on a supported network. The API returns a trade object immediately with apending status. Poll GET /trades/{id} or subscribe to webhook events to track confirmation.
Required scope: trade
Request Body
string
required
The input token you want to sell. Accepts a ticker symbol (e.g.
SOL) or a full contract address.string
required
The output token you want to receive. Accepts a ticker symbol (e.g.
USDC) or a full contract address.string
required
The amount of
tokenIn to spend, expressed as a string to preserve decimal precision (e.g. "1.5").number
default:"0.5"
Maximum acceptable slippage tolerance as a percentage. If the price moves beyond this threshold before the transaction is executed, the swap is cancelled. Defaults to
0.5.string
required
The blockchain network on which to execute the swap. Accepted values:
solana, ethereum, base, arbitrum.Example Request
Example Response
Response Fields
string
Unique identifier for this trade. Use this ID with
GET /trades/{id} to track status.string
Current status of the trade. Possible values:
pending, confirmed, failed.string
The token being sold.
string
The token being received.
string
The exact amount of
tokenIn submitted.string
The estimated amount of
tokenOut you will receive, based on current market prices and your slippage setting.string
The platform fee deducted from the swap, denominated in
tokenOut. Big Brain Ape charges a flat 0.25% fee on every trade, calculated against the output amount.string
The network on which the swap is being executed.
GET /trades
Retrieve a paginated list of your trade history. Filter results by token, status, network, or date range to narrow down exactly the trades you need. Required scope:read
Query Parameters
string
Filter trades involving a specific token symbol or contract address (matches either
tokenIn or tokenOut).string
Filter by trade status. Accepted values:
pending, confirmed, failed.string
Filter by blockchain network. Accepted values:
solana, ethereum, base, arbitrum.string
Return trades submitted on or after this date. Accepts an ISO 8601 date string (e.g.
2024-01-01T00:00:00Z).string
Return trades submitted on or before this date. Accepts an ISO 8601 date string.
number
default:"20"
Maximum number of trades to return per page. Defaults to
20, maximum 100.number
default:"0"
Number of records to skip before returning results. Use with
limit to paginate through large histories.Example Request
Example Response
Response Fields
number
The total number of trades in your history that match the applied filters.
number
The maximum number of records returned in this page, as requested.
number
The number of records skipped before this page of results.
array
Ordered list of trade objects, from most recent to oldest.
GET /trades/
Fetch the full details of a single trade by its ID. This endpoint returns the most up-to-date status, the on-chain transaction hash once confirmed, and precise timestamps for each stage of the trade lifecycle. Required scope:read
Path Parameters
string
required
The unique trade ID returned by
POST /trades (e.g. trade_abc123).Example Request
Example Response
Response Fields
string
The unique trade identifier.
string
Final or current status:
pending, confirmed, or failed.string
The actual amount of
tokenOut received after the swap settled on-chain. Only present when status is confirmed.string
The amount estimated at the time the trade was submitted.
string
The on-chain transaction hash. Only present once the trade has been broadcast to the network.
string
The wallet address that signed and submitted the transaction.
string
ISO 8601 timestamp for when the trade was created via the API.
string
ISO 8601 timestamp for when the signed transaction was broadcast to the network.
string
ISO 8601 timestamp for when the transaction received on-chain confirmation.
null if not yet confirmed.