MoleSwap API Documentation

Integrate with MoleSwap DEX on PushChain. Get swap quotes, build transactions, create pools, and add liquidity — all through a simple REST API.

Base URL: https://moleswap-eight.vercel.app/api/v1Chain ID: 42101PushChain Donut Testnet
Quick Start
Get your first swap quote in 30 seconds
💱
Swap Quotes
Real-time pricing with auto multi-hop routing
🚀
Launch a Token
Create a pool and go live in 5 steps
📦
SDK Reference
TypeScript SDK for cleaner integration

Quick Start

Get a swap quote from the MoleSwap API in under 30 seconds. No API key needed.

1. Get a Swap Quote

Fetch a real-time quote for swapping 1 PC (Push Chain native token) to pETH:

curl "https://moleswap-eight.vercel.app/api/v1/quote?tokenIn=0x0000000000000000000000000000000000000000&tokenOut=0x2971824Db68229D087931155C2b8bB820B275809&amountIn=1000000000000000000"

2. Build a Swap Transaction

Get unsigned calldata to execute the swap. Your backend signs and submits — we never touch private keys.

curl -X POST "https://moleswap-eight.vercel.app/api/v1/tx/swap" \
  -H "Content-Type: application/json" \
  -d '{
    "tokenIn": "0x0000000000000000000000000000000000000000",
    "tokenOut": "0x2971824Db68229D087931155C2b8bB820B275809",
    "amountIn": "1000000000000000000",
    "recipient": "0xYOUR_WALLET_ADDRESS",
    "slippageBps": 50
  }'

Authentication

The MoleSwap API is public — no API key required. All endpoints are rate-limited per IP address.

Read endpoints (GET)
60 requests / minute
Write endpoints (POST)
20 requests / minute

Rate limit info is included in response headers:

