v2.2.0 Production Gateway + 24/7 Spot Auto-Trade

Moonlist Intelligence API

Welcome to the institutional gateway for autonomous on-chain operations. Moonlist provides a unified, highly-resilient API that abstracts multi-chain liquidity aggregation, natural language AI intent detection, 24/7 non-custodial Base spot auto-trading, and high-performance RPC node auditing into a single standardized interface.

Quick Start: Generate your production key in the Developer Console to begin executing requests against the Unified Gateway.

Primary Gateway Endpoint

POST https://proxy.moonlist.site

Platform & App Upgrades

Latest architecture, routing, and UI upgrades shipped across the Moonlist App, DEX Intelligence Engine, and Web Assistant.

Upgrade AreaChains / ScopeTechnical Improvement
24/7 Spot Auto-Trade & Vault v2 Base Mainnet (8453) & Cloudflare Workers Launched live 24/7 non-custodial spot automated trading and AI Auto-Pilot backed by verified MoonlistAutoTradeVault (0x478b0eD29b2fa45ab07174604DDc4B6345C36bdE), atomic Base Multicall3 balance sync, +35% gas headroom with strict on-chain receipt verification, and real-time background push notifications on trade fills.
DEX Chart & Price Resilience Arbitrum, Optimism, Base, BSC, ETH, Solana Added automatic DexScreener (tokens/v1) and DeFiLlama (coins.llama.fi) batch fallbacks when GeckoTerminal rate-limits (429), eliminating 0.000 token prices on Arbitrum & Optimism and ensuring DEX charts always render cleanly.
SPL Mint Precision & Balances Solana (Legacy SPL & Token-2022) Fixed SPL token decimal resolution for accurate Swap output quotes, preserved Base58 mint casing in portfolio tracking, and added direct getTokenAccountsByOwner mint queries with public Solana RPC fallback so custom-imported SPL tokens always show live balances in Wallet Holdings and Swap.
Streamlined Swap UX Multi-Chain Swap & Bridge Moved the network switcher into a compact round selector in the top-right Swap app bar and removed the redundant Popular chip strip for faster quote execution.

Authentication

Authentication is enforced via the X-MOONLIST-KEY header (or ml-key query parameter for Web3 wallet/paymaster compatibility). All requests are monitored against your monthly subscription tier.

Header / ParameterTypeRequirementDescription
X-MOONLIST-KEY String Required Your unique production key (e.g. ml_4f89a2...). Managed in the Developer Console.
Content-Type String Required Must be application/json.

AI Agent & LLM Discovery

Moonlist is engineered from the ground up for autonomous LLM agents (LangChain, AutoGPT, Vercel AI SDK, Mastra). We export dynamic machine-readable specifications for automated tool-calling.

1. Context Overview (llms.txt)

Autonomous agents should ingest llms.txt to parse the core capabilities and endpoints of the Moonlist platform.

GET https://moonlist.app/llms.txt
View Spec

2. Machine Schema (OpenAPI 3.0)

Pass our full OpenAPI YAML to your agent runtime to auto-generate tool calling schemas on the fly.

GET https://moonlist.app/openapi.yaml
View OpenAPI

Unified Gateway Reference

The /v1 endpoint accepts a unified JSON object. The target parameter dictates which backend execution node handles the request.

FieldTypeRequiredDescription
targetStringYesSpecialized target node: brain, checkin, base-aggregator, bsc-aggregator, arbitrum-aggregator, optimism-aggregator, solana-aggregator (or jupiter), zerox (or 0x), openocean, alchemy, binance, base-rpc, news, or ping.
pathStringOptionalSub-route path for target service (e.g. /1/swap, /base/quote, /solana/swap-instructions, or arb-mainnet).
methodStringOptionalHTTP Method for upstream target (defaults to POST / request method).
paramsObjectOptionalQuery string parameters key-value object (also supports query params on GET).
bodyObjectOptionalJSON payload passed directly to target service (raw JSON-RPC payloads are also supported for RPC targets).
headersObjectOptionalOptional upstream header overrides (e.g. 0x-api-key).

24/7 Spot Auto-Trade Engine

Moonlist Auto-Trade is a 100% live, non-custodial 24/7 spot execution system running on Base Mainnet (Chain ID 8453). Users retain full self-custody of funds inside the verified MoonlistAutoTradeVault smart contract while the Cloudflare Workers engine evaluates rules and AI Auto-Pilot signals every minute around the clock.

