Integration guide

Access Rates data.

Treasury yields, instrument evidence, source history and measured settlement costs. Inspect a free record, then use the paid data products through MCP or HTTP.

Connect Rates over MCP

Add https://api.402rates.com/mcp/rates to a Streamable HTTP MCP client. No account or API key is needed. 13 MCP tools: 10 free and 3 paid. 16 HTTP capabilities including shared service information.

{"mcpServers":{"rates":{"url":"https://api.402rates.com/mcp/rates"}}}

Connection does not authorize a paid purchase. Instrument/history allowances and rate limits are shared with HTTP and the combined legacy /mcp entry.

Agent tests have their own product: Compass integration.

Repeat a Compass test.

1. Read a free sample

Open the USTB instrument record to see the response shape, yield basis, terms and source evidence.

curl "https://api.402rates.com/v1/rwa/instrument?ticker=USTB"

Up to three distinct instruments per rolling hour are free across instrument and history calls. Repeating those instruments stays free. Current coverage is public.

2. Choose the result you need

ResultMCP toolUSDC per call
Measured and quoted RWA yields, with provenanceget_rwa_yields0.03
All tracked instrument records, including terms and evidenceget_rwa_instruments5
Full settlement cost comparisoncompare_settlement_costs0.01

The same products are available over HTTP at /v1/rwa/yields, /v1/rwa/instruments and /v1/settlement/costs. The full snapshot is a single purchase with internal-use and attribution terms. Data-use terms.

Each paid call buys the described result for that request. The main obligation is fulfilled on delivery of the agreed result to your client, within the published scope and limits. Payment alone does not establish delivery. No ongoing monitoring, automatic updates or later transactions are included unless expressly agreed. Repeated individual purchases are permitted under the same use terms. Claims concerning a failed or defective delivery remain unaffected. Per-call scope and completion; separate test-run access and report limits.

For non-delivery after payment, duplicate charges for the same payment authorization or a calculation inconsistent with its supplied inputs and published method, email info@402rates.com. Include the capability, payment network, transaction identifier and available evidence with secrets removed. Reports are reviewed manually; statutory rights remain unaffected.

Settlement measurement and workload estimates

compare_settlement_costs and GET /v1/settlement/costs remain the existing 0.01 USDC product: measured on-chain costs for a USDC transfer, with chain-specific gas simulation, current gas prices and source freshness checks. This is separate from the free arithmetic below.

estimate_payment_costs on Rates MCP and POST /v1/settlement/estimate calculate costs from caller-supplied assumptions. The payment cost worksheet runs the same model locally in your browser. It includes synthetic examples; entered inputs stay in the browser and no API request or payment is made.

Supply a shared workload identifier, calls from 1 to 1,000,000 and one to eight profiles. Every amount is a decimal string in whole units of that profile's currency, with at most 30 integer and 18 fractional digits. JSON input is bounded to 64 KiB. MCP requires these fields; an empty HTTP body object returns input guidance.

POST https://api.402rates.com/v1/settlement/estimate
Content-Type: application/json

{
  "workload": "synthetic-data-call",
  "calls": 1000,
  "profiles": [{
    "id": "direct", "currency": "USD",
    "payment_per_call": "0.01", "network_per_call": "0.0002",
    "provider_per_call": "0", "setup_cost": "0", "locked_capital": "0",
    "settlement_every_calls": 1, "settlement_cost": "0"
  }]
}

These invented inputs produce total_cost: "10.2" USD, not an observed fee. The accounting basis is caller_outlays: service purchase plus additional network/provider charges, one setup amount and a full settlement charge for every batch, including a final incomplete batch. Provider charges are amounts paid by the caller, not provider operating costs.

Unknown fees remain null, suppress total_cost and retain a known_subtotal. Omitted settlement cost remains unknown. Locked capital is disclosed separately and never added to expenditure. USD and USDC are distinct; complete profiles are grouped only within the same currency and remain in input order. Complete means the five declared components are known; cost coverage is not exhaustive. No live quote, currency conversion, wallet access or purchase occurs.

