ESAPRIME
Docs
IV · BUILD

Integrate Esaprime

Put Esaprime in your token page, bot, wallet, AI agent or contract. No key needed.

PICK YOUR WAY IN
BUY CARD
For token projects

A live "Buy on Esaprime" card for your token page: price, what a buy gets right now and on which venue, and a button that opens Esaprime with your token selected. Copy one line of HTML.

Embed docs
HTTP API
For bots, wallets and Telegram bots

One call returns the route for any amount across every venue, plus the swap transaction to send. No key, 60 requests a minute.

API docs
MCP SERVER
For AI agents

esaprime.xyz/mcp: list tokens, quote, safety check, build an unsigned swap, bridge in, market context and stock tokens. Works in Claude, Cursor, Codex and Nomad. The user's wallet signs.

MCP docs
ROUTER CONTRACTS
For contracts and aggregators

Call StoaRouter from your own contract or front end: quote with an eth_call, then swap with your own limits. Same ABI on Robinhood Chain.

Router docs
EARN 10% AS A REFERRER
Docs →

Name your address as referrer and you earn 10% of Esaprime's 2 bps fee on every swap you send: about $0.02 per $1,000 swapped, in the token the trader received. It works the same in the buy card, the API, the MCP server's build_swap and the router's swap. Earnings are booked to your address in the FeeDistributor contract on-chain, and only your wallet can claim them on Referrals.

USED BY

Listed here means integrated, not endorsed: the buy card and the API are open to anyone. Integrated Esaprime? Tell us on X and we'll add you here.

HTTP API FOR BOTS · NO KEY
Docs →
GET https://esaprime.xyz/api/v1/quote
  ?chain=robinhood&sellToken=native
  &buyToken=0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168
  &amount=10000000000000000&slippageBps=50
  &taker=0xYourWallet&referrer=0xYourWallet
→ { amountOut, minOut, route, tx: { to, data, value } }
MCP SERVER FOR AI AGENTS · NO KEY
Docs →
claude mcp add --transport http stoa https://esaprime.xyz/mcp

# or in any MCP client config
{ "mcpServers": { "stoa": { "url": "https://esaprime.xyz/mcp" } } }
TYPESCRIPT (VIEM) · COMPLETE EXAMPLE
import { createPublicClient, createWalletClient, custom, http, parseUnits } from 'viem'
import { robinhood } from './chain'                 // chain id 4663
import routerAbi from './StoaRouter.json'           // esaprime.xyz/abi/StoaRouter.json

const ROUTER = '0x2F2804fad735a38015650f32f95Ad5E08D6B3eE5'
const USDG = '0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168'
const NATIVE = '0x0000000000000000000000000000000000000000' // ETH
const pub = createPublicClient({ chain: robinhood, transport: http() })
const wallet = createWalletClient({ chain: robinhood, transport: custom(window.ethereum) })
const [me] = await wallet.getAddresses()

// 1. best route across every venue, direct or via WETH (eth_call, free)
const amountIn = parseUnits('1', 18) // 1 ETH
const { result: q } = await pub.simulateContract({
  address: ROUTER, abi: routerAbi, functionName: 'quote', args: [NATIVE, USDG, amountIn],
})

// 2. swap along that route with a 0.5% limit
await wallet.writeContract({
  account: me, address: ROUTER, abi: routerAbi, functionName: 'swap', value: amountIn,
  args: [{ tokenIn: NATIVE, tokenOut: USDG, mid: q.mid, leg1: q.leg1, leg2: q.leg2,
    amountIn, minOut: q.amountOut * 995n / 1000n, to: me,
    deadline: BigInt(Math.floor(Date.now() / 1000) + 120), referrer: NATIVE }], // referrer: your address to earn 10%
})
// ERC-20 input: approve the router for amountIn first (or use swapWithPermit2), and send no value
SOLIDITY
// 1. off-chain: route = router.quote(USDC, WETH, 250e6)  (eth_call)
// 2. on-chain: follow the route with your limits
IStoaRouter.SwapParams memory p = IStoaRouter.SwapParams({
  tokenIn: USDC, tokenOut: WETH,       // address(0) = native ETH
  mid: route.mid,                       // zero for a direct swap
  leg1: route.leg1, leg2: route.leg2,   // allowlisted venues only
  amountIn: 250e6,
  minOut: route.amountOut * 995 / 1000, // 0.5% slippage
  to: msg.sender, deadline: block.timestamp + 60,
  referrer: address(0)
});
IStoaRouter(router).swap(p);

For AI agents: npm i @stoadex/agent-tools (Vercel AI SDK, LangChain, OpenAI). For contracts: use viem or ethers with the router ABI. Download StoaRouter.json

Router and SDK docs
ROBINHOOD CHAIN NETWORK
  • Chain ID 4663
  • WETH 0x0Bd7…AD73
  • USDG 0x5fc5…d168
  • Permit2 0x0000…8BA3
ESAPRIME ON ROBINHOOD CHAIN

On Robinhood Chain the native coin is ETH (address(0)) and the hop token is WETH.