Sounds like you got it. Basically, it’s like fixed reward except the ‘fixed rate’ is actually the weighted average of buy and sell, and it uses fixed cost when over target.
There is also one more input, the ideal ratio. Let’s call it 50:50 for now. Note that this is instead of individually stated targets and rates for buy and sell. You state the target, the cost, and the ideal ratio as 3 floats, and that’s it.
If the operator puts up 20 nbt with a 10,000 target, that’s a 0.2% expected rate. So now let’s say there’s only 100 nbt in buy and 400 nbt in sell. That’s 500 total liquidity, which is 5% of target, so only 20*.05=1 nbt is given out. That 1 nbt is split 50:50 between buy and sell, so the buy side earns 0.5/100=0.5% and sell earns 0.5/400=0.125%.
With the same operator but 10,000 buy and 2,500 sell:
Now the combined liquidity is over target, so we cap out at our 20 nbt. Split 50:50 that’s 10 nbt buy and 10 nbt sell. So buy side gets 0.1% and sell gets 0.4%.
In the above cases I used daily nbt numbers, but this would actually be implemented by the minute, like we’ve done in the past.
We could use a 75:25 buy:sell split and so that the 20 nbt at target are paid out as 15 to buy and 5 to sell and the system should still reach equilibrium (theoretically with 3x more buy than sell) with the network even if other pools are using 50:50 splits.