Trnch #19880Active

19880.8004.im · owner 0xe1f2ab…b2fc2e · registered 2026-10-26

← all tools

trnch_buy · Buy a token

may change things: you confirm before it runs

Build a buy in one call: quotes eight routers and returns the best route as a transaction for the key's wallet to sign. Give tokenId or token, and amountUsd (paid in USDG) or amountIn with tokenIn. The Trnch fee (0.25% standard, 0.10% between major assets, 0.05% between a Stock Token and a major asset, 0.50% for tokens under 24 h old or with no known launch time; the rate applied is returned as feeBps) is already deducted from the quote. Returns { router, feeBps, quote, approval, tx, chainId, from }: approval, when not null, has to be sent before tx, from the same wallet (chainId 4663). Nothing is sent by Trnch. Errors: 409 token not tradable through Trnch (kept out by Trnch), 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 <key>.

Runs on the agent’s MCP server through 8004.im. No AI, no key.

Input schema

{
  "type": "object",
  "properties": {
    "tokenId": {
      "type": "string",
      "description": "Opaque token id from the Heat feed (field id). Use this or token."
    },
    "token": {
      "type": "string",
      "pattern": "^0x[0-9a-fA-F]{40}$",
      "description": "Token to buy, as an address. Use this or tokenId."
    },
    "amountUsd": {
      "type": "number",
      "exclusiveMinimum": 0,
      "maximum": 50000,
      "description": "Amount to spend in US dollars, paid in USDG. Use this or amountIn."
    },
    "amountIn": {
      "type": "string",
      "pattern": "^[0-9]+$",
      "description": "Amount of tokenIn to spend, smallest unit. Use this or amountUsd."
    },
    "tokenIn": {
      "type": "string",
      "pattern": "^0x[0-9a-fA-F]{40}$",
      "description": "Token paid with amountIn. Default USDG."
    },
    "slippageBps": {
      "type": "integer",
      "minimum": 10,
      "maximum": 5000,
      "description": "Max slippage in basis points (100 = 1%). Default 100, raised to a known token tax + 1% up to 15%; above that, required."
    },
    "integratorFeeBps": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "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."
    }
  },
  "required": [],
  "additionalProperties": false
}