crazygirl437/Polymarket-5min-bot ? reverse-engineered prompt

Reverse engineered prompt

Build me a Rust trading bot for Polymarket’s 5 minute crypto Up or Down markets.

I want it to watch the current BTC, ETH, SOL, and XRP markets, track the YES and NO order books in real time, and look for cases where the combined ask price is below 1 USDC so it can buy both sides for an arbitrage trade. It should let me set things like max order size, total exposure, slippage, and the price gap needed to trade.

After it buys both sides, it should be able to merge the position back into USDC or pUSD when possible, and near the end of the window it should cancel open orders, merge positions, and clean up any leftover single side exposure.

Please make it easy to configure with a .env file, include the required wallet and builder settings, and add sensible defaults and good logs so I can see what it is doing. If you need current Polymarket docs or API details, look them up online first.