X-RateLimit-Remaining: 57
X-RateLimit-Reset: 1711234627
💡
No private keys needed
The POST /tx/* endpoints return unsigned transaction calldata. Your backend signs and submits the transactions with your own wallet. MoleSwap never handles private keys.

Core Concepts

Token Addresses

All tokens on PushChain are PRC-20 (ERC-20 equivalent). Use the zero address 0x000...000 for native PC. The API automatically handles wrapping PC → WPC when needed.

WPC (Wrapped Push Chain)

WPC is the wrapped version of the native PC token, similar to WETH on Ethereum. All AMM pools are paired against WPC. When you swap from native PC, the API automatically includes a wrap step.

Fee Tiers

Pools use Uniswap V3-style concentrated liquidity with these fee tiers:

1000.01%Stablecoin pairs
5000.05%Most common — used by majority of pools
30000.3%Volatile pairs
100001%Exotic / low-liquidity pairs

Multi-Hop Routing

🔄
Automatic route discovery
When no direct pool exists for a token pair, the API automatically routes through WPC as an intermediary. For example, pETH → USDC.eth routes as pETH → WPC → USDC.eth. This is our custom routing logic — not provided by PushChain out of the box. Any new token paired with WPC is instantly swappable against all other tokens in the ecosystem.

Response Format

All responses follow this structure:

{
  "success": true,
  "data": { ... },
  "timestamp": 1711234567890
}

List Tokens

GET/api/v1/tokens

Returns all supported PRC-20 tokens on PushChain, along with the core AMM contract addresses.

Query Parameters

ParameterTypeRequiredDescription
chainstringOptionalFilter by source chain: Ethereum, Solana, Base, Arbitrum, BNB Chain, Push Chain
searchstringOptionalSearch by symbol, name, or contract address

Examples

# All tokens
curl "https://moleswap-eight.vercel.app/api/v1/tokens"

# Filter by source chain
curl "https://moleswap-eight.vercel.app/api/v1/tokens?chain=Solana"

# Search by symbol
curl "https://moleswap-eight.vercel.app/api/v1/tokens?search=USDC"

Try it

API Playground🟢 Live

List Pools

GET/api/v1/pools

Returns all live AMM pools with real-time on-chain data: current price, liquidity, tick, and fee tier.

Query Parameters

ParameterTypeRequiredDescription
includeEmptybooleanOptionalInclude pools with zero liquidity. Default: false

Examples

curl "https://moleswap-eight.vercel.app/api/v1/pools"

Try it

API Playground🟢 Live

Pool Detail

GET/api/v1/pool/:address

Get detailed data for a single pool, including token balances held by the pool contract.

Path Parameters

ParameterTypeRequiredDescription
addressaddressRequiredPool contract address

Examples

# pETH/WPC pool
curl "https://moleswap-eight.vercel.app/api/v1/pool/0x012d5C099f8AE00009f40824317a18c3A342f622"

Try it

API Playground🟢 Live

Swap Quote

GET/api/v1/quote

Get a real-time swap quote from the on-chain QuoterV2 contract. Supports direct pool swaps and automatic multi-hop routing through WPC for pairs without a direct pool.

Query Parameters

ParameterTypeRequiredDescription
tokenInaddressRequiredInput token address. Use 0x000...000 for native PC.
tokenOutaddressRequiredOutput token address
amountInstringRequiredInput amount in WEI (raw BigInt string)
feenumberOptionalFee tier override: 100, 500, 3000, or 10000
🧠
Amounts are in WEI
All amounts use raw WEI format (no decimals). For a token with 18 decimals, 1 token = 1000000000000000000 (1e18). For 6-decimal tokens like USDC, 1 USDC = 1000000 (1e6).

Examples

# Direct swap: 1 PC → pETH
curl "https://moleswap-eight.vercel.app/api/v1/quote?tokenIn=0x0000000000000000000000000000000000000000&tokenOut=0x2971824Db68229D087931155C2b8bB820B275809&amountIn=1000000000000000000"

# Multi-hop: 0.1 pETH → USDC.eth (routes through WPC automatically)
curl "https://moleswap-eight.vercel.app/api/v1/quote?tokenIn=0x2971824Db68229D087931155C2b8bB820B275809&tokenOut=0x387b9C8Db60E74999aAAC5A2b7825b400F12d68E&amountIn=100000000000000000"

Try it

API Playground🟢 Live

Build Swap TX

POST/api/v1/tx/swap

Returns unsigned transaction calldata for executing a swap. Includes wrap, approve, and swap steps as needed. Your backend signs and submits each transaction sequentially.

Request Body

ParameterTypeRequiredDescription
tokenInaddressRequiredInput token address
tokenOutaddressRequiredOutput token address
amountInstringRequiredAmount in WEI
recipientaddressRequiredAddress to receive output tokens
amountOutMinstringOptionalMinimum output amount. Auto-calculated from slippageBps if omitted.
slippageBpsnumberOptionalSlippage tolerance in basis points. Default: 50 (0.5%)
feenumberOptionalFee tier override
deadlinenumberOptionalUnix timestamp deadline. Default: +30 minutes
⚠️
Sequential execution required
The transactions array must be executed in order. Wait for each transaction to confirm on-chain before sending the next one. Sending them simultaneously will cause failures.

Try it

API Playground🟠 Live

Create Pool

POST/api/v1/tx/create-pool

Build calldata to create a new pool on the Uniswap V3 Factory, initialize it with a starting price, and optionally seed initial liquidity — all in one API call.

Request Body

ParameterTypeRequiredDescription
tokenAaddressRequiredFirst token address
tokenBaddressRequiredSecond token address (typically WPC)
recipientaddressRequiredAddress to receive the LP position NFT
feenumberOptionalFee tier: 100, 500, 3000, 10000. Default: 500
initialPricenumberOptionalStarting price of token0 in terms of token1
amount0DesiredstringOptionalInitial liquidity for token0 (wei)
amount1DesiredstringOptionalInitial liquidity for token1 (wei)
tickLowernumberOptionalLower tick bound. Default: full range
tickUppernumberOptionalUpper tick bound. Default: full range
slippageBpsnumberOptionalSlippage tolerance. Default: 100 (1%)
💡
Pool already exists?
If the pool already exists, the API skips the createPool and initialize steps and returns only the liquidity provision transactions. The response type field will be add_liquidity_existing instead of create_pool.

Try it

API Playground🟠 Live

Add Liquidity

POST/api/v1/tx/add-liquidity

Build calldata to add liquidity to an existing pool via the NonfungiblePositionManager. Returns wrap, approve, and mint steps.

Request Body

ParameterTypeRequiredDescription
token0addressRequiredFirst token address
token1addressRequiredSecond token address
amount0DesiredstringRequiredAmount of token0 in WEI
amount1DesiredstringRequiredAmount of token1 in WEI
recipientaddressRequiredAddress to receive the LP position NFT
feenumberOptionalFee tier. Default: 500
tickLowernumberOptionalLower tick. Default: full range
tickUppernumberOptionalUpper tick. Default: full range
slippageBpsnumberOptionalSlippage. Default: 50 (0.5%)

Try it

API Playground🟠 Live

Token Launcher Guide

Launch your token on MoleSwap and make it instantly swappable against all 19 tokens in the ecosystem.

1
Deploy your PRC-20 token
Deploy a standard ERC-20 token contract on PushChain Donut Testnet (RPC: https://evm.donut.rpc.push.org/, Chain ID: 42101).
2
Call POST /api/v1/tx/create-pool
Pair your token with WPC. Set an initial price and seed amounts. The API returns all unsigned calldata needed.
3
Sign & send the transactions
Execute sequentially: createPool → initialize → wrap (if needed) → approve × 2 → mint. Wait for each to confirm on-chain.
4
Your token is now swappable!
Users can swap via the MoleSwap UI or directly through the API. Use GET /api/v1/quote for price feeds.
5
Integrate swaps in your app
Use POST /api/v1/tx/swap to build swap calldata for your users. Your frontend signs it. Our multi-hop router automatically enables swaps between your token and every other token.
🌐
Instant ecosystem access
By creating just one pool against WPC, your token becomes swappable against all other tokens in the MoleSwap ecosystem through our automatic multi-hop routing. You don't need to create pools against every individual token.

Example: Full token launch flow

import { ethers } from "ethers";

const MOLESWAP_API = "https://moleswap-eight.vercel.app/api/v1";
const YOUR_TOKEN = "0xYOUR_DEPLOYED_TOKEN_ADDRESS";
const WPC = "0xE17DD2E0509f99E9ee9469Cf6634048Ec5a3ADe9";

// 1. Build create-pool transaction
const res = await fetch(`${MOLESWAP_API}/tx/create-pool`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    tokenA: YOUR_TOKEN,
    tokenB: WPC,
    fee: 500,                               // 0.05% fee tier
    initialPrice: 0.001,                    // 1 token = 0.001 WPC
    amount0Desired: "1000000000000000000000", // 1000 tokens
    amount1Desired: "1000000000000000000",    // 1 WPC
    recipient: wallet.address,
  })
});
const { data } = await res.json();
console.log(data.description); // "Create new pool and seed liquidity"

// 2. Execute each transaction sequentially
const provider = new ethers.JsonRpcProvider("https://evm.donut.rpc.push.org/");
const signer = new ethers.Wallet("YOUR_PRIVATE_KEY", provider);

for (const tx of data.transactions) {
  console.log("→", tx.description);
  const sent = await signer.sendTransaction({
    to: tx.to,
    value: tx.value,
    data: tx.data,
  });
  await sent.wait();
  console.log("  ✅ Confirmed:", sent.hash);
}

// 3. Verify — your token is now quotable!
const quoteRes = await fetch(
  `${MOLESWAP_API}/quote?tokenIn=${YOUR_TOKEN}&tokenOut=${WPC}&amountIn=1000000000000000000`
);
const quote = await quoteRes.json();
console.log("Quote:", quote.data);

TypeScript SDK

The MoleSwap SDK wraps all API calls with full TypeScript types for a cleaner integration experience.

Installation

npm install @moleswap/sdk

Usage

import { MoleSwap } from "@moleswap/sdk";

// Initialize (defaults to production URL)
const mole = new MoleSwap();

// Or with custom URL
const mole = new MoleSwap("https://your-deployment.vercel.app");

// ═══ READ DATA ═══

const { tokens } = await mole.getTokens();
const { pools } = await mole.getPools();
const pool = await mole.getPool("0x012d5C...");

// ═══ GET QUOTES ═══

const quote = await mole.getQuote({
  tokenIn: "0x0000000000000000000000000000000000000000",
  tokenOut: "0x2971824Db68229D087931155C2b8bB820B275809",
  amountIn: "1000000000000000000",
});
// quote.type = "direct" | "multi_hop" | "wrap_unwrap"

// ═══ BUILD TRANSACTIONS ═══

const swap = await mole.buildSwapTx({
  tokenIn: "0x000...000",
  tokenOut: "0x297...809",
  amountIn: "1000000000000000000",
  recipient: "0xYOUR_WALLET",
});
// swap.transactions = [{ to, value, data, description }]

const pool = await mole.buildCreatePoolTx({
  tokenA: "0xYOUR_TOKEN",
  tokenB: "0xE17DD2...DE9",  // WPC
  fee: 500,
  initialPrice: 0.001,
  amount0Desired: "1000000000000000000000",
  amount1Desired: "1000000000000000000",
  recipient: "0xYOUR_WALLET",
});

// ═══ HELPERS ═══

mole.getExplorerUrl("0xTX_HASH");
// → "https://donut.push.network/tx/0xTX_HASH"
📝
SDK availability
The SDK source is in the repo at sdk/index.ts. It will be published to npm as@moleswap/sdk. In the meantime, you can copy the file directly into your project.

Contract Addresses

All contracts are deployed on PushChain Donut Testnet (Chain ID: 42101).

ContractAddressDescription
Factory0x81b8Bca02580C7d6b636051FDb7baAC436bFb454Creates new pools, stores pool registry
SwapRouter0x5D548bB9E305AAe0d6dc6e6fdc3ab419f6aC0037Executes swaps (exactInputSingle, exactOutputSingle)
QuoterV20x83316275f7C2F79BC4E26f089333e88E89093037Off-chain swap quotes (no gas cost)
PositionManager0xf9b3ac66aed14A2C7D9AA7696841aB6B27a6231eManages liquidity positions (mint, collect, burn)
WPC0xE17DD2E0509f99E9ee9469Cf6634048Ec5a3ADe9Wrapped Push Chain (WETH9 equivalent)
TickLens0xb64113Fc16055AfE606f25658812EE245Aa41dDCRead tick data for pools
Multicall0xa8c00017955c8654bfFbb6d5179c99f5aB8B7849Batch multiple calls in one transaction

Network Details

{
  "chainId": 42101,
  "chainName": "PushChain Donut Testnet",
  "rpcUrl": "https://evm.donut.rpc.push.org/",
  "explorer": "https://donut.push.network",
  "nativeCurrency": {
    "name": "Push Chain",
    "symbol": "PC",
    "decimals": 18
  }
}