Totals use exact decimal arithmetic. Per-call values round upward to 18 decimal places and disclose whether rounding changed the value. Funding, claim and closure costs appear only if incorporated explicitly into the supplied components. Optional source references are caller declarations and are never fetched or verified.

Compare saved snapshots

The free compare_rwa_snapshots tool and POST /v1/rwa/changes accept before and after saved Rates responses, plus an optional threshold_bps (default 5). Yield, issuer divergence, source identifiers, calculation windows and missing rows are compared. A threshold crossing is numerical, not a claim about economic significance.

Use schema-version 0.5.0 yields, instrument or full-instrument responses. JSON inputs are limited to 192 KiB and are not persistently stored. An empty object returns a synthetic example. No new market data is fetched; supplied records are not authenticated. HTTP/MCP connector.

All MCP tools

Names and summaries below come from the server's tool list. Free tools require no payment. Paid tools require an x402-capable client. Rates manifest.

ToolWhat it providesPrice per call
read_rwa_access_evidenceRead dated Treasury access and settlement documentationFree
estimate_payment_costsCalculate workload costs from supplied payment profilesFree
list_rwa_updatesRead observed Treasury changes since a saved cursorFree
compare_rwa_benchmarkCompare a supplied USD Treasury return with a matching benchmarkFree
compare_rwa_snapshotsCompare yield and divergence fields in two saved Treasury responsesFree
list_capabilitiesList capabilities for Rates by 402ratesFree
get_manifestGet the manifest for Rates by 402ratesFree
get_rwa_instrumentGet one RWA instrument stateFree
get_rwa_historyGet one RWA source historyFree
cheapest_settlement_chainCheapest chain for a USDC transferFree
compare_settlement_costsMeasured cost of a USDC transfer per chain, cheapest first0.01 USDC
get_rwa_yieldsRealised 30-day yields of tokenized treasuries, recomputable0.03 USDC
get_rwa_instrumentsComplete evidence snapshot for all tracked tokenized treasuries5 USDC

3. Install and supply your wallet locally

Use Node 20.6 or later. In a new local directory, install the packages below. Supply your wallet key through the EVM_PRIVATE_KEY environment variable using your local secret manager. The examples use USDC on Base, chain eip155:8453.

npm init -y
npm install @modelcontextprotocol/sdk@1.30.0 @x402/core@2.17.0 @x402/evm@2.17.0 @x402/mcp@2.17.0 viem@2.55.0

Connecting an MCP server exposes its tools. Paid calls also require an x402 payment-capable client and a wallet with enough USDC. The examples sign a real purchase when run with a funded key.

Paid capabilities are for business/professional use only, under the service and data-use terms. The HTTP v2 payment resource description and paid MCP descriptions include this notice before payment. Paid HTTP endpoints also return a Link header with rel="terms-of-service" and X-Paid-Service-Audience. The legacy XDC mirror supplies these headers while retaining its existing payment-body format.

4. Download and run the MCP example

Save mcp-paid-rwa.mjs in that directory. The default call buys USTB yields with a 0.03 USDC ceiling. The full snapshot requires --snapshot and has a 5 USDC ceiling.

node mcp-paid-rwa.mjs

# Separate purchase: full snapshot, up to 5 USDC
node mcp-paid-rwa.mjs --snapshot

The client reads the server's payment terms, accepts only Base USDC within its limit, signs and retries. A successful result includes a settlement receipt. A yield selection with no usable figure returns a data error without settlement.

HTTP and discovery examples

node-paid-yield.mjs buys the same USTB yield result over HTTP with a 0.03 USDC ceiling and the same installed packages.

node node-paid-yield.mjs

Tool discovery and payment checks are documented in Compass.

Free MCP tools are available at https://api.402rates.com/mcp/rates using Streamable HTTP. See the OpenAPI manifest for HTTP arguments and response contracts.

Rates / Changes

What changed since the last call?

