BTB Finance for agents

Docs

Connect your agent

BTB is a remote MCP server over Streamable HTTP. No sign-up and no API key: point your client at the URL below. It works in Claude, ChatGPT, Grok, Gemini, Perplexity, Le Chat and any MCP client. Prefer plain HTTP? See the REST API; building an agent with its own wallet? See autonomous agents.

https://btb.finance/api/mcp

Claude (web and desktop)

Settings → Connectors → Add custom connector, name it BTB and paste the URL above.

Claude Code

claude mcp add --transport http btb https://btb.finance/api/mcp

ChatGPT, Grok, Gemini, Perplexity, Le Chat

ChatGPT: + → Plugins → Add custom MCP server (paid plans). Grok: grok.com/connectors → Add a custom connector. Gemini web app: add a custom app by its MCP URL (where available). Perplexity: Connectors → Add MCP connector. Le Chat: Connectors → Custom MCP Connector. Paste the URL above; no sign-in needed.

Cursor, Windsurf and other MCP clients

Add this to the client’s MCP config file (the key name varies slightly between clients):

{ "mcpServers": { "btb": { "type": "http", "url": "https://btb.finance/api/mcp" } } }

Your own agent (plain HTTP)

Any MCP SDK works. Or call it directly with JSON-RPC:

curl -s https://btb.finance/api/mcp \ -H 'content-type: application/json' \ -H 'accept: application/json, text/event-stream' \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call", "params":{"name":"top_pools","arguments":{"chain":"base","limit":5}}}'

REST API

Every tool is also plain JSON over HTTP at https://btb.finance/api/v1, with the same answers as the MCP server. The OpenAPI spec at https://btb.finance/api/v1/openapi.json works with SDK generators and function-calling agents. Any tool can also be called by name: POST /api/v1/tools/<name> with its arguments as the body.

curl -s 'https://btb.finance/api/v1/yield?token=USDC&chain=base&limit=5' curl -s 'https://btb.finance/api/v1/pools?chain=base&maxRisk=B&limit=5' curl -s -X POST https://btb.finance/api/v1/build/swap \ -H 'content-type: application/json' \ -H 'authorization: Bearer <your key>' \ -d '{"chain":"base","tokenIn":"ETH","amount":"0.1", "tokenOut":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "wallet":"0xYourWallet"}'

Keys and limits

No key needed for 20 calls a minute per IP. A free key gives 120 a minute: create one below, keep it (it is shown once), and send it as Authorization: Bearer <key> or X-API-Key. Every answer carries X-RateLimit-Remaining; a 429 says when to retry. GET /api/v1/keys/me shows your usage.

curl -s -X POST https://btb.finance/api/v1/keys \ -H 'content-type: application/json' \ -d '{"name":"my-agent","contact":"[email protected]"}'

How a transaction works

  1. The agent calls a build tool: build_swap, build_lend, build_withdraw, build_zap_liquidity, build_add_liquidity or build_tx (any contract; pass steps for approve plus action), with the wallet that will sign.
  2. BTB returns numbered steps: approvals first (exact amounts only), then the action, each with to, data, value and chainId, a dry run, warnings, and a signLink.
  3. Then either a person signs, or the agent does (below).

A person signs (chat assistants)

Chat assistants (Claude, ChatGPT, Grok, Gemini) have no wallet, by design. They give the person the signLink: it opens btb.finance with the steps to sign in their own wallet, in order. Links are sealed by BTB (an edited link is refused), last 15 minutes and only sign from the wallet they were built for. Afterwards the assistant calls sign_status with the link: each signed step, checked on chain, with the tokens that moved. No need to ask the person for hashes.

The agent signs (autonomous agents)

An agent with its own wallet, running with no human present, signs and sends the steps itself. BTB never sees the key. Give the agent a wallet of its own that holds only what it may spend: a plain key on its server is simplest; a wallet service (Coinbase CDP / AgentKit, Privy or Turnkey server wallets) adds spending limits and allowlists; a smart wallet with limited permissions (a Safe module, or session keys) lets a user grant narrow rights, such as these contracts, up to this amount a day, until this date.

