One finite leg's trading fee: max(bernoulli(p), min_fee) * ramp * quantity,
each product rounded down. bernoulli(p) = base_fee * sqrt(p * (1 - p)), zero
at p = 0 or 1; the caller checks p <= 1. The ramp is 1 at or beyond
window_ms to expiry and rises linearly to max_multiplier at expiry, rounded
down so the trader keeps the ramp dust.
One finite leg's trading fee:
max(bernoulli(p), min_fee) * ramp * quantity, each product rounded down.bernoulli(p) = base_fee * sqrt(p * (1 - p)), zero atp = 0or1; the caller checksp <= 1. The ramp is 1 at or beyondwindow_msto expiry and rises linearly tomax_multiplierat expiry, rounded down so the trader keeps the ramp dust.