
WAGMI
We're All Gonna Make It
WAGMI FOR DEVELOPERS
Your bot.
Your wallet. Your limits.
Buy and sell tokens, execute arbitrage, and deposit into or withdraw from supported Earn positions with standing access configured once in Settings.
01 / CONNECT
Start in Settings
Sign in to your WAGMI account, open Settings → API & bots, name your bot, choose its wallet and permissions, choose 30 days, 90 days or Never expires, then create a key. You can revoke any key in Settings. Copy it once into your runner’s secret storage.
https://wagmi-api.vercel.app/v1Use Authorization: Bearer $WAGMI_BOT_KEY. Read /me to get your wallet IDs. Read keys cannot sign transactions.
curl "$WAGMI_API_BASE/me" \
-H "Authorization: Bearer $WAGMI_BOT_KEY"
curl "$WAGMI_API_BASE/arbs/active?wallet_id=$WALLET_ID&executable_only=false" \
-H "Authorization: Bearer $WAGMI_BOT_KEY"Requests are limited to 60 per minute per registration. Respect Retry-After and use exponential backoff.
03 / EXECUTE
Quote. Accept. Follow settlement.
Use /swaps/quote for general trading, /earn/deposit/quote or /earn/withdraw/quote for Earn, or an arbitrage quote for a listed opportunity. Discovery prices are indicative. A fresh quote includes minimum output, gas budget, expiry, venue and a conservative profit calculation.
Accept it with quote_id, wallet_id, a unique client_order_id and an Idempotency-Key. Save the request before sending. A timeout means retry the identical request and key, or query the saved execution.
Only filled means the swap settled. WAGMI verifies finalized source receipts and, for bridges, destination delivery or source refunds. A confirmed bridge deposit remains pending until settlement is verified. Approval transactions do not count as trading volume. Shadow executions end at simulated and move no funds.
Current adapter coverage
General swaps support Ethereum, Base, Arbitrum, BNB Chain (BSC), Avalanche and Optimism ERC-20 pairs through LI.FI, including buys and sells without an arbitrage listing. Earn supports listed Morpho V1 and V2 vaults on Ethereum, Base and Arbitrum, using on-chain minimum-share or minimum-asset bounds. Across supports canonical USDC transfers between Ethereum, Base, Arbitrum, Optimism and BNB Chain where live routes exist. THORChain supports available ERC-20 pools on Ethereum, Base, Avalanche and BNB Chain. Aave V3 withdrawals support Ethereum, Base, Arbitrum, Optimism and Avalanche. Native-token swaps, Aave deposits, CoW, NEAR and Liquidy remain unsupported. Capability and eligibility responses identify these cases so your runner can skip them. Select the networks your bot may use in Settings; enable cross-chain and automatic USDC funding separately. Existing grants keep their current permissions. Keep BNB on BNB Chain, AVAX on Avalanche and ETH on the other supported networks for gas.
Optional funding can withdraw Aave USDC and bridge it before trading. All stages share one execution ID and your spending limits. If profitability disappears, the sequence stops and the funded tokens remain in your wallet. See the cross-chain and funding guide for exact requests and recovery behavior.
Different output assets are valued at quote prices. Reported value change is marked to market, not realized cash profit or a guaranteed round-trip return.
Use the general trading client for swap and Earn requests. It persists pending submissions so a restart can reconcile without duplicating the trade.
A Grok chat alone is not a persistent trading process. Run the Node.js runner on a host with private environment variables and durable disk. Let the model suggest candidates; deterministic code retains credentials, enforces the API contract and tracks executions.
REFERENCE
REST endpoints
Paths below are relative to the API base. Financial amounts are decimal strings; token units are integer strings. Private responses are never publicly cached.
| Method | Path | Purpose |
|---|---|---|
| POST | /swaps/quote | Quote supported same-chain or cross-chain pairs |
| POST | /swaps/execute | Execute a general swap with standing access |
| GET | /earn/vaults | Discover Morpho vaults or Aave reserves |
| GET | /earn/positions?wallet_id=… | Read shares and withdrawal liquidity |
| POST | /earn/deposit/quote | Quote an Earn deposit |
| POST | /earn/deposit | Execute the quoted deposit |
| POST | /earn/withdraw/quote | Quote withdrawal by assets or shares |
| POST | /earn/withdraw | Execute the quoted withdrawal |
| GET | /me | Wallet IDs and key permissions |
| GET | /capabilities | Available chains, adapters and execution limits |
| POST | /bot/authorizations | Request owner approval with a bounded policy |
| POST | /bot/authorizations/token | Exchange approved device code for an execution token |
| GET | /bot/grants/current?wallet_id=… | Standing or session policy and wallet budgets |
| DELETE | /bot/grants/{id} | Revoke your trading session |
| GET | /arbs/active?wallet_id=…&executable_only=false | Discover opportunities and unsupported reasons |
| POST | /arbs/{id}/quote | Fresh wallet-specific price and profit checks |
| POST | /arbs/{id}/execute | Accept a job using authorized bot credentials and Idempotency-Key |
| GET | /executions | Execution history |
| GET | /executions/{id} | Progress, transaction hashes and confirmed settlement |
| POST | /executions/{id}/cancel | Cancel before signing starts |
| POST | /executions/{id}/reconcile | Check a previously submitted transaction |
| POST | /executions/{id}/resume or /recover | Resume bridge delivery/refund observation |
| GET | /balances?wallet_id=… | Spot inventory and wallet reservations |
| GET | /volume/today?wallet_id=… | Settled input volume and gas, by UTC day |
General swap request
POST to /swaps/quote using wallet_id, source_asset_id, destination_asset_id, sell_amount and optional slippage_bps. Use full identifiers from /assets. Amounts are decimal strings in whole token units; “1000” means 1,000 tokens. Keep slippage within your grant’s limit.
Download a complete BRETT → USDC example and replace YOUR_WALLET_ID with the wallet ID returned by /me. A 400 response includes error.details with the field and reason. Field aliases such as from_asset and amount_in are not accepted.
Read token balances
Default /balances?wallet_id=… discovers curated tokens and recent activity, including Base BRETT and UNI. Follow next_cursor until null. This is a partial inventory, so an omitted asset does not mean zero. Request any supported ERC-20 directly using repeated asset_id query parameters, up to 30 per request. Quotes also read their source token’s balance directly; they do not depend on the discovery list. Earn positions have their own endpoint.
Retry deliberately
Errors include a stable code, readable message, request_id and retryable flag. Store request IDs for support, without storing credentials.
route_unsupported: skip this opportunity. Do not switch the selected venue behind the owner’s back.quote_expired/quote_changed: obtain a fresh quote before a new execution.authorization_pending: continue polling at the supplied interval.vault_locked/grant_revoked: enable or restore standing access in Settings; never send a wallet password to the API.wallet_busy: reconcile the existing execution before another trade.recovery_required: stop automatic trading and review the execution. Never submit a replacement transaction automatically.