Try it Live: Manage your Vault, automated spot buy/sell rules, and AI Auto-Pilot visually at ai.moonlist.app or inside the Moonlist mobile app.

Auto-Trade Engine Base URL

REST https://trade.moonlist.site

Authenticated engine endpoints require the X-MOONLIST-ENGINE-KEY header (GET /health is public). All spot executions enforce live-price verification (static fallback prices can never trigger trades), +35% gas headroom, and strict on-chain receipt confirmation (status === 1) before advancing rule state.

Supported Base Mainnet Spot Assets

SymbolAsset NameSettlementExecution Network
BTCCoinbase Wrapped BTC (cbBTC)USDCBase Mainnet (8453)
ETHWrapped Ether (WETH)USDCBase Mainnet (8453)
SOLWrapped Solana (SOL)USDCBase Mainnet (8453)
LINKChainlink (LINK)USDCBase Mainnet (8453)
AAVEAave (AAVE)USDCBase Mainnet (8453)
AEROAerodrome Finance (AERO)USDCBase Mainnet (8453)
UNIUniswap (UNI)USDCBase Mainnet (8453)

Non-Custodial Vault v2 Smart Contract

All user funds are held strictly on-chain inside the verified MoonlistAutoTradeVault v2 contract on Base Mainnet. The keeper can only execute authorized swaps within each user's configured limits and can never withdraw funds to an external address.

BASE L2 0x478b0eD29b2fa45ab07174604DDc4B6345C36bdE
BaseScan

Security & Execution Architecture

FeatureSpecification
Self-Custody WithdrawalsOnly the depositing wallet can call withdrawToken or emergencyWithdrawAll(address[]) at any time, even if the automation engine is offline.
Post-Swap FeeFlat 0.03% (3 bps) post-swap fee on executed spot swaps. Zero deposit or withdrawal fees.
Oracle Slippage GuardIntegrates Base Chainlink USD price feeds on-chain to bound execution slippage and protect against MEV/sandwich attacks.
Native ETH GuardContract receive() explicitly rejects direct native ETH transfers so funds cannot be accidentally stranded; all trading uses ERC-20 tokens (USDC + spot tokens).
Atomic Balance SyncEngine reads all 8 user Vault token balances + authorization flags in a single atomic Base Multicall3 (0xcA11bde05977b3631167028862bE2a173976CA11) call with parallel multi-RPC failover.

Core Vault ABI Signatures

Solidity / ethers.js v6 Vault ABI
const VAULT_ADDRESS = "0x478b0eD29b2fa45ab07174604DDc4B6345C36bdE"; // Base Mainnet
const USDC_BASE     = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";

const VAULT_ABI = [
  "function depositToken(address token, uint256 amount) external",
  "function withdrawToken(address token, uint256 amount) external",
  "function emergencyWithdrawAll(address[] calldata tokens) external",
  "function setUserConfig(bool autoTradeEnabled, bool aiAutoPilotEnabled, bool restrictTokens, uint16 maxSlippageBps) external",
  "function balances(address user, address token) external view returns (uint256)"
];

// 1. Approve USDC & deposit into Vault
// await usdc.approve(VAULT_ADDRESS, amount);
// await vault.depositToken(USDC_BASE, amount);

// 2. Authorize 24/7 Auto-Trade (e.g. 1.5% max slippage = 150 bps)
// await vault.setUserConfig(true, true, false, 150);

Auto-Trade REST API Reference

All user-scoped endpoints live under https://trade.moonlist.site/users/:userId/... and authenticate via the X-MOONLIST-ENGINE-KEY header.

Method & EndpointDescription
GET /health Public health check returning engine mode, Vault v2 address, and list of supported spot symbols.
GET /prices Returns real-time spot prices and token metadata for all supported Base spot assets.
GET /users/:userId/state Returns live atomic Multicall3 Vault balances (onChainSynced), total Vault equity in USD, active/completed rules, trade execution history, and AI Auto-Pilot config.
POST /users/:userId/wallet Binds the user's EVM wallet address (walletAddress) and optional fcmToken for instant background push alerts.
POST /users/:userId/rules Creates a live 24/7 spot trading rule. Supported types: BUY_SELL_PAIR, BUY_LIMIT, SELL_LIMIT, SELL_BUY_PAIR, OCO_TP_SL, TRAILING_TP, DCA. Enforces buyPrice < sellPrice on paired rules.
PATCH /users/:userId/rules/:ruleId Updates an existing rule (enabled, buyPrice, sellPrice, stopLossPrice, repeatLoop, amountUsd).
DELETE /users/:userId/rules/:ruleId Permanently removes a trading rule.
PUT /users/:userId/ai-config Configures 24/7 AI Auto-Pilot risk profile, max allocation, stop-loss/take-profit thresholds, and allowed spot symbols.
POST /users/:userId/kill-switch Instant Stop control ({ "active": true }). Immediately halts all automated rules and disables AI Auto-Pilot.
POST /users/:userId/fcm-token Registers a Firebase Cloud Messaging device token for background OS push notifications whenever a rule or AI trade fills.

