Repository avatar
Other Tools
v0.5.1
active

bonus-ev

com.northlinemath/bonus-ev

Licensed-only casino bonus EV, official operator registers and terms changes: UK, NJ, MI, PA, ON.

Documentation

northline-bonus-math

The expected-value (EV) engine behind Northline, an independent audit of licensed casino welcome bonuses in Great Britain, New Jersey, Michigan, Pennsylvania and Ontario. It is the same code that produces the figures on the site, published so anyone can check them.

  • Deterministic: no randomness except two seeded simulators (mulberry32) used for Ontario non-sticky play and US lossback. Same input, same output.
  • No network access, no database, no secrets. Pure functions and tests.
  • Code: MIT. Sample data in data/: CC BY 4.0. Full open dataset (verified offers, licensed operators, market rules): Kaggle and Hugging Face.
  • Full written method: https://www.northlinemath.com/methodology

An EV is an average over many players. It is not a prediction of any one session and not betting advice. 18+ (19+ in Ontario, 21+ in NJ, MI and PA). If gambling is a problem, see BeGambleAware, 1-800-GAMBLER or ConnexOntario.

The method in five lines

For a deposit D, bonus B, wagering multiple w, game contribution c and return to player r (house edge h = 1 − r, 96% RTP unless stated):

  1. Wagering base decides the turnover. W = B·w/c when wagering applies to the bonus only, W = (D + B)·w/c when it applies to deposit plus bonus.
  2. No double-counting (DEPOSIT_PLUS_BONUS). The cash-play cost of the deposit, D·h, is charged only when the deposit sits outside the wagering base. If the base is deposit plus bonus, the deposit's house edge is already inside W; charging it again would count the same bets twice.
  3. Bonus funds are floored at zero and capped. value = min(max(0, B − W·h), Cmax). A player can abandon bonus funds, so they are never a debt; a cashout cap limits what can be kept before the deposit is subtracted.
  4. UK 10× cap. Since 19 January 2026 the UKGC caps wagering at 10× and bans offers that require play across products. An advertised offer above 10× or a mixed-product offer is non-compliant: it is excluded from public ranking, and calculators show the figure at the capped 10× rather than quietly "fixing" the offer.
  5. Net EV = bonus-funds value − cash-play cost (where it applies). Commission is not an input anywhere in this repository.

Worked example (UK, £100 deposit, 100% match, 96% RTP, slots 100%):

TermsTurnoverBonus valueCash-play costNet EV
10× on the bonus£1,000£60£4£56
10× on deposit + bonus£2,000£20£0 (already inside turnover)£20
35× on the bonus (evaluated at the 10× UK cap)£1,000£60£4£56
5× on the bonus£500£80£4£76

These four are reproduced by data/worked-examples.json and the test suite.

Other models in src/engine.ts: UK stake caps (£5 for 25+, £2 for 18–24), Ontario sticky and non-sticky bonuses (sticky value is cash kept after wagering minus the deposit, bounded below by −D; non-sticky is weighted by a simulated bust probability), US 24-hour lossback (refund min(α·L, Lmax) on net loss, with the bet-size effect from a seeded simulation) and dripped daily spins (per-day value weighted by claim probability). The corrections that shaped the engine are listed in FORMULA_CORRECTIONS and locked by tests. The engine also contains rule packs for markets Northline does not publish yet; they are not used on the site.

Use

npm install
npm test
import { auditBonusEv } from "./src/index.js"

const result = auditBonusEv({
  deposit: 100,
  match_rate: 1,          // 100% match
  wagering_multiplier: 10,
  wagering_base: "bonus", // or "deposit_plus_bonus"
  market: "uk",
})
console.log(result.net_ev, result.explanation) // 56

scoreCard(market, terms, deposit) is the index scorer used for the published boards; src/bonus-check.ts is the bonus checker behind https://www.northlinemath.com/check-a-bonus.

Sample data

  • data/verified_offers.sample.csv: nine verified welcome offers (UK, NJ, PA) with the structured terms, the net EV Northline published, the regulator and licensee, the operator's own terms page and the Northline page for the row. test/reproduce.test.ts recomputes every ev_net from the columns in the file and checks it matches. Offers whose value depends on inputs not in this file (side bonuses, drip schedules, lossback parameters) are in the full dataset only. Ontario rows are left out: Ontario bonus amounts are not published on open pages.
  • data/worked-examples.json: the table above, as inputs and expected outputs.

What is deliberately not here

The collection of terms from operator pages, any credentials, hosting configuration and the database are not part of this repository. This repo is the maths and a reproducible sample, so the numbers can be audited.

Remote MCP server

The hosted, read-only MCP server that uses this engine is at mcp.northlinemath.com/mcp (Streamable HTTP, no auth). Official registry name: com.northlinemath/bonus-ev. Setup and tools: northlinemath.com/developers. The server implementation and operator-terms collection are not in this repository.

Corrections

If you find a formula error or a wrong sample row, open an issue, or use the form on https://www.northlinemath.com/about#contact. Confirmed errors are fixed here and on the site, and the change is logged in the site's terms-changes feed.

Run by Premium Administration OÜ, Tallinn, Estonia. Founder: Mikk Maal.

No installation packages available.