import { createWalletClient, createPublicClient, http } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; import { base } from 'viem/chains'; const API = 'https://btb.finance/api/v1'; // A wallet only for the agent, holding only what it may spend. Never your main wallet. const account = privateKeyToAccount(process.env.AGENT_KEY as `0x${string}`); const wallet = createWalletClient({ account, chain: base, transport: http() }); const chain = createPublicClient({ chain: base, transport: http() }); async function call(path: string, body: object) { const r = await fetch(API + path, { method: 'POST', headers: { 'content-type': 'application/json', authorization: 'Bearer ' + process.env.BTB_KEY }, body: JSON.stringify(body), }); if (!r.ok) throw new Error((await r.json()).error.message); return r.json(); } // 1. Build: lend 100 USDC on Aave on Base (approval only if needed, then the supply). const plan = await call('/build/lend', { chain: 'base', token: 'USDC', amount: '100', wallet: account.address }); // 2. Check: stop on a failed dry run (a later step may wait for an earlier approval) or any warning you do not accept. if (plan.simulation.status === 'reverted') throw new Error('dry run failed: ' + plan.simulation.reason); if (plan.warnings?.length) console.warn(plan.warnings); // 3. Sign and send each step in order, waiting for each to confirm. for (const tx of plan.transactions) { const hash = await wallet.sendTransaction({ to: tx.to, data: tx.data, value: BigInt(tx.value) }); const receipt = await chain.waitForTransactionReceipt({ hash }); if (receipt.status !== 'success') throw new Error('step ' + tx.step + ' failed: ' + hash); } // 4. Confirm what moved (any hash): GET /api/v1/tx/base/<hash>

Fees and limits

Tool reference

44 tools, read live from the server. Click a name to try it in the playground.

Yield, lending & staking

lending_rates read

Live supply APYs for lending a token on Aave, Compound, Morpho, Spark, Euler, Fluid, Moonwell, Venus and more, per chain, best first, with TVL and the 30-day average. Filter by token (symbol or address, "stable" for all stablecoins), chain and protocol. Use it for "where do I earn most on my USDC" and before suggesting any lending; never guess a rate.

  • token: Symbol or address, e.g. "USDC", "ETH", or "stable".
  • chain: Chain name or id. Omit for all chains.
  • protocol: e.g. "aave", "morpho", "compound".
  • minTvlUsd: Skip smaller markets. Default 1000000.
  • limit: Default 15.

staking_rates read

What ETH earns staked through each liquid-staking token (Lido stETH/wstETH, ether.fi weETH, Rocket Pool rETH, Coinbase cbETH, Binance wBETH, Kelp, Renzo...), best first, with TVL and the 30-day average. Use it for "where do I get the best staking APR" and to add the staking yield to pools that hold these tokens.

  • token: Only this token or protocol, e.g. "wstETH", "rETH", "lido".

compare_yield read

Every place to earn on a token, side by side, from BTB's own index: lending (Aave V3 read from its contracts, Compound, Fluid, Euler, Spark, Moonwell, Venus), Morpho vaults (only listed ones, with address and curator), savings, ETH staking and stable-pair liquidity pools. Ranked by base yield, with rewards apart, 1-day/7-day/30-day rates, a stability flag, TVL, the contract to deposit into and the tool that builds the deposit. Prefer it over lending_rates.

  • token required: Symbol or address, e.g. "USDC", "ETH" (includes staking), "WBTC".
  • chain: Chain name or id. Omit for all chains.
  • kinds: Only these kinds. "lp" also includes pools with a volatile partner.
  • minTvlUsd: Default 1000000.
  • stableOnly: Only rates that held steady.
  • limit: Default 15.

Pools & research

top_pools read

