ZirgCore
Connect Wallet
Core API · v0

Market data
you can execute.

The same engine that powers the terminal, exposed as JSON. Every response is read from RPC, registered pools, or a named indexer at the block it reports. Keys, if any, stay on the server.

Base URL
https://www.zirg.tech
Chain
Robinhood Chain · 4663
Live block
Adapters
GET/api/statusCore status

Live RPC head, chain-id match, adapter venues and router verification, explorer/indexer configuration.

chainId
optional · default 4663
curl 'https://www.zirg.tech/api/status?chainId=4663'
Response { ok, chain: { id, name, expected, match }, rpc: { endpoint, latencyMs, blockNumber, timestamp }, adapters: [{ id, protocol, venues, executable, note }], explorer, indexer, fetchedAt }
GET/api/market/:chain/:tokenMarket inspector

Every registered pool for an asset, USD-referenced depth, simulated depth ladder, verdict with reasons, contract status and provenance.

:chain
chain id or key (4663 / robinhood)
:token
ERC-20 address or listed symbol
sizes
optional · comma-separated USD sizes for the ladder
side
optional · BUY (default) or SELL
quote
optional · restrict to one quote token address
curl 'https://www.zirg.tech/api/market/4663/0x0bd7d308f8e1639fab988df18a8011f41eacad73?sizes=100,1000,10000'
Response { provenance: { chainId, blockNumber, timestamp, fetchedAt, source }, asset, pools: [{ state, quote, priceInQuote, depthQuote, depthUsdRef }], best, totalDepthUsdRef, verdict: { verdict, reasons, referenceSize, impactAtReference }, depth: [{ sizeUsd, amountOut, priceImpactPct, status }], contract, warnings }
GET/api/pool/:chain/:addressPool state

Raw state of one pool (token0/token1, reserves or balances, slot0/liquidity for V3, prices) plus its market view when a quote token is on one side.

:chain
chain id or key
:address
pool / pair address
curl 'https://www.zirg.tech/api/pool/4663/0x52e65b17fb6e5ba00ed806f37afcd2daa50271ca'
Response { chainId, blockNumber, timestamp, source, pool: { protocol, poolAddress, factory, factoryRegistered, feeTier, token0, token1, reserves, v3?, price0In1, price1In0, verified, notes }, market }
GET/api/markets/:chainMarket universe

Every catalogued market — quote tokens, the official tokenized-stock registry (re-verified on chain), and ecosystem launchpad tokens — read in one batched pass: price, USD-referenced depth, pool count, best venue and a depth class. Cached 60 s; a cold read takes ~15 s.

:chain
chain id or key
curl 'https://www.zirg.tech/api/markets/4663'
Response { provenance, registry: { status, retrievedAt, count, source }, counts: { quote, crypto, stock, ecosystem }, poolsRead, rows: [{ address, symbol, name, category, project, price: { value, quote }, priceUsdRef, depthUsdRef, pools, best: { protocol, feeTier, pool }, depthClass }] }
GET/api/quoteQuote (best executable route)

Direct + two-hop routes across every registered venue, quoted with the pool math at the current block. Returns the best executable route and every candidate. Pass recipient to receive calldata and a wallet-specific gas estimate.

chainId
required
tokenIn
address · 0xeeee…eeee for the native coin
tokenOut
address
amountIn
decimal in tokenIn units, e.g. 1.5
slippageBps
optional · default 50 · max 5000
recipient
optional · wallet address (enables calldata + eth_estimateGas)
deadlineSec
optional · default 1200
curl 'https://www.zirg.tech/api/quote?chainId=4663&tokenIn=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&tokenOut=0x5fc5360d0400a0fd4f2af552add042d716f1d168&amountIn=1&slippageBps=50'
Response { blockNumber, timestamp, tokenIn, tokenOut, amountIn, amountOut, minimumReceived, priceImpact, gasEstimate, route: { id, protocol, hops, confidence, gas, verdict, execution }, sources, verdict, reasons, candidates, warnings }
GET/api/routesRoute comparison

Same inputs as /api/quote; returns every candidate ranked with output, gas, impact, depth, confidence and hop count.

same as /api/quote
curl 'https://www.zirg.tech/api/routes?chainId=4663&tokenIn=0x5fc5360d0400a0fd4f2af552add042d716f1d168&tokenOut=0x0bd7d308f8e1639fab988df18a8011f41eacad73&amountIn=1000'
Response { blockNumber, selected, verdict, reasons, routes: [{ id, protocol, hops, output, minimumReceived, gas, priceImpactPct, routeDepthUsdRef, confidence, hopCount, verdict, executable }] }
GET/api/contract/:chain/:addressContract reader

Bytecode presence and size, ERC-20 metadata, owner() if exposed, EIP-1967/1822 proxy implementation, explorer verification. Optional holder/spender for balanceOf and allowance.

:address
contract address
holder
optional · address for balanceOf
spender
optional · with holder, for allowance
curl 'https://www.zirg.tech/api/contract/4663/0x5fc5360d0400a0fd4f2af552add042d716f1d168'
Response { provenance, address, exists, bytecodeSize, isErc20, erc20, owner, proxy, explorer: { verified, name, compiler, url, source }, warnings, balance, allowance }
POST/api/contract/readSafe read call

One view/pure call by human-readable signature via eth_call. Payable / nonpayable signatures are refused. Nothing is ever signed server-side.

chainId
required
address
contract address
signature
e.g. balanceOf(address) returns (uint256)
args
array of strings / numbers / booleans
curl -X POST 'https://www.zirg.tech/api/contract/read' \
  -H 'content-type: application/json' \
  -d '{"chainId":4663,"address":"0x5fc5360d0400a0fd4f2af552add042d716f1d168","signature":"balanceOf(address) returns (uint256)","args":["0x52e65b17fb6e5ba00ed806f37afcd2daa50271ca"]}'
Response { chainId, address, signature, args, blockNumber, fetchedAt, raw, decoded }
GET/api/tokens/:chainToken registry / resolve

The verified token catalog (quotes, tokenized stocks from the official registry, ecosystem launchpad tokens), or resolve a query: address → on-chain metadata, ticker/name/project → catalog, otherwise explorer search.

q
optional · address or symbol
curl 'https://www.zirg.tech/api/tokens/4663?q=USDG'
Response { chainId, query, tokens: [{ address, symbol, name, decimals, native }], source }
POST/api/rpc/:chainRead-only JSON-RPC relay

Same-origin relay used by the browser wallet client. Only read methods (eth_call, eth_getBalance, eth_estimateGas, eth_getTransactionReceipt, …) are forwarded; batches up to 50.

body
JSON-RPC 2.0 request or array
curl -X POST 'https://www.zirg.tech/api/rpc/4663' \
  -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'
Response { jsonrpc: "2.0", id, result } | { error: { code, message } }
Errors are JSON with a stable shape: { error: { code, title, message, status } }. Codes: RPC_UNAVAILABLE · RPC_ERROR · WRONG_CHAIN · UNSUPPORTED_CHAIN · UNSUPPORTED_MARKET · NO_VERIFIED_MARKET · NO_ROUTE · ROUTE_REJECTED · INVALID_INPUT · NOT_A_CONTRACT · EXPLORER_UNAVAILABLE · RATE_LIMITED. Responses are never cached across blocks; every payload carries blockNumber and fetchedAt.