Focus strategy: an AI predictive model forecasts the winning side 4–5 seconds before each crypto Up/Down market closes, then the bot buys that outcome and redeems at $1.
Also includes a mid-market arbitrage mode (buy both sides → merge). This repo’s primary product is the endcycle sniper.
🌐 Language: English | 中文 | Français | Español
| Telegram | @dizzy |
| Polymarket | @uord |
| Wallet | 0x0a6c99d88523d328f6a8edf7db851796dc7f7e41 |
📹 **[Watch endcycle demo]
demo.mp4
What the recording shows:
- Live Bitcoin Up or Down 5-minute window approaching close
- Price to beat vs current BTC on the market card
- Wallet connect / sign as
@uord - Portfolio, P/L curve, withdrawals, and Up/Down trade history across assets
| Late-cycle market | Portfolio (demo) |
|---|---|
![]() |
![]() |
| Metric | Value |
|---|---|
| Portfolio / cash | $2,910.41 |
| Past day P/L | +$378.90 |
| 1-week P/L | +$562.55 |
| All-time P/L | +$3,664.67 |
| Strategy | Idea | Role |
|---|---|---|
| Endcycle Sniper (focus) | AI model predicts UP/DOWN 4–5s before close, then buy the predicted side | Primary — demo video |
| Arbitrage | Buy UP + DOWN mid-market, merge to USDC | Secondary |
| $0.01 liquidity | Catch thin books when winners print near 1¢ | Optional |
Polymarket runs rolling N-minute crypto markets (often 5m):
- Strike / price to beat = reference price at interval start
- UP wins if price at end is above the strike
- DOWN wins if price at end is below the strike
- Winning shares redeem at ~$1; losers → $0
The endcycle bot does not wait for the book to already price a near-certainty favorite for the whole last minute. Instead it runs an AI predictive model on live market + spot features and outputs the likely winning direction about 4–5 seconds before the market closes. The bot then places a fast BUY on that side and holds through resolution.
Interval (e.g. 5 minutes)
|-------------------------------------------|----|
start AI fire end
(price to beat fixed) (~4–5s left) (resolve)
│
├─ model → UP or DOWN
├─ place BUY on predicted side
└─ redeem $1 if correct
| Step | Timing | Action |
|---|---|---|
| 1 | Interval open | Discover market, track strike, spot feeds, book |
| 2 | Mid-interval | Model features update continuously; no entry yet |
| 3 | ~4–5 seconds before close | Model emits predicted direction (UP or DOWN) |
| 4 | Immediately after signal | Aggressive BUY on predicted token |
| 5 | After resolution | Redeem winners; roll to next interval |
The short 4–5s lead is the core edge: early enough to get a fill before the clock hits zero, late enough that the model’s direction call is high-confidence.
From the video (BTC 5m approaching close):
| Field | Example |
|---|---|
| Market | Bitcoin Up or Down · 5-minute ET window |
| Price to beat | $64,513 |
| Current price | ~$64,221 |
| Context | Final seconds of the cycle — sniper / AI fire window |
- Discover the active Up/Down market for the configured asset / interval.
- Stream spot (Coinbase / Binance / Chainlink), CLOB book, and time-to-close into the model.
- Idle until the prediction window (~4–5 seconds before end).
- AI model predicts UP or DOWN.
- Fire BUY on the predicted side (limit up to
BUY_LIMIT_PRICE, sizeORDER_SIZE). - Redeem after resolution (relayer); repeat next interval.
Skip or size down if the book has no liquidity, latency is too high, or paper mode is on.
| Works when | Fails when |
|---|---|
| Model direction matches resolution | Last-tick reversal vs the prediction |
| Order fills in the 4–5s window | Latency / reject — miss the close |
| Ask still below $1 after fees | Book already fully priced / no size |
| Feed features align with resolution oracle | Feature feed disagrees with Polymarket settle source |
Sniping is many small cycles (buy predicted side → redeem $1), not one large bet.
| Buy | Shares | Cost | Claim | Approx. PnL |
|---|---|---|---|---|
| 98¢ | 68.3 | $66.95 | $68.31 | +$1.4 |
| 98¢ | 102 | $100 | $102.03 | +$2.03 |
| 97¢ | ~103 | $100 | $103.07 | +$3.07 |
Pattern: AI picks side late → buy → redeem $1.
- AI predictive model — direction call ~4–5s before close
- End-of-cycle execution only (not full-interval market making)
- Live spot + book features into the model
- Aggressive BUY on the predicted side
- Multi-asset short Up/Down markets (BTC, ETH, SOL, …)
- Redeem / claim after resolution
| Param | Role |
|---|---|
RISK_STOP_TIME_SEC |
Endcycle / prediction timing window (align with ~4–5s fire) |
BUY_LIMIT_PRICE |
Max price to pay for the predicted side (e.g. 0.99) |
ORDER_SIZE |
Order size |
MARKET_INTERVAL_SECONDS |
Interval length (default 300 = 5m) |
ASSET / MARKET_SLUG_PREFIX |
Which Up/Down series to follow |
# .env — fill before live sniping
RISK_STOP_TIME=
BUY_LIMIT_PRICE=0.99
ORDER_SIZE=30
ASSET=btc
MARKET_INTERVAL_SECONDS=300
PAPER_TRADING=1- Find current crypto Up/Down market
- Feed live data into the AI model
- At ~4–5 seconds before close, take the model’s UP/DOWN prediction
- BUY the predicted side
- Redeem after resolution; repeat
Secondary strategy.
Buy both UP and DOWN when combined cost < $1 (plus fees), then merge equal shares back to USDC. Mid-interval mispricing / inventory — not the AI endcycle path.
![]() |
![]() |
![]() |
| Result |
|---|
![]() |
- Auto discovery of active crypto 5m markets
- Monitor UP/DOWN balances
- Merge equal inventory → USDC
- Optional force-sell near close
- Find current market
- Place / manage both sides
- Merge equal amounts
- Force-sell residual near close if needed
- Roll to next market
When the book is thin, winners can trade near $0.01. Separate from endcycle sniping; see assets/result2.png.
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# set PRIVATE_KEY, FUNDER, and endcycle params
python main.pyConfig:
- Tunables:
src/config/params.py - Runtime state:
src/config/config.py - Env template:
.env.example
Guides: docs.md · WORKFLOW.md