Rank live liquidity pools by APR, TVL, 24h volume or 24h fees, filtered by chain, risk grade, TVL and stable pairs. Returns each pool with its risk grade and a btb.finance link.

  • chain: Chain name or id, e.g. "base", "ethereum", "bnb", "robinhood", 8453. Omit for all chains.
  • maxRisk: Worst risk grade to include (A safest). Default: all.
  • minTvlUsd: Minimum TVL in USD. Default 100000.
  • stableOnly: Only pairs of two stablecoins.
  • sortBy: Default apr.
  • limit: Default 10.

search_pools read

Find pools by token symbols ("ETH USDC"), a token address, or a DEX name ("aerodrome"). Sorted by TVL.

  • query required
  • chain: Chain name or id, e.g. "base", "ethereum", "bnb", "robinhood", 8453. Omit for all chains.
  • limit: Default 10.

pool_details read

Everything about one pool: TVL, APRs (measured range APR, base, rewards), volume, fees, in-range share, result against holding, both tokens' safety scans, the risk grade with each deduction, and the btb.finance link.

  • chain: Chain of the pool (not needed when pool is a key like "base:0x…").
  • pool required: The pool: its key from another tool ("base:0x…") or its address / Uniswap V4 pool id.

compare_pools read

Compare 2 to 6 pools side by side (APR, TVL, fees, risk with reasons, stable or not) and say which leads on each measure.

  • pools required: Pool keys, e.g. ["base:0x…", "ethereum:0x…"].

best_pools_for read

The highest-APR pools that can take a position of this size without it being more than 2 % of the pool (TVL at least 50× the amount).

  • amountUsd required
  • chain: Chain name or id, e.g. "base", "ethereum", "bnb", "robinhood", 8453. Omit for all chains.
  • maxRisk: Worst risk grade to include (A safest). Default: all.
  • stableOnly
  • limit: Default 5.

chain_summary read

Per chain: pool count, total TVL, median APR and TVL-weighted APR (all pools, and stable pairs only).

  • chain: Chain name or id, e.g. "base", "ethereum", "bnb", "robinhood", 8453. Omit for all chains.

estimate_lp_earnings read

What an amount in one pool might earn over a number of days, from its APR and from its last 24 hours of fees, with the caveats.

  • chain: Chain of the pool (not needed when pool is a key like "base:0x…").
  • pool required: The pool: its key from another tool ("base:0x…") or its address / Uniswap V4 pool id.
  • amountUsd required
  • days: Default 30.

lp_plan read

Split an amount across several pools on different pairs (at most one pool per pair, no more than 2 % of any pool), within a risk limit, with expected yearly earnings and the cost of auto-management. A starting point for the user to review, not advice.

  • amountUsd required
  • chain: Chain name or id, e.g. "base", "ethereum", "bnb", "robinhood", 8453. Omit for all chains.
  • maxRisk: Worst risk grade to include. Default B.
  • stableOnly
  • pools: How many pools to spread across. Default 3.

token_balance read

One wallet's balance of one token on one chain, in a single read (well under a second): token is "native" for the gas coin, a symbol (USDC, WETH, BTB) or a contract address. With the USD value when the price is known.

  • wallet required
  • chain required: Chain name or id, e.g. base, ethereum, 42161.
  • token required: "native", a symbol or a contract address.

wallet_overview read

Start here when someone asks about their portfolio (EVM or Solana address). One call: net worth across BTB's protocols (about 36 chains), liquidity pools and the wallet's own tokens, each counted once; warnings that need attention (Aave health factor low, pools out of range); and opportunities (idle stablecoins earning nothing, vaults well below the best rate on their chain), each with the yearly gain (on 7-day average rates, only into markets big enough to take the amount) and the exact build tool calls to act. Includes a one-line headline to show the person. Public on-chain data, read-only. Takes about 5 to 25 seconds.

  • wallet required: An EVM address (0x...) or a Solana address.
  • idleMinUsd: Smallest idle stablecoin balance worth suggesting a move for. Default 5.

