foxd-sdk
v0.3.1
Published
Typed TypeScript SDK for multi-chain memecoin trading — Solana sniper, Pump.fun/BONK.fun/Raydium LaunchLab launches, honeypot checks, copy trading and MEV-protected execution across Solana, Ethereum, BNB Chain, Base, Arbitrum and HyperEVM. An open alterna
Downloads
951
Maintainers
Keywords
Readme
foxd-sdk — Solana sniper & multi-chain memecoin trading SDK
Typed TypeScript client for FoxD. One SDK for token discovery, honeypot and rug checks, sniping, copy trading, automated orders and multi-launchpad token launching across Solana, Ethereum, BNB Chain, Base, Arbitrum and HyperEVM.
An open, programmable alternative to GMGN, Banana Gun, Photon and Trojan — the same jobs, as a library you call from your own code, fully typed.
npm i foxd-sdkWhat you can build
| You want to… | Use |
| --- | --- |
| A Solana sniper bot on new Pump.fun / BONK.fun / Raydium LaunchLab mints | sniper.feed → trade.execute |
| A Base or BNB memecoin bot — Clanker, four.meme, Uniswap V4 | market.trending → trade.quote |
| A honeypot / rug checker | analytics.security + analytics.simulateHoneypot |
| Copy trading — rank wallets, backtest them, mirror them | copyIntel.leaderboard → copyIntel.backtest → copyExec.subscribe |
| Take-profit, stop-loss and trailing stops that run server-side | automation.placeTakeProfit / placeStopLoss / placeTrailingStop |
| Launch a token across several launchpads at once | launch.quote → launch.create |
| Signed webhooks instead of polling | alerts.subscribe |
87 tools across 13 modules — the full list is at https://foxd.xyz/api/v1.
Chains, launchpads and venues
| Chain | Launchpads | DEXes | | --- | --- | --- | | Solana | Pump.fun, BONK.fun, Raydium LaunchLab, Bags, Jupiter Studio | Raydium, Meteora, Orca, Pump AMM | | BNB Chain | four.meme | PancakeSwap V2/V3 | | Base | Clanker, Zora, Bankr, Flaunch | Uniswap V2/V3/V4, Aerodrome | | Ethereum | — | Uniswap V2/V3/V4 | | Arbitrum | — | Uniswap, Camelot V2/V3 | | HyperEVM | Alt.fun, Hypurr | HyperSwap, Kittenswap |
MEV-protected execution, custodial wallets bindable per API key, and a rolling 24-hour USD spend cap on every key. 0.5% fee on trades; API access is free during early access.
import { FoxD } from "foxd-sdk";
const foxd = new FoxD({ apiKey: process.env.FOXD_API_KEY });
const { tokens } = await foxd.market.trending({ chain: "base", limit: 10 });
const safety = await foxd.analytics.security({ chain: "base", address: tokens[0].address });Every method, argument and return type comes from
foxd-contract, the same
declaration the REST API, the MCP server and the CLI are built from. There is no
codegen step and nothing to regenerate: a tool added to the contract is callable
here immediately, fully typed.
foxd.market.trending({ chain: "dogecoin" });
// ~~~~~~~~~~ not assignable to "base" | "solana" | …Getting a key
Every tool needs one, and an agent can issue itself one with no browser and no human:
const anon = new FoxD();
const { message } = await anon.auth.challenge({ address: wallet.address });
const signature = await wallet.signMessage({ message });
const { apiKey, wallets } = await anon.auth.verifyWallet({
message,
signature,
address: wallet.address,
scopes: ["read", "wallet:read", "trade:read"],
});That creates the account, provisions an EVM and a Solana custodial wallet, and
returns a key — shown once. For a human in the loop, use the OAuth device flow
(auth.startDeviceLogin → auth.pollDeviceLogin), which covers Google, X,
Telegram, email and wallet sign-in.
Errors and retries
Failures throw a FoxDError carrying the HTTP status, a stable code and, for
validation failures, the offending fields:
import { FoxDError } from "foxd-sdk";
try {
await foxd.trade.execute({ /* … */ });
} catch (e) {
if (e instanceof FoxDError && e.code === "spend_cap_exceeded") { /* … */ }
if (e instanceof FoxDError && e.retryable) { /* 429, 503, 504 */ }
}429, 503 and network failures are retried with backoff, honouring Retry-After.
Tools that mutate are never retried automatically — a timeout does not mean
the write did not land, and replaying a trade is worse than surfacing the
ambiguity.
Options
new FoxD({
apiKey: "fxk_live_…",
baseUrl: "https://foxd.xyz/api/v1", // override for self-hosting
timeoutMs: 30_000,
maxRetries: 2,
fetch: myInstrumentedFetch,
headers: { "x-my-trace": "…" },
});Isomorphic: it uses only fetch, so it runs in Node, Bun, Deno, workers and the
browser. Do not ship a key to a browser you do not control.
Safety
Trading tools spend real money. A key carries only the scopes you grant it, may
be bound to a single wallet, and has a rolling 24-hour USD spend cap — set one
low before pointing an agent at it, and use keys.update to tighten it without
reissuing.
Links
- Documentation: https://foxd.xyz/docs
- Recipes in curl, JS, Python, SDK and CLI: https://foxd.xyz/docs#recipes
- Every endpoint and schema: https://foxd.xyz/api/v1 · OpenAPI 3.1
- MCP server: https://foxd.xyz/api/mcp ·
foxd-mcp - CLI:
foxd-cli
MIT
