Closed liamzebedee closed 2 years ago
@artdgn changes needed - it should not check all the orders (it won't scale), incentives for liquidating larger orders first
unit tested needed
@artdgn changes needed - it should not check all the orders (it won't scale), incentives for liquidating larger orders first
A bit more details @bachstatter - the bot should not track all positions for every block, but should track only a constant amount of positions that are closest to liquidation price. This is to prevent hanging if there are too many open positions to track (which could prevent any liquidations from hapenning due to waiting for too many call requests to the node).
Instead a mapping of positions by liquidation price and position size can be maintained:
PositionModified
event is emitted, if the position is not closed (size != 0) liquidationPrice()
can be queried for this position and stored (size should be stored as well). This is an estimate of the actual liquidation price and in reality the liquidation price will be slightly different.canLiquidate()
or liquidationFee()
) in the order of their position size (larger (abs()
) first). Open PRs for adding typescript and unit tests: https://github.com/Synthetixio/futures-keepers/pull/7 https://github.com/Synthetixio/futures-keepers/pull/8 https://github.com/Synthetixio/futures-keepers/pull/9 https://github.com/Synthetixio/futures-keepers/pull/10 https://github.com/Synthetixio/futures-keepers/pull/11 https://github.com/Synthetixio/futures-keepers/pull/12
cli tool for keeper bot almost ready
Validating keeper performance w.r.t. OVM throughput
PR - https://github.com/Synthetixio/futures-keepers