wallet_portfolio read

What a wallet holds across the protocols BTB supports, on every EVM chain they run on (about 36), or on Solana for a Solana address (SOL, tokens, Jupiter, Meteora, STKESOL, Pump coins and Pump creator fees to claim): Aave supplied and borrowed with the health factor, Morpho and other vault shares with the underlying, liquid staking and restaking (Lido, Rocket Pool, Renzo, Origin, StakeStone), Ethena, Sky, Usual, Maple, Falcon, Inverse, Olympus and more, stablecoins and protocol tokens. Grouped by protocol with USD values, totals by kind, and which chains were scanned. LP positions are in wallet_positions. Public on-chain data, read-only; cached a minute.

  • wallet required: An EVM address (0x...) or a Solana address.
  • chains: Optional comma-separated chains to limit the scan, e.g. "base,ethereum". Default: every chain.

Tokens & prices

token_safety read

The newest btb.finance safety scan of a token (score 0-100, honeypot, taxes, owner powers), if one ran in the last 24 hours, else a link to run one.

  • chain required: Chain name or id.
  • token required: Token address.

find_token read

A token's contract address on one chain, by symbol, name or address, with decimals and USD price: first the swap catalog btb.finance uses (verified tokens first), then any token trading on a DEX (most liquid first). Use it before quoting, swapping or reading a balance; never write a token address from memory. "ETH" is the native coin.

  • query required: Symbol, name or address, e.g. "USDC", "ezETH", "PONS".
  • chain: Chain name or id, e.g. "base", "ethereum", "bnb", "robinhood", 8453. Omit to search every main chain at once.

quote_swap read

A live quote at the best KyberSwap route, after the 1% BTB fee: what an amount of one token gets of another, both sides in USD, rate, price impact, gas, and a warning when the pool is thin for the size. Read-only; use build_swap to get the transactions, or give the swapLink to a person.

  • chain required: Chain name or id.
  • tokenIn required: Token sold: address from find_token, or "ETH" for the native coin.
  • tokenOut required: Token bought: address, or "ETH".
  • amount required: Amount of tokenIn in whole units, e.g. "1" or "0.25".

quick_token_check read

A free basic safety check of any token (GoPlus): honeypot, buy and sell tax, owner can mint or change balances, blacklist, pausable transfers, proxy, verified source, holders. Use it when token_safety has no recent scan; it is not as deep as a btb.finance scan.

  • chain required: Chain name or id.
  • token required: Token address.

Wallets & positions

wallet_positions read

Every LP position a wallet holds on Ethereum, Base, BNB Chain, Robinhood Chain and Arc (Uniswap V3/V4, PancakeSwap, Aerodrome, Aero, Giga, Ramses, UP, SushiSwap, Alandale), including the ones in its BTB smart wallets: pair, amounts, USD value, in range or not, price range, uncollected fees, staking, auto-management, and PnL when available. Public on-chain data, read-only. Takes up to about 20 seconds.

  • address required: The wallet address.
  • chain: Only this chain (faster). Omit for all five.

auto_manage_status read

The LP positions a wallet has under BTB auto-management (automatic range resets and fee compounding): status, last in-range check, rebalances, costs and BTB balance. Read-only, public data.

  • address required: The owner wallet address.

auto_manage_setup read

How BTB auto-management works, what it costs on each chain, and the link where the user turns it on for a position with their own wallet.

  • chain: Chain name or id, e.g. "base", "ethereum", "bnb", "robinhood", 8453. Omit for all chains.

wallet_tokens read

The tokens a wallet holds, read from chain now, on Ethereum, Base, BNB Chain, Arbitrum, Optimism, Polygon, Unichain and Robinhood Chain (or one chain), with USD values, newest-listed tokens included. Pass search (a symbol, name or address) to find one token across chains, e.g. before "sell all my X". Public data, read-only. Takes up to about 15 seconds.

  • wallet required: The wallet address.
  • chain: Only this chain (faster).
  • search: Only this token: symbol, name or address.
  • minUsd: Hide holdings worth less than this. Default 0.

