Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
polymarket bot polymarket trading bot polymarket arbitrage botpolymarket bot polymarket trading bot polymarket arbitrage bot polymarket bot polymarket trading bot polymarket arbitrage bot polymarket bot polymarket trading bot polymarket arbitrage bot polymarket bot polymarket trading bot polymarket arbitrage bot polymarket bot polymarket trading
| Date | Stars |
|---|---|
| 2026-07-24 | 326 |
| 2026-07-25 | 334 |
| 2026-07-28 | 334 |
| 2026-07-30 | 334 |
| 2026-08-06 | 334 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Polymarket Arbitrage Trading Bot (BTC, ETH Momentum Arbitrage trading bot)
TypeScript bot for Polymarket **CLOB V2** **5-minute** BTC and ETH Up/Down markets. It monitors Chainlink strike/spot vs order books, enters momentum-aligned positions late in each epoch, optionally completes the opposite leg for a boxed pair, and manages exits with configurable risk rules.
You can check this bot pnl with this account.
https://polymarket.com/@9g9g99
<img width="494" height="238" alt="My_account_Pnl" src="https://github.com/user-attachments/assets/84c2a0f4-3bdd-488b-b8e3-24c61fbe24ba" />
https://github.com/user-attachments/assets/4b69f7a8-5ae0-4465-b2c2-03d38c1886f4
Built with [`@polymarket/clob-client-v2`](https://docs.polymarket.com/) and **Node.js 20+**. See [V2_MIGRATION.md](V2_MIGRATION.md) for Polymarket exchange upgrade notes.
## Features
- **Dual-market confirmation** — BTC and ETH must align before entries (reduces false signals)
- **Chainlink Data Streams** — strike at epoch open + live spot for `spot_minus_strike`
- **High-frequency monitor** — REST CLOB `/book` polling (~150ms), merged btc/eth wave logs
- **Six strategy phases** — buy1, buy2, buy3, buy4, risk1, risk2, risk3
- **Paper trading** — simulated fills without live CLOB orders
- **Optional redeem** — gasless redeem via Polymarket builder relayer after epoch end
- **Deposit wallet (POLY_1271)** — V2 signing with `viem` + official TypeScript SDK
## How it works
Each **5-minute epoch** the bot runs:
```
MONITOR (order books + strike/spot + strategies)
→ [optional] REDEEM winning tokens
→ next epoch
```
**Core signal:** `spot_minus_strike = chainlink_spot − epoch_strike`
- Positive → price above strike → favors **YES** (Up)
- Negative → price below strike → favors **NO** (Down)
The bot does **not** split/merge tokens. It buys outcome shares on the CLOB and optionally redeems after resolution.
<img width="1662" height="946" alt="BTC-ETH-Momentum-Arbitrage-Bot" src="https://github.com/user-attachments/assets/960d4837-321f-4a0a-bd94-ce7a07d8ae41" />
### Strategy flow
```mermaid
flowchart LR
A[Monitor tick] --> B{buy1 / buy2 gates?}
B -->|yes| C[BUY first leg]
C --> D[Fill confirmed]
D --> E{buy3 / buy4 pair cheap?}
E -->|yes| F[BUY opposite leg]
D --> G{risk exit?}
F --> H[Boxed pair — risk off]
G -->|sell| I[Flat position]
```
| Phase | Market | When | Action |
|-------|--------|------|--------|
| **buy1** | BTC | `t_minus` in window | GTC BUY YES or NO (momentum entry) |
| **buy2** | ETH | `t_minus` in window | GTC BUY YES or NO (momentum entry) |
| **buy3** | BTC | After buy1 fill | GTC BUY opposite if `fill_px + opp_ask < 0.95` |
| **buy4** | ETH | After buy2 fill | GTC BUY opposite if `fill_px + opp_ask < 0.95` |
| **risk1** | BTC or ETH | After fill | Stop loss vs entry price |
| **risk2** | BTC or ETH | After fill | Time stop |
| **risk3** | BTC or ETH | After fill | Dead-market / low-bid exit |
**buy1** and **buy2** are independent (both can fire in one epoch). **buy3**/**buy4** complete the pair when the combined cost is below `pair_sum_max`. Risk exits are skipped once the pair is fully boxed.
### buy1 / buy2 entry gates
All must pass on consecutive monitor ticks (`monitoring_cycles`, default 2):
1. **Time** — `trigger_time_end_sec ≤ t_minus ≤ trigger_time_start_sec`
2. **Momentum size** — `|spot_minus_strike_btc|`, `|averge_spot_minus_btc|`, `|spot_minus_strike_eth|` above configured minimums
3. **Sign alignment** — BTC spot, BTC epoch average, and ETH spot all same sign
4. **Target book** — spread `< max_spread`, `best_ask > min_best_ask`
5. **Cross confirmation** — paired symbol same outcome: `best_bid > other_symbol_min_best_bid`
### buy3 / buy4 pair completion
After a confirmed **buy1** (BTC) or **buy2** (ETH) fill:
1. `first_leg_fill_price + opposite_best_ask < pair_sum_max` (default `0.95`)
2. GTC limit **BUY** opposite outcome at `opposite_best_ask + opposite_buy_offset` (default `+0.03`)
3. Same shaExcerpt of 12,309 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:14ee86a50db4048c, topic:trading, desc:trading bot, readme:trading bot