WAGMI

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.

API BASE URLhttps://wagmi-api.vercel.app/v1

Use 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.

02 / AUTHORIZE ONCE

Let your bot execute unattended

In Settings → Bot trading access, select your API key and wallet, enable swaps and Earn actions, choose networks and limits, and enter the wallet password once. The same API key can then execute without pairing codes or approval for each trade.

Standing access lasts until revoked or until the key expires. Select Never expires when creating the key for ongoing access. Existing keys remain read-only until you enable execution. The bot never receives the wallet password or signing shares.

Read /me for effective permissions and /bot/grants/current?wallet_id=… for the policy and remaining budgets. One wallet can have one active bot grant. Manual WAGMI transactions pause on that wallet while standing access is enabled; revoke access in Settings to use it manually. Revocation stops new signing and cannot undo an already submitted transaction.

Short sessions via /bot/authorizations remain available as an optional alternative. Standing-access bots do not call that endpoint.

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.

QueuedSigningSubmittedSettlingFilled or refunded

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.

MethodPathPurpose
POST/swaps/quoteQuote supported same-chain or cross-chain pairs
POST/swaps/executeExecute a general swap with standing access
GET/earn/vaultsDiscover Morpho vaults or Aave reserves
GET/earn/positions?wallet_id=…Read shares and withdrawal liquidity
POST/earn/deposit/quoteQuote an Earn deposit
POST/earn/depositExecute the quoted deposit
POST/earn/withdraw/quoteQuote withdrawal by assets or shares
POST/earn/withdrawExecute the quoted withdrawal
GET/meWallet IDs and key permissions
GET/capabilitiesAvailable chains, adapters and execution limits
POST/bot/authorizationsRequest owner approval with a bounded policy
POST/bot/authorizations/tokenExchange 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=falseDiscover opportunities and unsupported reasons
POST/arbs/{id}/quoteFresh wallet-specific price and profit checks
POST/arbs/{id}/executeAccept a job using authorized bot credentials and Idempotency-Key
GET/executionsExecution history
GET/executions/{id}Progress, transaction hashes and confirmed settlement
POST/executions/{id}/cancelCancel before signing starts
POST/executions/{id}/reconcileCheck a previously submitted transaction
POST/executions/{id}/resume or /recoverResume 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.
Developer API | WAGMI