tx_status read

Whether a transaction confirmed or failed, its fee, and the tokens that moved in and out of the sending wallet. Use it after a person signs (they can paste the hash, or the sign page shows it).

  • chain required: Chain name or id.
  • hash required: Transaction hash.

Build transactions

build_lend builds tx

Lend a token on Aave V3, or Aave V4 with protocol "aave-v4" (the Core markets on ethereum and avalanche): the exact approval only if needed, then the supply, as ONE signLink for the person, with the live supply APY, what the amount earns a year, the wallet's health factor (V3) and a dry run. Use this, not build_tx, for Aave deposits.

  • chain required: Chain name or id: ethereum, base, arbitrum, optimism, polygon, avalanche, bnb.
  • token required: Symbol or address, e.g. "USDC", "WETH". Aave takes the wrapped coin, not native ETH.
  • wallet required: The wallet that lends and signs.
  • amount required: Whole units, e.g. "10", or "max" for the whole balance.
  • protocol: Default aave-v3. aave-v4 lends in Aave V4's Core market (ethereum, avalanche).

build_withdraw builds tx

Take a lent token back from Aave V3, as a signLink for the person: how much is supplied, how much can be withdrawn right now, the health factor (if the wallet borrows) and a dry run. amount "max" takes everything including interest.

  • chain required: Chain name or id: ethereum, base, arbitrum, optimism, polygon, avalanche, bnb.
  • token required: Symbol or address, e.g. "USDC", "WETH". Aave takes the wrapped coin, not native ETH.
  • wallet required: The wallet that lends and signs.
  • amount required: Whole units, or "max" for all of it.

build_zap_liquidity builds tx

Open a concentrated-liquidity position using only ONE of the pool's tokens: swaps the right share into the other token at the best price, then deposits both for the chosen range, as ONE signLink (swap, approvals, deposit). A small safety margin of the other token is left in the wallet. Same pools as build_add_liquidity (Uniswap V3, PancakeSwap V3, Aerodrome Slipstream and the V3 forks btb.finance supports).

  • chain: Chain of the pool (not needed when pool is a key like "base:0x…").
  • pool required: The pool: its key from another tool ("base:0x…") or its address / Uniswap V4 pool id.
  • token required: The one token you have: the pool token's symbol or address (wrapped symbol for ETH, e.g. WETH).
  • amount required: How much of it to put in, in whole units.
  • wallet required: The wallet that signs.
  • rangePct: Half-width of the range in %, e.g. 5. null = full range. Default 5.
  • slippageBps

sign_status read

After giving a person a btb.finance/sign link: which steps they have signed and whether each confirmed on chain, with the hashes and the tokens that moved. Each reported hash is checked on chain (sent from the link's wallet, to the step's contract). Call it when they say they are done, instead of asking for hashes.

  • signLink required: The signLink a build tool returned.

build_pump_claim builds tx

For a Pump coin creator's Solana wallet: one unsigned transaction that claims every creator fee waiting for it, from the bonding curve and from PumpSwap (unwrapped to SOL), with the amount, a dry run on Solana, and the transaction to sign. Free: BTB takes no fee on claims. The transaction expires about a minute after it is built. wallet_portfolio shows the fees before claiming.

  • wallet required: The creator's Solana address.

build_pump_launch builds tx

