Build a trade for your wallet
build_tradeThe trade's transaction for your wallet to sign, as the coin's page builds it: { transaction, out, minOut }, the transaction base64 (unsigned, version 0, paid by your wallet). It changes nothing until your wallet signs it and it is sent. A coin paired with $SOUVENIR (get_coin's pair) trades in SOL the same way: one transaction swaps through $SOUVENIR, and keepsSouv, a little $SOUVENIR, stays in your wallet. pay: 'souvenir' trades it in $SOUVENIR you hold instead: the amount of a buy, and out and minOut of a sell, are then raw $SOUVENIR (6 decimals). Trading a coin, in order: (1) quote_trade to see what you would get; (2) build_trade with your wallet's address; (3) sign the transaction it answers with your wallet; (4) send_transaction, or send it yourself through any Solana RPC. No sign-in: your wallet's signature is the approval, and Souvenir never needs its private key. The same fees and limits as the coin's page on souvenir.finance. An agent helping a person, which can't sign with their wallet, uses request_trade instead and gives them the link to approve it with their own wallet.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"mint": "<mint>",
"side": "<side>",
"amount": "<amount>",
"wallet": "<wallet>"
},
"name": "build_trade"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pay | No | What a coin paired with $SOUVENIR is paid in (a sell: what it receives): sol, the default, or souvenir. Any other coin takes sol only. | |
| mint | Yes | The coin's mint address (base58). | |
| side | Yes | buy: spend SOL for the coin. sell: the coin for SOL. With pay souvenir, $SOUVENIR in place of SOL. | |
| amount | Yes | What you give, in whole units, as a string: lamports for a buy (1 SOL is 1000000000), the coin's raw units for a sell (Souvenir's and pump.fun's coins have 6 decimals: 1 coin is 1000000). With pay souvenir, a buy's is raw $SOUVENIR (6 decimals). | |
| wallet | Yes | Your Solana wallet's address (base58): it pays, signs and receives. | |
| slippageBps | No | The most the price may move against you before the trade refuses, in basis points (300 is 3%, the site's default). |