TrenchyToolsAPI

Build with AI

Paste one prompt into Claude Code, Cursor or Codex; the assistant builds against the real API from machine-readable docs.

The API ships three files for coding agents. A prompt that points the assistant at them is enough to get a working bot without reading these docs yourself.

Backups are a rule, not advice. Every prompt here makes the assistant write each generated wallet to disk before funding it, and refuse to fund one that is not saved. Most lost wallets are keys that only ever existed in memory or a terminal. See Wallet backups.
FileWhat it is
AGENTS.mdThe rules: keys stay local, only real endpoints, simulate first, handle errors by code.
openapi.jsonEvery endpoint, field, response and error, generated from these docs and checked against the routes.
llms-full.txtAll pages as plain text, for the assistant to read in one go.
GET https://api.trenchytools.lol/api/chainsLive capability discovery: chains, launchpads, operations, what is live.
Every error the API returns carries code, hint and a docs link, so an assistant can fix its own mistakes without guessing.

Prompts

Copy one, edit the numbers, paste it into your assistant. Each starts with the same rules block.

Sniper bot
Build a Solana sniper bot on the TrenchyTools API.

Before writing any code, read these three documents completely:
- https://trenchytools-docs-production.up.railway.app/AGENTS.md         rules for building on this API
- https://trenchytools-docs-production.up.railway.app/openapi.json      every endpoint, field, response and error code
- https://trenchytools-docs-production.up.railway.app/llms-full.txt     the full documentation as text

Rules you must follow:
- Use only endpoints and fields that appear in openapi.json. Never invent an endpoint, field or response key. If something is missing, say so.
- Private keys never leave this machine. Build with trade-local, sign locally, submit with send. Never use the Lightning (trade) endpoints.
- Every wallet the app generates (trading, funding, bundle wallets, vanity mint keys) must be written to disk BEFORE it is funded: a wallets/ folder next to the project (one JSON per wallet: address, secret, createdAt, label) or .env, and print the absolute path. Refuse to fund a wallet that is not on disk. Never keep keys only in memory or a log.
- Secrets come from .env (TRENCHY_API_KEY, SOL_PRIVATE_KEY). Never hard-code or print them. Write a .env.example.
- Create the API key with GET https://api.trenchytools.lol/api/create-api-key?label=<app> and tell me to put it in .env.
- Simulate with POST /api/sol/simulate before the first real send. Default to DRY_RUN=1 and tiny sizes (0.005 SOL).
- Handle every API error by its "code" and show me its "hint" and "docs" link. Never retry a send without checking /tx first.
- Deliverable: a TypeScript Node 20 project with README, .env.example, npm start, a dry-run mode, and clear logs.

What it must do:
- Connect to wss://…/api/sol/data and subscribe to subscribeNewToken.
- For every new pump.fun coin that passes my filters (name/symbol keywords, dev buy ≥ X SOL, no more than Y holders in the first Z seconds), build a buy with POST /api/sol/trade-local (pool "pump", slippage 25, priorityFee from GET /api/sol/priority-fee "high"), sign it, send it with POST /api/sol/send, confirm with GET /api/sol/tx/:signature.
- Subscribe to subscribeTokenTrade for each position and sell 100% when price is +X% or −Y% from entry, or after N minutes.
- Keep positions in a JSON file so a restart does not lose them. Log every decision.
Token launcher with bundle
Build a pump.fun token launcher with a bundled first buy on the TrenchyTools API.

Before writing any code, read these three documents completely:
- https://trenchytools-docs-production.up.railway.app/AGENTS.md         rules for building on this API
- https://trenchytools-docs-production.up.railway.app/openapi.json      every endpoint, field, response and error code
- https://trenchytools-docs-production.up.railway.app/llms-full.txt     the full documentation as text