Launch a new coin on Pump (Solana) from the creator's wallet: one transaction that creates the coin, sets the creator-fee split (BTB keeps a share of creator fees on coins launched through BTB; the creator gets the rest), and optionally makes the creator's first buy in the same transaction so nobody can buy before them. Returns the new mint address, the split, a dry run on Solana and the transaction, already signed by the new coin's mint key; the creator's wallet signs as fee payer and must send it within about a minute without changing the blockhash. Send the coin's picture (imageUrl or imageBase64), description and optional links, and BTB pins them to IPFS; or pass metadataUri if you host it yourself. No picture to send (for example one drawn in the chat, which a tool call cannot carry)? Leave it out and BTB makes a simple logo from the ticker. Cost: about 0.02 to 0.03 SOL plus the first buy. Most new coins lose almost all their value.

  • wallet required: The creator's Solana address: pays, signs and receives the creator's fee share.
  • name required: Coin name, up to 32 characters.
  • symbol required: Ticker, up to 10 characters, without the $.
  • description: What the coin is about, shown on Pump.
  • imageUrl: https or ipfs link to the coin's picture.
  • imageBase64: Or the picture itself: PNG, JPEG, GIF or WebP, up to 1000 KB, base64 (a data: URL works).
  • twitter: Optional https link.
  • telegram: Optional https link.
  • website: Optional https link.
  • metadataUri: Only if you host the metadata JSON yourself (https or ipfs). Otherwise leave it out and BTB pins it from the fields above.
  • devBuySol: SOL to spend on the creator's first buy, in the same transaction. Default 0.

build_token_launch builds tx

Launch a new coin from the creator's wallet on an EVM launchpad, with BTB's share of fees built in where the launchpad allows it. launchpad: clanker (Base, BNB Chain, Robinhood Chain or Monad; Uniswap v4 pool with a 1-10% buy/sell tax; BTB is the integrator and keeps a share of the creator's part of the tax; claim with build_launch_claim), zora (Base; 1% pool fee, creator 0.5% of each trade, BTB 0.2% as platform referrer, paid automatically), pons (Robinhood Chain bonding curve, 0.0005 ETH launch fee, optional extra creator tax up to 10%; Pons pays creator fees to one address so BTB takes no share; optional first buy in the same transaction), flap (BNB Chain bonding curve tax token, 1-10% tax paid to the creator; BTB is the commission receiver; optional first buy). Send the picture (imageUrl or imageBase64), description and links; BTB pins them. No picture to send (for example one drawn in the chat, which a tool call cannot carry)? Leave both out and BTB makes a simple logo from the ticker. Returns the coin address, the fee split, a dry run, the transaction and a sign link. Pump on Solana is build_pump_launch. Most new coins lose almost all their value.

  • wallet required: The creator's EVM address: pays, signs and receives the creator's fees.
  • launchpad required
  • chain: Clanker only: base (default), bsc, robinhood or monad. The others have one chain each.
  • name required
  • symbol required: Ticker without the $.
  • description
  • imageUrl: https or ipfs link to the coin's picture.
  • imageBase64: Or the picture itself: PNG, JPEG, GIF or WebP, up to 1000 KB, base64.
  • twitter
  • telegram
  • website
  • taxPct: clanker and flap: buy/sell tax in percent, 1 to 10 (default 3). pons: extra creator tax, 0 to 10 (default 0). Ignored for zora.
  • devBuy: pons and flap: native coin (ETH or BNB) for the creator's first buy in the same transaction. Default 0.

build_btb builds tx

BTB's own products on Ethereum, each as a sign link with a dry run. Bears: bear_status (Bears held and staked, BTBB waiting, mint price), bear_mint (count; ETH price read live; 1,000 XP per Bear on btb.finance), bear_stake (all Bears in the wallet or count; approval included once), bear_unstake (count), bear_claim (BTBB rewards: every BTBB transfer pays 1% to staked Bears). Tokens: btbb_wrap and btbb_unwrap (BTB to BTBB 1:1 and back), wrap and unwrap (BTB into the token used in BTB's pools, 1 to 1,000,000, and back; trades of it pay 1% into the Friday pot), flip_up (USDC into FLIP) and flip_down (FLIP into USDC).

  • wallet required
  • action required
  • count: Bears to mint, stake or unstake. Stake defaults to all in the wallet; unstake to all staked.
  • amount: Whole units for wrap, unwrap and flip actions (BTB, BTBB, pool token, USDC or FLIP).

