betcode-org / flumine

flūmine - Betting trading framework
MIT License
177 stars 60 forks source link

Erroneous application of dead-heat rules to profit calculations #762

Closed petercoles closed 2 months ago

petercoles commented 2 months ago

There are markets for which the number of winners isn't known when the market is created (e.g. golf's make the cut market), and is determined only when the closed market is processed.

In these cases Betfair sets the number of winners to zero, and Flumine erroneously attempts to apply dead-heat rules to profit calculations and as the actual number of winners is > 0, usually in the 50-80 range. All winners are therefore treated as having dead-heated producing bizarre profit results (e.g. lay bets pretty much can't lose).

By forcing the number of dead-heats to 1 in these cases we avoid dead-heat processing where it's not appropriate.