Search by

betbetter / yii2-novig

betbetter

No-Vig Odds Calculator widget for Yii 2: turn bookmaker odds into fair, margin-free odds and probabilities.

Package info

gitea.com/betbetter/yii2-novig

Homepage

Issues

Type:yii2-extension

pkg:composer/betbetter/yii2-novig

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

1.0.0 2026-11-14 02:43 UTC

This package is not auto-updated.

Last update: 2026-11-15 20:40:59 UTC


README

A small Yii 2 widget that removes the bookmaker margin (the "vig" or "overround") from betting odds, so visitors can see the fair odds and the true chance behind any price.

  • 2-way markets (tennis, basketball, head-to-head) or 3-way markets (home / draw / away)
  • Decimal (2.50) or American (+150 / -110) odds
  • Shows the fair chance, fair odds and the bookmaker margin as the visitor types
  • Runs in the browser: no API key, no external requests, no cookies
  • Labels can be overridden for translation

Installation

composer require betbetter/yii2-novig

Usage

use betbetter\novig\NoVigWidget;

echo NoVigWidget::widget();                        // 2-way, decimal odds

echo NoVigWidget::widget([
    'outcomes' => 3,                               // home / draw / away
    'format' => 'american',                        // +150 / -110
]);

Options

OptionValuesDefault
outcomes2 or 32
format'decimal' or 'american''decimal'
showCreditshow a small "how the margin is removed" linkfalse
optionsHTML attributes for the container[]
labelsoverride any label, e.g. ['home' => 'Local']English

How it works

Each price is turned into an implied probability (1 / decimal odds). The probabilities are added up; anything above 100% is the bookmaker margin. Each probability is divided by the total so they add up to 100% again (the proportional method), giving the fair chance and the fair odds.

Example: 1.91 / 1.91 adds up to 104.7%, so the margin is 4.7% and the fair odds are 2.00 / 2.00.

For reference, across 69.6 million pre-match markets (July to September 2026) the average margin was about 4.8% on two-way match bets and 7.6% on player props: State of the Vig 2026 (open data, CC BY 4.0). A browser version is at betbetter.world/tools/no-vig-calculator.

Licence

MIT. Made by Bet Better.