Up/Down in Okkana
- Lesson 4 of 8
- Using Okkana
- steps
- 7
- metrics taught
- 9
About this lesson
What you'll learn
How Polymarket's Up/Down markets work in Okkana: windows and results, the sequence and book metrics, when a bot decides and how its result is measured in shares.
Metrics in this lesson
- Last windowsStep 3 · The sequence
- StreakStep 3 · The sequence
- Up rateStep 3 · The sequence
- Down rateStep 3 · The sequence
- OutcomeStep 3 · The sequence
- Change in windowStep 4 · Change in the window
- Share priceStep 5 · The book of a side
- Share spreadStep 5 · The book of a side
- Share depth within 2¢Step 5 · The book of a side
- Up/Down seriesStep 1 · A window and two shares
- Resolution sourceStep 2 · How a window resolves
- Decision instantStep 6 · When a bot decides
- Share payoutStep 7 · The result in shares
A window and two shares
An Up/Down series is a run of back-to-back windows on one asset: BTC, ETH, SOL or XRP, every 5 minutes, 15 minutes, hour or day. Each window is a Polymarket market with two shares, Up and Down.
When the window ends, the winning share pays 1 USDC and the other pays 0. Until then each share trades between 0 and 1: Up at 0.52 means a buyer pays 52 cents for a claim that pays a dollar if the price ends higher. The two asks add up to about 1.
In Okkana each series is a market of its own, such as updown:BTC-5m.
How a window resolves
5-minute and 15-minute windows resolve on Chainlink's price feed: Up when the price at the end is at or above the price at the start. Okkana settles them on Polymarket's own result, about two minutes after the end.
Hourly windows resolve on the Binance spot 1-hour candle: Up when it closes at or above its open. Daily windows compare the close of the Binance 1-minute candle at 12:00 New York time on two days in a row, and a tie splits: each share pays 0.5. Okkana settles both on the Binance candles as soon as they close.
The sequence
These metrics read the windows that already ended. Last windows matches up to 10 of them, oldest to newest, each one Up, Down or any: Down, Down, Down is three Downs in a row, and Up, Down, Down, Down is exactly three. Up rate and Down rate are the percent of Up or of Down among the last n windows; a split counts for neither. Streak and Outcome give the same information as numbers: +3 is three Ups in a row and −2 two Downs; an outcome is +1 Up, −1 Down, 0 split, where 1 window back is the most recent one that ended.
Only results already known count. While the most recent ended window has no result, these metrics have no value, and a bot that reads them doesn’t decide on that window.
A condition can read another series too, such as the last hourly window in a 5-minute bot.
Change in the window
Change in window is the Binance spot price change, in percent, since the start of the window running when the bot decides. Before a pre-live decision, that is the window before the one the bot takes.
Every other Binance metric reaches a series through the market of the condition: the RSI, volume, funding or open interest of spot:BTCUSDT or perp:BTCUSDT.
The book of a side
Three metrics read the book of the bot's own side, Up for a long bot and Down for a short one, in the window it decides on. Share price is the best ask. Share spread is the best ask minus the best bid. Share depth is the USDC offered up to 2 cents above the best ask.
A Signal enters at the average price of buying the whole virtual notional of $1,000 against the book at that moment, which is above the best ask when the first level is thin.
When a bot decides
An Up/Down bot decides once per window. On 5-minute and 15-minute series it decides a set number of minutes before the window starts: 1 or 2 on 5m, and 1, 2, 5 or 10 on 15m. On hourly and daily series it decides at open, as soon as the previous window resolves on Binance.
If the conditions hold at that instant, the Signal is on that window; if not, the bot waits for the next one. There is no cooldown, reset, take profit or stop loss: the position ends with the window.
The result in shares
A Signal's virtual position buys $1,000 of its side's shares: 1000 / price shares. The venue's taker fee is charged on the entry: shares × 0.07 × p × (1 − p), about 3.4% of the notional at 0.52. Holding to the end pays no other fee.
When the window resolves, each share pays 1, 0 or 0.5, and the result is shares × (payout − price) − fee. Bought at 0.52, the position breaks even when its side wins about 54% of the time.
Your own operation works the same way: enter the price you paid per share, then register the exit at the resolution or at the price you sold.
These lessons explain what each number measures. They are not trading advice, and the lesson charts use simulated data. Preview build: market data on this site is simulated.