Getting started

Batch dependent DeFi reads through the API or MCP

Resolve a token and reuse its address in an amount conversion. Validate the calls, run the batch and handle an ambiguous or missing result.

Workflow

  1. Select the reads and fields

    Call batchTools to see which public queries can run together. Inspect the input fields and allowed output paths for each tool. Assign each call a unique id. A binding names the destination field, an earlier call id and an allowed path in its output. A batch accepts up to six calls.

  2. Validate before fetching data

    In the example, pair resolves exact USDC and native ETH on Base. amount uses the resolved source address to convert 100 display units. checkReadBatch checks the input shapes and bindings before any provider query. Pass the same calls to runReadBatch when validation succeeds.

  3. Act on each result individually

    Read the status of each item. If the pair is ambiguous, it has no resolved source address. The dependent conversion returns blocked with status 424. Check the candidates, supply the intended contract and repeat the reads. A run reserves one usage unit per item. Request a live quote or a signed operation separately once the required reads succeed.

Check a Base token lookup and amount conversion

curl -fsS "https://www.bitpont.com/api/v1/agent/batch/check" \
  -H 'Content-Type: application/json' \
  -d '{"calls":[{"id":"pair","tool":"resolvePair","input":{"sourceChain":"evm:8453","destinationChain":"evm:8453","from":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","to":"ETH"}},{"id":"amount","tool":"convertAmount","input":{"chainId":"evm:8453","unit":"display","value":"100"},"bind":[{"field":"address","from":"pair","path":"/route/source/address"}]}]}'

Tools in this guide

Open tool explorer

Related links