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.
https://moleswap-eight.vercel.app/api/v1Chain ID: 42101PushChain Donut TestnetQuick 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.
Rate limit info is included in response headers:
X-RateLimit-Remaining: 57
X-RateLimit-Reset: 1711234627POST /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 pairs5000.05%Most common — used by majority of pools30000.3%Volatile pairs100001%Exotic / low-liquidity pairsMulti-Hop Routing
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
/api/v1/tokensReturns all supported PRC-20 tokens on PushChain, along with the core AMM contract addresses.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chain | string | Optional | Filter by source chain: Ethereum, Solana, Base, Arbitrum, BNB Chain, Push Chain |
search | string | Optional | Search 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
List Pools
/api/v1/poolsReturns all live AMM pools with real-time on-chain data: current price, liquidity, tick, and fee tier.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
includeEmpty | boolean | Optional | Include pools with zero liquidity. Default: false |
Examples
curl "https://moleswap-eight.vercel.app/api/v1/pools"Try it
Pool Detail
/api/v1/pool/:addressGet detailed data for a single pool, including token balances held by the pool contract.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
address | address | Required | Pool contract address |
Examples
# pETH/WPC pool
curl "https://moleswap-eight.vercel.app/api/v1/pool/0x012d5C099f8AE00009f40824317a18c3A342f622"Try it
Swap Quote
/api/v1/quoteGet 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
| Parameter | Type | Required | Description |
|---|---|---|---|
tokenIn | address | Required | Input token address. Use 0x000...000 for native PC. |
tokenOut | address | Required | Output token address |
amountIn | string | Required | Input amount in WEI (raw BigInt string) |
fee | number | Optional | Fee tier override: 100, 500, 3000, or 10000 |
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
Build Swap TX
/api/v1/tx/swapReturns 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
| Parameter | Type | Required | Description |
|---|---|---|---|
tokenIn | address | Required | Input token address |
tokenOut | address | Required | Output token address |
amountIn | string | Required | Amount in WEI |
recipient | address | Required | Address to receive output tokens |
amountOutMin | string | Optional | Minimum output amount. Auto-calculated from slippageBps if omitted. |
slippageBps | number | Optional | Slippage tolerance in basis points. Default: 50 (0.5%) |
fee | number | Optional | Fee tier override |
deadline | number | Optional | Unix timestamp deadline. Default: +30 minutes |
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
Create Pool
/api/v1/tx/create-poolBuild 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
| Parameter | Type | Required | Description |
|---|---|---|---|
tokenA | address | Required | First token address |
tokenB | address | Required | Second token address (typically WPC) |
recipient | address | Required | Address to receive the LP position NFT |
fee | number | Optional | Fee tier: 100, 500, 3000, 10000. Default: 500 |
initialPrice | number | Optional | Starting price of token0 in terms of token1 |
amount0Desired | string | Optional | Initial liquidity for token0 (wei) |
amount1Desired | string | Optional | Initial liquidity for token1 (wei) |
tickLower | number | Optional | Lower tick bound. Default: full range |
tickUpper | number | Optional | Upper tick bound. Default: full range |
slippageBps | number | Optional | Slippage tolerance. Default: 100 (1%) |
type field will be add_liquidity_existing instead of create_pool.Try it
Add Liquidity
/api/v1/tx/add-liquidityBuild calldata to add liquidity to an existing pool via the NonfungiblePositionManager. Returns wrap, approve, and mint steps.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
token0 | address | Required | First token address |
token1 | address | Required | Second token address |
amount0Desired | string | Required | Amount of token0 in WEI |
amount1Desired | string | Required | Amount of token1 in WEI |
recipient | address | Required | Address to receive the LP position NFT |
fee | number | Optional | Fee tier. Default: 500 |
tickLower | number | Optional | Lower tick. Default: full range |
tickUpper | number | Optional | Upper tick. Default: full range |
slippageBps | number | Optional | Slippage. Default: 50 (0.5%) |
Try it
Token Launcher Guide
Launch your token on MoleSwap and make it instantly swappable against all 19 tokens in the ecosystem.
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/sdkUsage
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/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).
| Contract | Address | Description |
|---|---|---|
| Factory | 0x81b8Bca02580C7d6b636051FDb7baAC436bFb454 | Creates new pools, stores pool registry |
| SwapRouter | 0x5D548bB9E305AAe0d6dc6e6fdc3ab419f6aC0037 | Executes swaps (exactInputSingle, exactOutputSingle) |
| QuoterV2 | 0x83316275f7C2F79BC4E26f089333e88E89093037 | Off-chain swap quotes (no gas cost) |
| PositionManager | 0xf9b3ac66aed14A2C7D9AA7696841aB6B27a6231e | Manages liquidity positions (mint, collect, burn) |
| WPC | 0xE17DD2E0509f99E9ee9469Cf6634048Ec5a3ADe9 | Wrapped Push Chain (WETH9 equivalent) |
| TickLens | 0xb64113Fc16055AfE606f25658812EE245Aa41dDC | Read tick data for pools |
| Multicall | 0xa8c00017955c8654bfFbb6d5179c99f5aB8B7849 | Batch 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
}
}