build_launch_claim builds tx

Find a creator's unclaimed fees on Clanker (Base, BNB Chain, Robinhood Chain, Monad) and Pons (Robinhood Chain) and build the claim transactions, one per chain, each with a dry run. Zora and Flap pay creators automatically. Claiming through BTB is free. Pump on Solana is build_pump_claim.

  • wallet required

build_bridge builds tx

Sell a token on one chain and receive any token on another chain (e.g. USDC on Base to ETH on Ethereum), through LI.FI's best bridge and DEX route: an exact approval if needed, then the bridge transaction, as ONE signLink, with what arrives (and the minimum), fees, gas, the estimated time and a dry run. Tokens arrive in the same wallet. Use find_token for each token on its own chain first.

  • fromChain required: Chain the tokens leave, e.g. "base".
  • toChain required: Chain they arrive on, e.g. "ethereum".
  • tokenIn required: "ETH" for the native coin, or the token address on fromChain.
  • tokenOut required: "ETH" for the native coin, or the token address on toChain.
  • amount required: Whole units of tokenIn, or "max" for the whole balance of a token.
  • wallet required: The wallet that signs; it also receives on the other chain.

bridge_status read

Whether a cross-chain transfer (from build_bridge or any LI.FI route) arrived: pending, done with the receiving transaction and amount, or failed. Give the source transaction hash (sign_status shows it).

  • hash required: Source chain transaction hash.
  • fromChain
  • toChain

build_vault_deposit builds tx

Deposit into a Morpho vault (V1 or V2, any ERC-4626 vault Morpho knows): the exact approval only if needed, then the deposit, as ONE signLink, with the shares you get and a dry run. Fast: no contract lookup. Get the vault address from compare_yield.

  • chain required: Chain name or id.
  • vault required: The vault address, from compare_yield.
  • wallet required: The wallet that signs.
  • amount required: Whole units of the vault's token, or "max" for the whole balance.

build_vault_withdraw builds tx

Take tokens back from a Morpho vault (V1 or V2): an amount, or "max" to redeem every share including interest, as a signLink, with what the position is worth, what can be withdrawn right now and a dry run.

  • chain required: Chain name or id.
  • vault required: The vault address, from compare_yield.
  • wallet required: The wallet that signs.
  • amount required: Whole units of the token, or "max" for everything.

build_swap builds tx

A swap ready to sign: the best KyberSwap price on that chain, an exact-amount approval if needed, then the swap, with the quote, price impact, BTB fee, a safety grade for the token bought and a dry run. For a person, give them the signLink (opens btb.finance with the steps to sign in their wallet); an agent with its own wallet can sign the transactions itself. Use this, not just quote_swap, whenever someone wants to swap.

  • chain required: Chain name or id, e.g. "base", "ethereum", "bnb", "arbitrum", 8453.
  • tokenIn required: Token to sell: its address, or "ETH" for the chain's native coin.
  • tokenOut required: Token to buy: its address, or "ETH" for the native coin.
  • amount required: Amount of tokenIn in whole units, e.g. "250" or "0.5", or "max" for the wallet's whole balance of a token (not the native coin, which also pays gas).
  • wallet required: The wallet that signs and pays.
  • recipient: Who receives tokenOut. Default: wallet.
  • slippageBps: Slippage tolerance in bps. Default 50 (0.5%).

build_add_liquidity builds tx

For agents with their own wallet: the unsigned transactions to open a concentrated-liquidity position in a pool (exact-amount approvals if needed, then the mint), sized from an amount of one of its tokens, with the matching amount of the other token, the range, wallet balances and a dry run. Works for Uniswap V3, PancakeSwap V3, Aerodrome Slipstream and the V3 forks btb.finance supports; other pools return a link. Nothing is signed or sent.

  • chain: Chain of the pool (not needed when pool is a key like "base:0x…").
  • pool required: The pool: its key from another tool ("base:0x…") or its address / Uniswap V4 pool id.
  • wallet required: The wallet that signs, pays and receives the position.
  • token required: Which of the pool's two tokens `amount` is in: its address or symbol (wrapped symbol for ETH, e.g. WETH).
  • amount required: Amount of that token in whole units. The other token's amount is computed for the range.
  • rangePct: Half-width of the range around the price in %, e.g. 5 for ±5 %. null = full range. Default 5.
  • slippageBps: Slippage tolerance in bps. Default 50 (500 on Robinhood Chain).

