# How we derive a USD value from the Quoter alone: no oracle, no price API

> Canonical: https://blazephoenix.xyz/learn/usd-value-from-the-quoter-alone/
> License: CC BY-NC-ND 4.0 (attribution + link) · © 2026 BlazePhoenix
> Updated: 2026-11-20

The BlazePhoenix SDK values a token amount in dollars by reading only the on-chain Quoter, at one block pinned by hash. Direct and indirect vias, the minimum of them, and a real run on Base.

Short answer: the USD value of an amount is read from the Quoter alone. The SDK asks the Quoter what it would return for that exact amount of the token, in the dollar token (USDC, or USDG on Robinhood Chain), tries several routes to the dollar token, and keeps the lowest measured one. There is no oracle and no price API in the path: the reading is one or more eth_calls on your own node, at one block.

This page shows how we derive it, step by step: what is read, how the readings are combined, why the result holds up, and one measured example on Base mainnet.

## Step 1: the amount is part of the question

Every number in the derivation is a netOut: what the Quoter answers for that exact input amount, after the 0.28% fee and including price impact. So 10 tokens and 10,000 tokens can be worth a different amount per token. A single quoted rate for the token would hide that. A reading at the amount you hold does not, which is why usdValue takes an amount and not only a token.

## Step 2: read several vias to the dollar token

A via is one way of getting from the token T to the dollar token D. For an amount A, the SDK reads up to 8 vias, the direct one included, all in the same block.

## Why the second leg is scaled

All the quotes of the first call go out together in one Multicall3.aggregate3, so the second leg cannot wait for the output of the first. It is read at a fixed reference size, refX, and scaled linearly to the amount the first leg delivered. The consequence is stated openly: a scaled leg carries the price impact at refX, not at the amount the first leg delivered. The result shows refX as scaledFrom, so you can see the size at which that leg was read.

## Step 3: take the minimum, show the spread

The value is the minimum over the vias that measured something. One via that reads high, through a thin route for example, cannot raise the value. It can only show up in the spread, which reports min, max, their difference and the difference in basis points. The spread has no threshold and gives no verdict: it shows how far the vias are apart and leaves the judgement to you.

## Not measured is not zero

A via whose call reverts, whose route has 0 hops, or whose netOut is 0 measured nothing. It is reported as not measured, with the reason. If no via measured anything, usdValue is null and usd is the string not measured. It is never 0, because 0 would read as a measurement of worthless, and a failed reading says nothing about the token.

## One block, pinned by hash

The client reads the block header (the latest block, or the blockNumber you pass) and runs every eth_call of one usdValue at that block hash with EIP-1898 and requireCanonical set to true. It never pins by number, because after a reorg a number names another block, and vias found on one block could be valued on another. The block number read inside the call must equal the header number; a pinned blockNumber must get its own header, or the result is an rpc_error.

If the node drops the block between the calls, which is what a reorg looks like from the client, discovery restarts on a new block, at most 2 snapshots. If the block is lost every time, or the node takes no blockHash parameter, usdValue returns not measured as a result and does not throw. It never falls back to a read by number.

## One to four eth_calls, and ArbSys

One Multicall3.aggregate3 eth_call reads the block number, the decimals and every quote. A second one, at the same block hash, runs only when the direct route touches more tokens. A restart repeats both, so one usdValue sends 1 to 4 eth_calls. rpc.requests counts these calls, a failed one included, and not the header reads.

On Arbitrum and Robinhood Chain, block.number is the L1 block, not the block that RPC tags count. In the SDK commit that fixed it, the Arbitrum tag 525778791 answered 26452919 from getBlockNumber and 525778791 from arbBlockNumber. So on those two chains the block is read from the ArbSys precompile, inside the same aggregate3, and the block and the readings stay one eth_call.

## The dollar is the dollar token

The dollar token is USDC, or USDG on Robinhood Chain, and it is taken as 1 USD. That is why the label reads USD (via USDC) and not a dollar quote: it is a value in dollar-token terms, measured on chain, with the assumption written in the label.

## A measured example

This is a real, read-only run of usdValue from the published SDK 1.6.0 on Base mainnet, on 2026-11-20, for 1 AAPLc (8 decimals). No key, no transaction, no cost. The RPC URL is a placeholder.

```
import { BlazePhoenix } from '@blazephoenix/sdk';

const blaze = new BlazePhoenix({ rpc: { base: 'YOUR_RPC' } });

const v = await blaze.usdValue({
  chain: 'base',
  token: '0xb200000000000000000000C2e324d24d7eEcd1fb', // AAPLc
  amountIn: 10n ** 8n,                                 // 1 AAPLc
});

console.log(v.label, v.usd, v.blockNumber);
console.log(v.spread, v.rpc.requests);
```

## What the run returned

The read was pinned to block 60030409 and the label was USD (via USDC). The value was 339.468654.

## Where it is used, and one difference

In the SDK, usdValue runs the reads on your own node, and usdFromVias is the same computation without any RPC. In the API and the MCP, the tool is decode_usd_value: the hosted endpoint performs no RPC, so prepare gives the exact eth_call to run on your node and decode turns the result into the value.

One difference is worth knowing. The hosted decoder checks that the first hop of each leg commits exactly the leg amount. If it does not, which is a partial fill, that leg would value less than the amount, and the via is reported as not measured. The SDK README lists a revert, 0 hops and a netOut of 0 as the cases that measure nothing. Do not assume the two agree on a partial fill.

## What it does not do

It does not say what you would get on another venue, and it is not a quote to trade at: it is a measured value of an amount, at one block, on the Quoter. It does not judge the spread. And the dollar token is taken as 1 USD, so the value follows it if it moves. Read it as what the Quoter returns today for your amount, in dollars, with the working shown.

**Verify it yourself:** Install @blazephoenix/sdk and call usdValue on your own RPC for a token and an amount. Check that vias lists the direct and the WETH readings, that usdValue equals the lowest measured via, that blockNumber is one block and that rpc.requests is between 1 and 4. For a two-leg via, check outW × outD ÷ refX against the reported value.

Related: https://blazephoenix.xyz/learn/price-impact-explained/ · https://blazephoenix.xyz/learn/api-sdk-mcp/ · https://blazephoenix.xyz/learn/what-is-usdg/ · https://blazephoenix.xyz/learn/verify-the-calldata-before-you-sign/
