Closed nagakingg closed 11 months ago
I think rather than impact the rest of the codebase, it's better to just do something to the pool's state so there is no rebalance. This means the liquidity density function knows something about the pool (as it should) but nothing else needs to be aware.
For example, temporarily increasing allowed_extra_profit
to infinity would block any price adjustment.
Awesome, very clever solution. I'll do something like this.
Closed by #285
Estimating liquidity density requires comparing the prices before/after a small trade. However, for CryptoSwap pools, this becomes wrong in the rare cases where the small trade causes a pool rebalance.
I'm proposing to add an optional
tweak_price = True
kwarg to theSimCurveCryptoswap.trade()
function, and the downstream functionsexchange
and_exchange
.I wanted to discuss this (or alternatives) because:
trade()
methods should include **kwargs so they can ignore this flag