list_rwa_updates reads notices from a saved cursor. The free feed lists changed fields, detection times and state digests. Full previous and current values appear in the existing instrument response under changes, with the same instrument allowance and prices.

POST https://api.402rates.com/v1/rwa/updates
Content-Type: application/json

{"limit":50}

Save next_cursor after processing the page and pass it as cursor on the next call. Continue while has_more is true. cursor_reset_required means a retention gap or a replaced journal; start a new baseline explicitly. stale and unavailable are not a healthy empty result.

Capture runs every fifteen minutes from recorded sources. The first event is a baseline. Terms reflect our versioned evidence catalogue; issuer documents are not continuously scraped. Ninety-day retention; full instrument responses contain at most the latest 100 events with an explicit truncation flag. Detection time is not an issuer's effective date.

Download the one-poll cursor client. Save the file in a working folder with Node 22+, then run:

node rates-watch.mjs rates-cursor.json
# Run again later, using the same cursor file:
node rates-watch.mjs rates-cursor.json

Each command prints the available notices and saves the next cursor only after successful delivery to the local client. An empty set of notices means no new captured events in that interval, not a claim that the issuer changed nothing. Scheduling remains under your control.

No payment or subscription is started. This optional free feed does not add a continuous-service guarantee to individual purchases.

Rates / Comparison

A benchmark with matching dates.

compare_rwa_benchmark compares a saved measured USD instrument response with caller-supplied Treasury total-return index levels. It performs arithmetic; it does not fetch or authenticate an index.

POST https://api.402rates.com/v1/rwa/benchmark

{
  "snapshot": { "...": "saved complete single-instrument response" },
  "benchmark": {
    "kind": "us_treasury_total_return_index", "currency": "USD",
    "start_date": "2026-08-01", "end_date": "2026-08-31",
    "start_value": 100, "end_value": 100.3,
    "source_url": "https://example.invalid/total-return-index",
    "retrieved_at": "2026-09-01"
  }
}

This is a synthetic benchmark example with a placeholder snapshot, not a reported market return. Supply your actual saved response and a source you can use. Dates must match exactly, within the 28-32 day yield window. Both returns use USD and simple actual/365. Spot yields, price-only indices, quoted fund yields and different currencies return not_comparable.

benchmark_spread_bps is fund minus benchmark. It does not identify fees, cash drag or causality; no management fee is subtracted again. Portfolio duration and holdings may differ.

Rates / Access evidence

Identify the fund and its access path.

Version 2 separates instruments, distribution paths, settlement protocols and dated institutional events. Source dates remain distinct from feed capture times. Documentary events do not add funds to the tracked universe.

POST https://api.402rates.com/v1/rwa/access-evidence
Content-Type: application/json

{"version":"2","ticker":"USTB"}

Use read_rwa_access_evidence over MCP. Detailed instrument selections share the three-ticker rolling-hour allowance with instrument and history reads. Omit the version to keep the original response.

Add version=2 to the single-instrument request or the $5 complete snapshot for the same access evidence alongside financial data. An unfiltered access request returns documentary records and a record index.

list_rwa_updates({"scope":"access","limit":50})

The access feed has an independent cursor and reports changed fields and digests. Read the evidence · Version 2 example · Instrument schema.

Rates / Market evidence

Keep price, reference and depth together.

The market-state contract and its synthetic calculation sheet are separate from realised Treasury yields. Check free market coverage before attempting paid access. Source permissions, identity and time semantics control availability.

Market change notices use the same free updates endpoint with an explicit scope and an independent version-2 cursor:

POST https://api.402rates.com/v1/rwa/updates
Content-Type: application/json

{"scope":"market","limit":50}

The default instrument scope and its version-1 response are unchanged. Market notices contain changed field names and digests, not paid prices. An unavailable or disabled feed is not an unchanged market. Use a separate cursor file for each scope.

Download the free market notice reader. Run one poll with node rates-market-watch.mjs market-cursor.json. No payment is made. Once licensed paid detail is available, a notice can refer to a retained evidence bundle through market_snapshot_id. An expired or corrected bundle is refused, never silently replaced.