# x402 Treasury Snapshot

> x402 Treasury Snapshot is a paid API for AI agents from x402-gateway-production-1f21.up.railway.app, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-10).

Returns a deterministic snapshot of an on-chain wallet's token balances, recent ERC-20 activity, and a hash for change detection on Base or Ethereum.

## Facts

- Endpoint: POST https://x402-gateway-production-1f21.up.railway.app/agent/treasury-snapshot?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-treasury-snapshot-dc2ef316
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_KSgR0E-jBMSewkLyJvEcq

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402-treasury-snapshot-dc2ef316 -d '<json body>'
```

Example prompt: Give me a treasury snapshot for wallet 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 on Base, looking back 2000 blocks, and compare it against my previous state hash a3f1b2c4d5e6f7890abcd1234567890abcdef1234567890abcdef1234567890ab.

## When to prefer this

Choose this endpoint when you need a deterministic, machine-payable on-chain treasury snapshot with built-in change detection via state hashing. Ideal for AI agents that need to monitor wallet balances and ERC-20 activity on Base or Ethereum without running their own node, and especially when you want to cheaply poll for changes using the previous_state_hash comparison rather than re-fetching full data every time.

## Known failure modes

- Invalid or malformed Ethereum address (must be 0x-prefixed 40-char hex) returns validation error
- Unsupported network value (only 'base' or 'ethereum' accepted)
- lookback_blocks exceeds maximum of 5000
- Token address array exceeds 20 items
- Payment not received or insufficient USDC — x402 payment required
- Node/RPC timeout for very large block ranges
- Address has no activity in the specified lookback window — empty result set

## How this service works

One-call crypto treasury snapshot for autonomous agents: native ETH balance, up to 20 ERC-20 balances, current gas/base-fee state and recent ERC-20/USDC transfer activity with next_cursor for recurring polling. Use for treasury bots, wallet monitors, stablecoin operations, accounting and automated payment systems.

## Output

A JSON object containing the wallet's current token balances across specified ERC-20 contracts, a history of recent token activity within the specified block range, and a deterministic state hash that can be compared to a previous hash to detect changes — enabling idempotent treasury monitoring.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "address"
     ],
     "properties": {
      "tokens": {
       "type": "array",
       "items": {
        "type": "string",
        "pattern": "^0x[a-fA-F0-9]{40}$"
       },
       "maxItems": 20
      },
      "address": {
       "type": "string",
       "pattern": "^0x[a-fA-F0-9]{40}$"
      },
      "network": {
       "enum": [
        "base",
        "ethereum"
       ],
       "type": "string",
       "default": "base"
      },
      "activity_cursor": {
       "type": "integer",
       "minimum": 0
      },
      "lookback_blocks": {
       "type": "integer",
       "default": 1000,
       "maximum": 5000,
       "minimum": 1
      },
      "activity_contract": {
       "type": "string",
       "pattern": "^0x[a-fA-F0-9]{40}$",
       "description": "ERC-20 activity contract; defaults to USDC."
      },
      "previous_state_hash": {
       "type": "string",
       "pattern": "^[a-fA-F0-9]{64}$"
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "status": "ready"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-treasury-snapshot-dc2ef316/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-gateway-production-1f21.up.railway.app](https://www.zero.xyz/host/x402-gateway-production-1f21.up.railway.app/llms.txt)
