Hi bfw
If you think about it, it's trying to guess BSP beforehand lol, not an exact science.
Didn't realise its greyhounds, so liquidity will be much less than horses and prices will be more volatile. Also the race status I mentioned would not apply. Having looked at some greyhound prices as they get nearer to the off, I would suggest only using near_sp and perhaps back_price or last_traded.
multiple price average expression examples:
lay_sptotal/((near_sp+last_traded)/2)*0.9
lay_sptotal/((near_sp+last_traded+back_price)/3)*0.9
I think you should try these out and see what gets closest to actual_sp