Browse documentation

Agents & API

Reporting volume

Why report

Your tier follows your volume, and volume is what you report. Every build is recorded with its id, your key, its kind, the chain, the sender, the contract the transaction goes to, its USD value and the time.

A build counts after you report the transaction you sent for it and the server has checked the receipt on chain. Volume is the USD value of confirmed transactions, so a build you never send adds nothing.

Report a transaction

Send POST /v1/report with the buildId from the build and the txHash of the transaction you sent. A swap/status or bridge/status call that carries the buildId counts too.

  • buildId The buildId the build returned.
  • txHash The hash of the transaction you sent for that build.
Report (TypeScript)
const API = 'https://oxley-agents.web3bandit.workers.dev';

// buildId comes from the build; txHash from sending its last step.
const response = await fetch(`${API}/v1/report`, {
  method: 'POST',
  headers: { authorization: `Bearer ${process.env.OXLEY_API_KEY}`, 'content-type': 'application/json' },
  body: JSON.stringify({ buildId, txHash }),
});
const { outcome, volume30dUsd } = await response.json();
console.log(outcome, volume30dUsd);

What the server checks

Before it counts a transaction, the server reads its receipt on that chain and checks that:

Report the transaction that does the swap or the bridge: the last step of the build, the one that goes to the build’s target contract. An approval or a fee transfer is an earlier step, goes to another contract and does not pass the check.

  • the transaction succeeded;
  • from is the build’s sender, and to is the build’s target;
  • it landed within 24 hours of the build;
  • the transaction hash was not counted before.

What the answer says

POST /v1/report answers with outcome and volume30dUsd, your volume now. A status call that carries the buildId adds the same outcome to its answer, as report. A buildId that is not your key’s is a 404 on POST /v1/report and unknown in a status call; a malformed hash in a status call is invalid.

OutcomeMeaning
countedThe transaction passed every check and counts. Reporting it again answers counted.
pendingThe receipt is not available yet. Report again shortly.
failedThe transaction did not succeed.
mismatchIt is not the transaction that was built: another sender or target, other calldata or value, or mined before the build.
expiredMore than 24 hours passed between the build and the report.
duplicateThat transaction already counted for another build, or this build already counted with another transaction.

How the USD value is found

Each build is valued in USD in this order:

  • USDC side The USDC side of the swap or transfer, when it has one.
  • Otherwise The quote’s own USD figures (Enso’s or 0x’s), or else the input at the chart price.
  • No figure If no USD figure is available, the build counts zero.

Transfers with more than one hop

A later hop is built with its own intent, so it has its own buildId. Report each hop’s transaction with that hop’s buildId.

See your volume

GET /v1/me returns your 30-day volume, your tier and the next tier. See Tiers and limits for how volume moves a key between tiers.