Rules you must follow:
- Use only endpoints and fields that appear in openapi.json. Never invent an endpoint, field or response key. If something is missing, say so.
- Private keys never leave this machine. Build with trade-local, sign locally, submit with send. Never use the Lightning (trade) endpoints.
- Every wallet the app generates (trading, funding, bundle wallets, vanity mint keys) must be written to disk BEFORE it is funded: a wallets/ folder next to the project (one JSON per wallet: address, secret, createdAt, label) or .env, and print the absolute path. Refuse to fund a wallet that is not on disk. Never keep keys only in memory or a log.
- Secrets come from .env (TRENCHY_API_KEY, SOL_PRIVATE_KEY). Never hard-code or print them. Write a .env.example.
- Create the API key with GET https://api.trenchytools.lol/api/create-api-key?label=<app> and tell me to put it in .env.
- Simulate with POST /api/sol/simulate before the first real send. Default to DRY_RUN=1 and tiny sizes (0.005 SOL).
- Handle every API error by its "code" and show me its "hint" and "docs" link. Never retry a send without checking /tx first.
- Deliverable: a TypeScript Node 20 project with README, .env.example, npm start, a dry-run mode, and clear logs.

What it must do:
- Take name, symbol, description, image path, twitter/telegram/website, dev buy amount and a list of buyer wallets (private keys from .env, up to 16) as config.
- Upload the image and metadata with POST /api/ipfs to get metadataUri.
- Generate the mint keypair locally. If there are more than 4 buyers, create a lookup table with POST /api/sol/lut first and wait until it is ready.
- Build the bundle: array body to POST /api/sol/trade-local — the create (with dev buy) first, then buys (use buyers[] entries with the lookup table). The first object's priorityFee is the Jito tip (read GET /api/sol/priority-fee for the current tip floor).
- Sign each transaction with its wallet (the create also with the mint keypair), send with POST /api/sol/bundle, poll GET /api/sol/bundle/:id, then confirm with GET /api/sol/tx/:signature.
- Print the mint address, each wallet's expected tokens (perBuyer from ?format=json), and what landed.
Take-profit / stop-loss bot
Build a take-profit and stop-loss bot for coins I already hold on Solana, on the TrenchyTools API.

Before writing any code, read these three documents completely:
- https://trenchytools-docs-production.up.railway.app/AGENTS.md         rules for building on this API
- https://trenchytools-docs-production.up.railway.app/openapi.json      every endpoint, field, response and error code
- https://trenchytools-docs-production.up.railway.app/llms-full.txt     the full documentation as text

Rules you must follow:
- Use only endpoints and fields that appear in openapi.json. Never invent an endpoint, field or response key. If something is missing, say so.
- Private keys never leave this machine. Build with trade-local, sign locally, submit with send. Never use the Lightning (trade) endpoints.
- Every wallet the app generates (trading, funding, bundle wallets, vanity mint keys) must be written to disk BEFORE it is funded: a wallets/ folder next to the project (one JSON per wallet: address, secret, createdAt, label) or .env, and print the absolute path. Refuse to fund a wallet that is not on disk. Never keep keys only in memory or a log.
- Secrets come from .env (TRENCHY_API_KEY, SOL_PRIVATE_KEY). Never hard-code or print them. Write a .env.example.
- Create the API key with GET https://api.trenchytools.lol/api/create-api-key?label=<app> and tell me to put it in .env.
- Simulate with POST /api/sol/simulate before the first real send. Default to DRY_RUN=1 and tiny sizes (0.005 SOL).
- Handle every API error by its "code" and show me its "hint" and "docs" link. Never retry a send without checking /tx first.
- Deliverable: a TypeScript Node 20 project with README, .env.example, npm start, a dry-run mode, and clear logs.

What it must do:
- Read my wallet from .env and my positions from a config file (mint, entry price in SOL, take-profit %, stop-loss %, trailing %).
- Subscribe to subscribeTokenTrade for each mint on wss://…/api/sol/data and keep the latest price from the trades; also poll GET /api/sol/quote every 15 s as a fallback.
- When a rule triggers, sell with POST /api/sol/trade-local (action sell, amount "100%" or the configured share, pool "auto"), sign, send, confirm.
- Never sell twice: mark the position done the moment a send succeeds and only reopen it if /tx says the transaction failed.
- Send me a one-line summary per action (Telegram webhook URL from .env, optional).
Copy-trader
Build a copy-trading bot on the TrenchyTools API.

Before writing any code, read these three documents completely:
- https://trenchytools-docs-production.up.railway.app/AGENTS.md         rules for building on this API
- https://trenchytools-docs-production.up.railway.app/openapi.json      every endpoint, field, response and error code
- https://trenchytools-docs-production.up.railway.app/llms-full.txt     the full documentation as text