Example: Create a Looping Buy/Sell Spot Rule

POST https://trade.moonlist.site/users/:userId/rules
curl -X POST https://trade.moonlist.site/users/USER_ID/rules \
  -H "Content-Type: application/json" \
  -H "X-MOONLIST-ENGINE-KEY: YOUR_ENGINE_API_KEY" \
  -d '{
    "symbol": "ETH",
    "chain": "Base",
    "type": "BUY_SELL_PAIR",
    "amountUsd": 50,
    "buyPrice": 2850,
    "sellPrice": 3150,
    "repeatLoop": true,
    "label": "ETH Base Range Loop"
  }'

AI Auto-Pilot & Natural Language Rules

When AI Auto-Pilot is enabled both on-chain (setUserConfig) and via PUT /users/:userId/ai-config, the 24/7 engine evaluates live Base spot market momentum and executes disciplined spot entries and exits within the user's strict USD allocation and stop-loss bounds.

PUT https://trade.moonlist.site/users/:userId/ai-config
{
  "enabled": true,
  "riskProfile": "balanced",
  "maxAllocationUsd": 250,
  "maxOpenPositions": 3,
  "allowedSymbols": ["BTC", "ETH", "SOL", "AERO"],
  "stopLossPct": 5,
  "takeProfitPct": 12
}
Natural Language Control: Users can also create rules in plain English directly inside Moonlist AI (e.g., "Buy $50 of ETH when it drops to $2,850 and sell at $3,150") with automatic validation that the buying price is strictly lower than the selling price.

Target: Brain & Checkin (AI Intent Engine)

Converts unformatted human language or agent prompt text into structured on-chain transaction execution commands (COMMAND:SWAP:..., COMMAND:SEND:...). The proxy automatically injects the latest 5 Moonlist News posts from Firestore and enforces chain-locked routing protocols (preventing L2 swaps on Base, Arbitrum, or Optimism from being misrouted as bridges). Use target: "checkin" for daily check-in verification.

POST /v1 (target: brain)
{
  "target": "brain",
  "body": {
    "query": "Swap 1 ETH for USDC on Base",
    "portfolio": [],
    "currency": "USD"
  }
}

Moonlist On-Chain SwapAggregators

Direct, non-custodial on-chain liquidity aggregation across Uniswap V2/V3/V4, Aerodrome, Velodrome, PancakeSwap V2/V3, BiSwap V2, Thena, SushiSwap V2, and Camelot V2 with multi-RPC failover.

TargetChain IDRouter AddressAggregated DEX Sources
base-aggregator 8453 (Base) 0x46Bd944F62E884040562Fc4Ca222B0a077371423 Uniswap V4, Aerodrome, Uniswap V3, Uniswap V2, BaseSwap V2
bsc-aggregator 56 (BSC) 0x7B6c372161CD5DEfbeA88252418C14dA8c5583Bb PancakeSwap V2/V3, BiSwap V2, Uniswap V2/V3/V4, Thena
arbitrum-aggregator 42161 (Arbitrum) 0xC1249B322B2EcbCE99A35DbA9213959ED0d818c4 Uniswap V4, Uniswap V3, PancakeSwap V3, Uniswap V2, SushiSwap V2, Camelot V2
optimism-aggregator 10 (Optimism) 0x232fD9520313d9D9Ef4A248b871f3658279adEE7 Uniswap V4, Velodrome V2, Uniswap V3, Uniswap V2

Target: Solana Aggregator (Jupiter)

Invoke target: "solana-aggregator" (or alias "jupiter") for Solana SPL & Token-2022 quotes and swap instructions powered by Jupiter with atomic SOL fee routing.

POST /v1 (target: solana-aggregator)
{
  "target": "solana-aggregator",
  "body": {
    "sellToken": "So11111111111111111111111111111111111111112",
    "buyToken": "EPjFWdd5AufqztqjnqAv3S4wd3ldYyombl63GF8Vgcyq",
    "sellAmount": "1000000000",
    "taker": "YOUR_SOLANA_WALLET"
  }
}

