dbo.fn_PriceToStake

Syntax:
dbo.fn_PriceToStake(id_race, id_horse, bidtype, stake)

Output:
(decimal) Returns the price at which the stake will be full matched.

Input parameters:
id_race (integer)Id of the market.
id_horse (integer)Id of the runner.
bidtype (b|l)Type of the bet: b=back l=lay.
stake (decimal)Amount ot bet

Example:

dbo.fn_PriceToStake(@id_race, @id_horse, 'b', 100)
returns the price at which a back bet of 100 will bet full matched, in the race and for the horse.