The thing is, coding it up is actually a near-infinite endeavour. Let me explain. There are two pieces of software, the client and the server. The server side is actually relatively straight forward: rank the tiers with different weights, add up all the weights times all the liquidity at each weight to get a total normalization factor, then divide the fixed cost rate by that factor and distribute. That way, if only one person is providing in Rank 8 they will get paid the full amount but if you have some funds in Rank 8 and some in Rank 3 they will get paid different fractions of the full amount divided based on weighting and liquidity provided.
So thatās the easy part, and probably the part you were talking about. The hard part is the client side. Now, the client needs to weigh profitability via trading with profitability via the ALP. It will need to be up to snuff like any other trading bot on EMAs and risk-reward strategies while also needing to measure the opportunity cost of moving funds from one pool rank to another. This can get complicated.
And finally, the feedback loops. Ideally, the server side will actually change its rank distribution to accommodate new users. Basically, it would use the presence of a custodian as a feedback to understanding where the price is and where to offer the highest rewards. Essentially, this would look like offering higher weights to the rank that has liquidity and all the ranks closer to the price feed, while lowering the weights of those ranks farther away. This will stimulate the next custodian to place their order one rank closer to the price feed than the last custodian, rather than one rank farther away like would normally be the case (to minimize volatility risks). This is ideal, and a fix for the continually shifting bots jockeying for position that we would otherwise result in.
Anyway, there are levels of complexity here. Sure, just having two different payments for tight and wide spread sounds great and simple, but it points at such a bigger and more magnificent method of liquidity provision. All we have to do is implement it right, and Iām pretty satisfied that Sam is doing just that.