Sell a token
trnch_sellBuild a sell for USDC in one call: give token, and percent of the wallet balance (read on chain) or an exact amount. Quotes five routers and returns the best route as a transaction to sign. The Trnch fee is already deducted from the quote; the rate applied is returned as feeBps. Returns { router, feeBps, quote, approval, tx, chainId, from }: approval, when not null, has to be sent before tx, from the same wallet (chainId 99901). Nothing is sent by Trnch. Errors: 503 while the fee recipient is not configured on this chain (nothing is built), 404 no route, 429 rate or build limit (retry-after). A partner's integrator fee (integratorFeeBps, or the partner's default fee when the request carries X-Trnch-Partner-Key) is added to the Trnch fee and taken by the same router fee on every router; a router whose maximum fee is below the total is left out of the quote. The integrator fee is paid to the partner through the Trnch partner program after the swap is confirmed on chain. fees in the response: { side, token, trnch { bps, amount }, integrator { bps, amount, partner } or null, minAmountOut }, amounts in the smallest unit; minAmountOut is net of both fees and of slippage. Requires an API key (created by wallet signature), sent as Authorization: Bearer .
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": {
"token": "<token>"
},
"name": "trnch_sell"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes | Token to sell, as an address. | |
| amount | No | Exact amount in token units, e.g. 1234.5. Capped at the balance. Use this or percent. | |
| percent | No | Share of the wallet balance to sell, 100 = all. Use this or amount. | |
| slippageBps | No | Max slippage in basis points (100 = 1%). Default 100. | |
| integratorFeeBps | No | Integrator fee in basis points, 0 to 100, for a partner identified by X-Trnch-Partner-Key or by the partner ref of the API key. Overrides the partner's default fee; the default fee applies only with X-Trnch-Partner-Key, never through the partner ref of the API key alone. Without a partner, a value above 0 is refused. |