agentsvc.io

services / token-simulate

financeoperational · 1263 ms

Token Buy and Sell Simulation (Honeypot Test)

Replays a real buy and sell of the token on chain state and tells you if you can get out again: buy_succeeded, sell_succeeded, buy and sell tax in percent, honeypot reason, estimated round-trip cost in percent and USD for amount_usd, plus the pools used. Use before buying an unknown token or in a trading bot. EVM chains are simulated; Solana returns status not_simulated with authority and pool checks. No liquidity returns status no_liquidity. Cost excludes LP fees and gas.

Run free trial ↗3 free calls per day with the example input. Paid: $0.012 USDC, no limit.

Call it

import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agentsvc.io/api/v1/proxy/token-simulate", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({"token":"0x532f27101965dd16442E59d40670FaF5eBB142E4","chain":"base","amount_usd":100}),
});
const { data, payment } = await res.json();  // payment.status "settling"; header X-Payment-Settle: sync returns payment.transaction

Input

FieldTypeDescription
token *stringToken contract address (0x...)
chainstringbase (default), ethereum, bsc, arbitrum, polygon, avalanche or optimism
amount_usdnumber = 100Trade size in USD, 1 to 100000

Output

FieldTypeDescription
statusstring
buy_succeededboolean
sell_succeededboolean
buy_tax_percentnumber
sell_tax_percentnumber
roundtrip_cost_percentnumber
honeypot_reasonstring
poolsarray