Composio-HQ/polymarket-kalshi-arbitrage-bot — reverse-engineered prompt
Reverse engineered prompt
Build me a TypeScript Node app that runs an automated arbitrage bot for 15 minute prediction markets between Kalshi and Polymarket.
It should watch one configured Kalshi market and the matching Polymarket UP and DOWN tokens, fetch prices on a timer, and expose a small Express API so I can check health, current status, and start or stop polling. The main goal is to detect when Kalshi YES is around 93 to 96 cents and Polymarket UP is at least 10 cents cheaper, then signal a buy on Polymarket. Also detect the late case where Kalshi has closed or settled but Polymarket is still open with liquidity, and signal a buy there too.
Use environment variables for all settings like market start time, polling interval, token IDs, Kalshi ticker, thresholds, private key, proxy wallet, trade size, and cooldown. Only evaluate signals after a configurable number of minutes from market start. Include safe defaults, clear logging, a sample env file, and npm scripts for dev, build, and start. If trading credentials are present, wire up Polymarket order placement, otherwise run in signal only mode.
Want more depth? Deep Reverse