Skip to content

Latest commit

 

History

History

04-mcap-trigger

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

04 — Market-cap trigger buy

Watch a token and limit-buy when its market cap drops to a target.

What it does

You believe BONK is a buy under $500M market cap. You set a limit order: buy 0.5 SOL worth when mcap ≤ $500M.

Agent calls place_limit_order once. The MCP server registers the order with api.traderouter.ai, polls market cap server-side, and sends an unsigned buy tx the moment mcap crosses the threshold from above. The agent signs locally and submits.

The params_hash includes the target mcap, so the server can't trigger the order at a different price than you specified.

Run it

cp .env.example .env
export TRADEROUTER_DRY_RUN=true
node agent.mjs

When to use this pattern

  • You're laddering into a thesis ("buy BONK below $500M, $400M, $300M")
  • You want the discipline of a pre-committed entry
  • You don't want to watch the chart all day

When to use something else

  • You want a price target rather than a market-cap target → still use place_limit_order but with target interpreted as price
  • You want to dollar-cost average → use 02-dca-bot