PainStaking v1.0.0 PainStaking View Source

Calculate stakes in advantage betting situations

Link to this section Summary

Types

A tuple which represents a supposed advantage wagering situation

A keyword list which configures optional parameters for staking calculators

A tuple with a description and number

A keyword list with a single pair

Functions

How much to stake in an arbitrage situation

The mathematical expectations for a list of supposed edges

How much to stake on advantage situations based on the Kelly Criterion

Simulate a repeated edge situation for the average amount won

Link to this section Types

A tuple which represents a supposed advantage wagering situation.

  • a proposition description
  • the estimate of the fair (or actual) odds of winning
  • the odds offered by the counter-party to the wager
Link to this type staking_options() View Source
staking_options() :: [bankroll: number, independent: boolean]

A keyword list which configures optional parameters for staking calculators

  • bankroll: the total amount available for wagering; defaults to 100
  • independent: independent or mutually-exclusive simultaneous events; defaults to false
Link to this type tagged_number() View Source
tagged_number() :: {String.t, number}

A tuple with a description and number

Primarily used to make it easier to collate results.

Link to this type wager_price() View Source
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 an appropriate representation for that key.

Examples:

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

Link to this section Functions

Link to this function arb(edges, opts \\ []) View Source
arb([edge], staking_options) ::
  {:ok, [tagged_number], float} |
  {:error, String.t}

How much to stake in an arbitrage situation.

The bankroll option can be used to set the maximum amount available to bet on these outcomes.

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.

The mathematical expectations for a list of supposed edges

A losing proposition will have an EV below the bankroll

Link to this function kelly(edges, opts \\ []) View Source
kelly([edge], staking_options) ::
  {:ok, [tagged_number]} |
  {:error, String.t}

How much 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.

Mutually exclusive bets are staked as if they were not simultaneous. This leads to over-betting. The difference is negligible on small sets of wagers.

Link to this function sim_win(edges, iterations \\ 100, opts \\ []) View Source
sim_win([edge], pos_integer, staking_options) ::
  {:ok, float} |
  {:error, String.t}

Simulate a repeated edge situation for the average amount won

iterations sets the number of simulated outcomes