PainStaking v0.4.5 PainStaking

Calculate stakes in advantage betting situations

Summary

Types

A tuple which represents a supposed advantage wagering situation

A keyword list which configures optional parameters for staking calculators

A number tagged with a description

A keyword list with a single pair

Functions

Determine how much to bet on each of a set of mutually exclusive outcomes in an arbitrage situation

The mathematical expectations for a list of supposed edges

Determine the amount to stake on advantage situations based on the Kelly Criterion

Simulate a repeated edge situation and see the average amount won

Types

edge :: {String.t, wager_price, wager_price}

A tuple which represents a supposed advantage wagering situation.

The elements, in order:

  • an edge description
  • the estimate of the fair (or actual) odds of winning
  • the odds offered by the counter-party to the wager
staking_options :: [bankroll: number, independent: boolean]

A keyword list which configures optional parameters for staking calculators

The keywords are:

  • bankroll: the total amount available for wagering; defaults to 100
  • independent: mutually exclusive or independent simultaneous events; defaults to false
tagged_number :: {String.t, number}

A number tagged with a description

Primarily used to make it easier to collate results.

wager_price :: [{:atom, number | String.t}]

A keyword list with a single pair.

The key should be one of the atoms for a supported odds format from Exoddic. The value should be a supported way for expressing the odds for that key.

Examples:

  • Probability: [prob: 0.50]
  • Moneyline: [us: "+120"]
  • Decimal: [eu: 2.25]
  • Traditional: [uk: "4/1"]

Functions

arb(edges, opts \\ [])

Specs

arb([edge], staking_options) ::
  {:ok, [tagged_number], float} |
  {:error, String.t}

Determine how much to bet on each of a set of mutually exclusive outcomes in an arbitrage situation.

The bankroll option can be used to set the maximum amount available to bet on these outcomes. The smaller the arbitrage, the closer your outlay will be to this number.

The payouts may not all be exactly the same because of rounding to the nearest cent. This may cause a slight variation in the expected profit.

ev(edges, opts \\ [])

Specs

ev([edge], staking_options) :: {:ok, [tagged_number]}

The mathematical expectations for a list of supposed edges

A losing proposition will have an EV below the supplied bankroll

kelly(edges, opts \\ [])

Specs

kelly([edge], staking_options) ::
  {:ok, [tagged_number]} |
  {:error, String.t}

Determine the amount to stake on advantage situations based on the Kelly Criterion

The output list may be in a different order or have fewer elements than the input list.

sim_win(edges, iter \\ 100, opts \\ [])

Specs

sim_win([edge], non_neg_integer, staking_options) ::
  {:ok, float} |
  {:error, String.t}

Simulate a repeated edge situation and see the average amount won.

iter is the number of simulation iterations to run