After a market order fills across multiple prices, you need an average execution price.
Implement average_fill_price_bps.
Use:
total_quote * 10_000 / base_filledIf a market buy filled 6 base and spent 615 quote:
615 / 6 = 102.5
102.5 * 10_000 = 1_025_000Return 1025000.