Gas API (gas.cashmere.exchange)
Purpose
The Gas API prices cross-chain burns and returns ready-to-submit signatures for smart contract calls. It is stateless; all pricing data comes from Redis keys populated by internal daemons.REST Endpoints
GET /getEcdsaSig_native
fee is the relayer fee expressed in the bridge asset’s smallest unit (USDC = 6 decimals) unless isNative=true, where it represents native token units (18 decimals on EVM chains).
Fee logic
- Pulls
gas-api:gas-price:{destinationDomain}andgas-api:token-price:{localDomain}plusREDEEM_GAS_USAGESandADJUSTMENT_FACTORconstants. - Returns
feeas a string in the smallest USDC unit (6 decimals) or native token units whenisNative=true. - Applies per-chain minimums (e.g., Solana ≥ 0.59 USDC, Ethereum ≥ 0.20 USDC).
- When
isNative=true, the minimum is converted to native units using the source price feed. gasDropAmountmust mirror the fee currency: 6-decimal USDC whenisNative=false, 18-decimal native token units whenisNative=true.maxFee(for v2 requests) is always quoted in 6-decimal USDC, regardless ofisNative.
- Hash schema:
keccak256(abi.encodePacked(uint32(localDomain), uint32(destinationDomain), uint256(fee), uint256(deadline), bool(isNative), uint8(cctpVersion)));. cctpVersionis1fortransfer/transferWithPermit,2for the v2 variants.
GET /getEd25519Sig_native
fee is returned in the smallest USDC unit (6 decimals) when isNative=false. If isNative=true, the value is quoted in the native token denomination (e.g., 18 decimals for EVM-origin chains).
Message encoding
- Optional
version(u8) prefix. localDomain(u32) only when the quote payload includes theisNativeflag (for source-specific conversions).destinationDomain(u32),fee(u64representing 6-dec USDC whenisNative=false, native token decimals whenisNative=true),deadline(u64).- Optional
isNative(bool) suffix.
WebSocket Broadcast
- Connect to
wss://gas.cashmere.exchange/subscribefor live fee and price updates. - Payloads:
{ "type": "fees", "data": { <sourceChain>: { fee: { <destChain>: { native, usd } }, gas: { native, usd } } } }{ "type": "tokenPrices", "data": { <domain>: "<price>" } }
- Clients can push these updates into their own caches to avoid repeated REST calls.
Operational Notes
- Redis key prefixes:
gas-api:transfer-fee-{native|usd}:{domain},gas-api:token-price:{domain},gas-api:gas-price:{domain}. - Minimum USDC fees (6 decimals): default
80,000, Solana590,000, Linea100,000, HyperEVM100,000, Ethereum200,000. - Deadline = current UNIX timestamp + 100 seconds (signatures expire after this window; relayers tolerate ≤5 seconds of clock drift before rejecting).
Points & Leaderboard API (kapi.cashmere.exchange)
All endpoints use JSON over HTTPS and rely on internal Postgres materialized views. They are unauthenticated but monitored; aggressive polling should be avoided.
Numeric fields are returned as floats to reflect Postgres aggregates; round as needed for UI display. Rate limit: 60 requests per minute per IP (check
X-RateLimit-Remaining headers for real-time budget)./stats/mainnet/wallets
Returns cached distinct sender counts on mainnet:
- Backed by Redis (
mainnet_wallet_stats) with default TTL. - Falls back to direct SQL if the cache miss occurs.
/stats/wallets
Devnet/testnet unique sender count (same schema as mainnet):
/users/leaderboard
- Ranks read from
user_ranks/user_ranks_mainnet. - Entries without a stored rank return
nulland are ordered after ranked users.
/users
Two production query patterns:
GET /users?wallets=0xabc_evm,So111_solana— wallet-level points and multipliers.GET /users?domains=username.csm— domain aggregates and per-chain breakdowns.
Wallet query
Domain query
/users/messages
Nonce helper for wallet binding flows:
POST /users/verify
Submit the signed message to bind or unbind a wallet.
chain_type:evm,solana,sui, oraptos.type:bindorunbind.- Always call
GET /users/messagesimmediately before signing. - Aptos bindings must include
public_key(base64).
/stats/mainnet/volumes
Volume aggregates. Raw amounts (without _usd) are 6-decimal USDC integers.
GET /stats/mainnet/volumes– lifetime volume (total_volume).GET /stats/mainnet/volumes?senders=wallets– wallet-level totals (user_volume).GET /stats/mainnet/volumes/hourly?limit=24– hourly buckets (total_volume_usd).GET /stats/mainnet/volumes/daily?limit=30– daily buckets (total_volume_usd).
/stats/mainnet/fees
GET /stats/mainnet/fees?period=hourly|daily&limit=N — hourly/daily fee buckets (USD floats). Response includes fees[], period_type, limit, offset.
/stats/mainnet/transactions
GET /stats/mainnet/transactions — returns { "total_transactions": number }.
/stats/mainnet/chain-shares
GET /stats/mainnet/chain-shares — volume split per Circle domain (domain, amount, total_amount).
Transaction APIs (kapi.cashmere.exchange)
/transactions
Testnet + staging records backed by the default repository.
Response:
gas_drop_amount is denominated in native units when is_gas_drop_in_native = true. The API currently returns snake_case fields for backward compatibility with internal services.
/transactionsmainnet
Same schema, but queries the mainnet replica. Additional filters:
- Timestamp filters allow bridges to backfill historical windows efficiently (
created_atDESC order). - ENS/SNS lookups are resolved before querying; invalid names return
400.
Smart Contract Integration (Quick Ref)
These APIs abstract away real-time fee estimation and attestation retrieval for EVM and non-EVM integrations.- Call the Gas API to obtain
fee/deadline/ signature.- EVM:
/getEcdsaSig_nativewithisV2=truefor TransferV2/V2Permit. - Solana/Aptos/Sui:
/getEd25519Sig_nativewithversion=2when targeting v2 entrypoints.
- EVM:
- Use the returned
feevalues to populate smart contract params:TransferParams.feeorTransferV2Params.fee.gasDropAmountshould mirror the live quote whenisNative=false(use the bridge token’s decimals, e.g., 6 for USDC); for native gas drops, include the quoted value in the transactionvalue.
- Submit the transaction before
deadline(signatures revert ifblock.timestamp > deadline; relayers tolerate ≤5 seconds of clock drift). - Monitor
/transactionsmainnet(or WebSocket fees) to reconcile executed transfers and track relayer performance.
Gas and price feeds are cached in Redis. If any key is missing, the Gas API returns HTTP 500. Ensure Redis daemons are healthy and synchronized across shards before relying on quotes.