Buy a token
trnch_buyBuild a buy in one call: quotes five routers and returns the best route as a transaction for the key's wallet to sign. Give token, and amountUsd (paid in USDC) or amountIn with tokenIn (the zero address pays in HYPE). 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). 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_buy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes | Token to buy, as an address. | |
| tokenIn | No | Token paid with amountIn. Default USDC. | |
| amountIn | No | Amount of tokenIn to spend, smallest unit. Use this or amountUsd. | |
| amountUsd | No | Amount to spend in US dollars, paid in USDC. Use this or amountIn. | |
| slippageBps | No | Max slippage in basis points (100 = 1%). Default 100. |