Target: 0x (Solana & Cross-Chain DEX)

Execute institutional DEX swaps on Solana and cross-chain routes via api.0x.org (supports 0x-version: v2 for /v2/ paths). When calling /solana/swap-instructions, the gateway automatically falls back to solana-aggregator (Jupiter) if 0x instructions are unavailable.

POST /v1 (target: zerox - Solana Quote)
{
  "target": "zerox",
  "path": "/solana/swap/v1/quote",
  "method": "GET",
  "params": {
    "sellToken": "So11111111111111111111111111111111111111112",
    "buyToken": "EPjFWdd5AufqztqjnqAv3S4wd3ldYyombl63GF8Vgcyq",
    "sellAmount": "1000000000",
    "taker": "YOUR_SOLANA_WALLET"
  }
}

Target: OpenOcean / DE1 Exchange (EVM Aggregation)

Multi-chain liquidity routing via open-api.de1.exchange/v4 (and /v1 for Solana). Quote and swap paths for Base (8453), BSC (56), Arbitrum (42161), and Optimism (10) are automatically intercepted and executed through Moonlist's On-Chain SwapAggregators for lower latency and deeper local DEX coverage.

POST /v1 (target: openocean - EVM Swap Quote)
{
  "target": "openocean",
  "path": "/1/swap",
  "params": {
    "inTokenAddress": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
    "outTokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "amountDecimals": "1000000000000000000",
    "slippage": "1",
    "account": "YOUR_EVM_ADDRESS",
    "referrer": "0xC4DcEF92c168256BA9463EB6f96aD3dEfba0Be58"
  }
}

Target: Alchemy (Multi-Chain Audit RPC)

Direct proxy to high-speed Alchemy nodes with automatic primary/fallback key rotation on 429 rate limits, plus automatic fallback to api.mainnet-beta.solana.com for solana-mainnet. Specify target network in path (e.g. eth-mainnet, base-mainnet, arb-mainnet, opt-mainnet, polygon-mainnet, solana-mainnet).

POST /v1 (target: alchemy - Token Balances RPC)
{
  "target": "alchemy",
  "path": "base-mainnet",
  "body": {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "alchemy_getTokenBalances",
    "params": ["0xYOUR_WALLET_ADDRESS"]
  }
}

Target: Binance Web3 Engine

Access Binance Web3 Build endpoints with automatic server-side HMAC-SHA256 signature generation.

POST /v1 (target: binance)
{
  "target": "binance",
  "path": "/wallet/asset/list",
  "method": "POST",
  "body": {}
}

Target: Base L2 RPC (Coinbase CDP + Failover)

Direct JSON-RPC node connection to Coinbase Developer Platform Base L2 mainnet infrastructure with automatic failover to primary and fallback Alchemy Base nodes.

POST /v1 (target: base-rpc)
{
  "target": "base-rpc",
  "body": {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_blockNumber",
    "params": []
  }
}

Target: Moonlist News

Fetch real-time market intelligence, protocol updates, and research posts directly from Moonlist editors.

POST /v1 (target: news)
{
  "target": "news",
  "method": "GET"
}

Target: Ping (Health Check)

Fast heartbeat check to verify Gateway connectivity and API key validity.

POST /v1 (target: ping)
{
  "target": "ping"
}

Error Status Codes

The Unified Gateway uses standard HTTP status codes to communicate execution results.

Status CodeStatus NameDescription & Resolution
200 OK Success Request executed successfully by upstream target engine.
401 Unauthorized Missing Key Missing or invalid X-MOONLIST-KEY header. Check Developer Console credentials.
402 Payment Required Subscription Required API Key has no active subscription. Upgrade plan in Developer Console.
400 Bad Request Invalid Payload Missing target parameter or malformed JSON payload body.
500 Internal Error Upstream Failure Upstream network connection error or target provider rate limit.

Billing & Subscriptions

Moonlist API operates on a predictable flat-rate monthly tier for developer and institutional access.

  • Plan: Institutional Pro
  • Monthly Rate: $100.00 / Month (Payable in USDT / USDC)
  • Supported Payment Chains: Ethereum, BSC, Base L2, Polygon
  • Quota: 5,000 requests per monthly billing cycle
  • Treasury Address: 0xC4DcEF92c168256BA9463EB6f96aD3dEfba0Be58