build_tx builds tx

Turn contract calls into transactions to sign, with a dry run and warnings. When an action needs an approval first (lend on Aave, stake, deposit), pass steps: [approve on the token, then the action] in ONE call so the person gets ONE signLink for both; never build them as separate calls. Single call: address and function. Details: encode any write function of any contract into an unsigned transaction, with a dry run from the wallet, a gas estimate and warnings (unverified ABI, admin-only, arbitrary calls, proxies, unlimited approvals). Prefer build_swap and build_add_liquidity where they apply: they add the protocol math and approvals. Nothing is signed or sent.

  • chain required: Chain name or id, e.g. "ethereum", "base", "arbitrum", "bnb", 8453.
  • address: The contract to call (one call). For several calls in order, use steps instead.
  • function: Function name (e.g. "balanceOf"), full signature for overloads ("supply(address,uint256,address,uint16)") or 4-byte selector.
  • args: Arguments in order. Integers as strings in base units ("5000000000" for 5,000 USDC), addresses as 0x strings, tuples as objects or arrays, "max" for the largest uint.
  • wallet required: The wallet that will sign and send.
  • valueEth: Native coin to send with the call, in whole units (payable functions only).
  • steps: Several calls signed in order, e.g. [approve on the token, supply on the pool]: one signLink for all. Use instead of address/function.
  • title: What the steps do, shown on the sign page, e.g. "Lend 10 USDC on Aave".

Protocols

list_protocols read

DeFi protocols BTB has researched for agents (stablecoin issuers, DEXes, lending, staking, prediction markets, perps…), filterable by category, chain or text: name, category, chains, how agents access it (on-chain or API) and how many contracts and APIs are recorded.

  • category: e.g. "Liquid Staking", "Dexs", "Lending", "Stablecoin".
  • chain: Only protocols on this chain, e.g. "base", "ethereum", "solana".
  • search: Text in the name or description.

get_protocol read

One protocol from the BTB registry: its official contract addresses per chain (each with the official page it came from), the functions an agent would call, off-chain APIs, supported actions and risks. Then use get_abi / read_contract / build_tx on its contracts.

  • protocol required: Name or slug, e.g. "lido", "uniswap", "maple-finance".
  • chain: Only contracts on this chain.

Any contract

get_abi read

What any contract can do: its functions with signatures, inputs, outputs, read or write, and warning flags (admin-likely, arbitrary-call). From verified source on Sourcify, or decoded from the deployed bytecode when unverified; proxies are followed to their implementation. Works on any chain BTB has an RPC for.

  • chain required: Chain name or id, e.g. "ethereum", "base", "arbitrum", "bnb", 8453.
  • address required: The contract address.
  • kind: Only read or only write functions. Default all.
  • search: Only functions whose signature contains this text, e.g. "borrow".
  • full: Also return the raw ABI JSON. Default false.

read_contract read

Call a read (view/pure) function on any contract and get the decoded result: balances, prices, positions, settings. Free, nothing is sent.

  • chain required: Chain name or id, e.g. "ethereum", "base", "arbitrum", "bnb", 8453.
  • address required: The contract address.
  • function required: Function name (e.g. "balanceOf"), full signature for overloads ("supply(address,uint256,address,uint16)") or 4-byte selector.
  • args: Arguments in order. Integers as strings in base units ("5000000000" for 5,000 USDC), addresses as 0x strings, tuples as objects or arrays, "max" for the largest uint.