The new instruction allows the liqor to take over negative pnl (limited
by liqee settle health and settle limits) before applying the bankruptcy
logic.
This gives us better compatibility with released anchor versions.
Instead of using AccountLoaderDynamic<MangoAccount>, we now use
a standard AccountLoader<MangoAccountFixed>. This will generally work
(except for load_init(), which is dangerous).
A new trait, MangoAccountLoader, provides load_full(), load_full_mut()
etc on the AccountLoader<MangoAccountFixed> to create accessor structs
that can read and write to the dynamic part of the mango account data.
Liquidation and perp pnl settlement may not bring spot amounts to
exactly zero. Having a small spot amount < 1 native token can otherwise
make the liquidation get stuck and not move one to the next phase.
Liquidator, liqtest and rust client fixes
- Make rust MangoClient fully async
- Update and improve liquidation test setup scripts
- Update liquidator to use versioned transactions
- Update liquidator to use mango and jupiter account lookup tables
- Use jupiter v4 api to get versioned transactions
Perp liquidation is still not fully good. See discussion aboult perp_liq_pnl_with_token.
This adds three new options to perp markets:
- a flat fee, that is paid for all perp settlements
- given that they exceed the configured min settle amount threshold to
be eligible for fees
- and a fractional fee, that only applies when the benefiting account
has low health and gradually becomes bigger as the account slides
towards liquidation
Because it's not correct to think we'll always swap at oracle price.
That was an ok assumption for liquidations, where we'll swap at slightly
better than that, but not for jup.
* Push separate images for binaries to GCR
* Add base image version arg to heroku deployment
* Test docker build
* Try setting mode
* Fix tags
* switch back to dev
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Co-authored-by: microwavedcola1 <microwavedcola@gmail.com>
You can do
- HealthRegionBegin
- ... mango instructions ...
- HealthRegionEnd
and the account health will only be checked at the start and end
instead of for every instruction.
Instead, check for any liquidatable assets in liq_token_bankruptcy.
Bankrupt accounts may use the same operations as any other
negative-health account.