← Back

API Documentation

Two things: a real-time data feed of NAD.fun token creations, buys and sells, and a buy/sell endpoint that charges a small fee per trade.

Pass your key as the X-API-Key header on trade calls, or as ?api_key= on the data stream.

Data stream

Connect over WebSocket to receive every token creation, buy and sell as it happens.

wss://monadtrenches.com/ws?api_key=YOUR_API_KEY

Token creation

{
  "type": "token",
  "trade_type": "create",
  "token_address": "0x…",
  "token_symbol": "SYMBOL",
  "token_name": "Token Name",
  "amount_mon": 26795.57,
  "market_cap_usd": 3847.82,
  "price_mon": 0.000003848,
  "trader": "0x…",
  "contract_version": "V2",
  "block_number": 12345678,
  "timestamp": "2026-01-01T10:30:45.123Z"
}

Buy / sell

{
  "type": "trade",
  "trade_type": "buy",            // or "sell"
  "trading_venue": "bonding_curve", // or "dex"
  "token_address": "0x…",
  "token_symbol": "SYMBOL",
  "amount_mon": 30.0,
  "market_cap_usd": 4278.02,
  "price_mon": 0.000004278,
  "trader": "0x…",
  "tx_hash": "0x…",
  "contract_version": "V1",
  "block_number": 12345679,
  "timestamp": "2026-01-01T10:31:12.456Z"
}
Every message includes contract_version ("V1" or "V2") so you can tell which NAD.fun contract the token uses. Send a WebSocket ping every ~30s to keep the connection alive.

Trades

Call the buy or sell endpoint and it returns a ready transaction (nonce and gas filled in). You sign and broadcast it. A 0.5% fee is included in the calldata on each trade.

POST/api/router/simple/buy

{
  "wallet_address": "0x…",
  "token_address": "0x…",
  "amount_mon": 10.5,
  "slippage_bps": 50        // optional, defaults to 50 (0.5%)
}

Returns a signed-ready transaction object:

{
  "success": true,
  "transaction": {
    "to": "0x…",           // router (or GET /api/router/info)
    "from": "0x…",
    "data": "0x…",
    "value": "10500000000000000000",
    "gas": "180000",
    "max_fee_per_gas": "300000000000",
    "max_priority_fee_per_gas": "100000000000",
    "nonce": 42,
    "chain_id": 143
  }
}

POST/api/router/simple/sell

Approve the router once before your first sell (POST /api/router/approve/build), then:

{
  "wallet_address": "0x…",
  "token_address": "0x…",
  "amount_tokens": "1000000000000000000",  // wei (18 decimals)
  "slippage_bps": 50
}

The response has the same shape as buy — a transaction to sign and broadcast.

Want access? Request a key.