Rules you must follow:
- Use only endpoints and fields that appear in openapi.json. Never invent an endpoint, field or response key. If something is missing, say so.
- Private keys never leave this machine. Build with trade-local, sign locally, submit with send. Never use the Lightning (trade) endpoints.
- Every wallet the app generates (trading, funding, bundle wallets, vanity mint keys) must be written to disk BEFORE it is funded: a wallets/ folder next to the project (one JSON per wallet: address, secret, createdAt, label) or .env, and print the absolute path. Refuse to fund a wallet that is not on disk. Never keep keys only in memory or a log.
- Secrets come from .env (TRENCHY_API_KEY, SOL_PRIVATE_KEY). Never hard-code or print them. Write a .env.example.
- Create the API key with GET https://api.trenchytools.lol/api/create-api-key?label=<app> and tell me to put it in .env.
- Simulate with POST /api/sol/simulate before the first real send. Default to DRY_RUN=1 and tiny sizes (0.005 SOL).
- Handle every API error by its "code" and show me its "hint" and "docs" link. Never retry a send without checking /tx first.
- Deliverable: a TypeScript Node 20 project with README, .env.example, npm start, a dry-run mode, and clear logs.

What it must do:
- Watch a list of wallets with subscribeAccountTrade on wss://…/api/sol/data.
- When a watched wallet buys a pump.fun coin, buy the same coin with a fixed SOL size (config), slippage 20, pool "auto"; when it sells, sell the same share of my position.
- Ignore coins older than N minutes (GET /api/sol/token/:mint) and skip if my balance is below a floor (GET /api/sol/balances).
- Keep a ledger of copied trades with the leader's signature and mine; expose a tiny status page on localhost.
Robinhood chain (pons) bot
Build a trading bot for pons coins on Robinhood chain on the TrenchyTools API.

Before writing any code, read these three documents completely:
- https://trenchytools-docs-production.up.railway.app/AGENTS.md         rules for building on this API
- https://trenchytools-docs-production.up.railway.app/openapi.json      every endpoint, field, response and error code
- https://trenchytools-docs-production.up.railway.app/llms-full.txt     the full documentation as text

Rules you must follow:
- Use only endpoints and fields that appear in openapi.json. Never invent an endpoint, field or response key. If something is missing, say so.
- Private keys never leave this machine. Build with trade-local, sign locally, submit with send. Never use the Lightning (trade) endpoints.
- Every wallet the app generates (trading, funding, bundle wallets, vanity mint keys) must be written to disk BEFORE it is funded: a wallets/ folder next to the project (one JSON per wallet: address, secret, createdAt, label) or .env, and print the absolute path. Refuse to fund a wallet that is not on disk. Never keep keys only in memory or a log.
- Secrets come from .env (TRENCHY_API_KEY, SOL_PRIVATE_KEY). Never hard-code or print them. Write a .env.example.
- Create the API key with GET https://api.trenchytools.lol/api/create-api-key?label=<app> and tell me to put it in .env.
- Simulate with POST /api/sol/simulate before the first real send. Default to DRY_RUN=1 and tiny sizes (0.005 SOL).
- Handle every API error by its "code" and show me its "hint" and "docs" link. Never retry a send without checking /tx first.
- Deliverable: a TypeScript Node 20 project with README, .env.example, npm start, a dry-run mode, and clear logs.

What it must do:
- Use the /api/rh routes: trade-local returns an ordered transactions[] (approve → sell, graduate → buy); send them in order with viem and wait for the approve receipt before the sell.
- Watch wss://…/api/rh/data subscribeNewToken for launches and buy with a fixed ETH size in the first N seconds (slippage 10), then sell on +X% using GET /api/rh/quote with my wallet as holder.
- Everything else as in the rules above (dry-run, simulate with POST /api/rh/simulate, error codes).

Before you trust it

  1. Dry run

    Run with DRY_RUN=1: it should build and simulate (POST /api/{chain}/simulate) and send nothing.

  2. Tiny size

    First real run with 0.005 SOL and one coin. Check GET /api/sol/tx/:signature and your wallet.

  3. Read the errors

    Every code is listed on Errors with what to change. Paste the error back to the assistant with its docs link.

Generated code is a draft until it has run against real transactions at small size. Nothing here guarantees a landing or a profit.