Commit Graph

22 Commits

Author SHA1 Message Date
Christian Kamm 4bd1cf1ece liquidator: Shuffle liquidation check
This way the liquidator is less likely to get stuck on one account if
there are multiple that need liquidation.
2022-12-20 14:13:02 +01:00
Christian Kamm 69cb21026d Rebalance: Don't use Jupiter's ExactOut method
It has limited liquidity.
2022-12-19 15:31:25 +01:00
Christian Kamm 5a38506f04
Liquidator, liqtest and rust client fixes (#336)
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.
2022-12-16 13:10:46 +01:00
Riordan Panayides 16c38975d5 Fix typo 2022-11-04 17:03:59 +00:00
Christian Kamm 11daf4d0eb client: fetch top settle pnl counterparties 2022-09-28 10:48:41 +02:00
Christian Kamm 9cbc352197 liquidator: force-cancel perp orders, liq perp base positions 2022-09-28 10:47:05 +02:00
Christian Kamm b1940eea43 Liquidator: Reduce likelihood of double-sending rebalancing tx 2022-09-02 12:24:28 +02:00
Christian Kamm 8a2d54cce8 Fix some clippy warnings 2022-08-30 13:59:34 +02:00
Christian Kamm 2552bffc66 Liquidator: blocking-wait for data after actions
To avoid sending a second jupiter-swap while the first one is still
in-flight.
2022-08-10 16:18:41 +02:00
Christian Kamm cce1881223 Liquidator: basic sell/buy to keep only quote 2022-08-10 16:18:41 +02:00
Christian Kamm 5c40c12cf5 Liquidator: cleanups 2022-08-10 16:18:41 +02:00
microwavedcola1 24c359ef92
keeper token rate update - group multiple ixs into one (#151)
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-08 13:40:33 +02:00
Christian Kamm 681c69e3a5
Client: Add jupiter_swap (#139) 2022-08-04 17:01:00 +02:00
Christian Kamm b0dae7ec22 client: construct from account pubkeys 2022-08-02 09:45:12 +02:00
Christian Kamm 16e1e83e26 Client: Move chain_data to client for reuse 2022-07-31 11:03:54 +02:00
microwavedcola1 c88297f42e
mc/ts and keeper improvements (#127)
* ts and keeper improvements

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* remove stray heroku experiments

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Fixes from reviews

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-31 09:25:11 +02:00
Christian Kamm 999bb4b597 Liq/Keeper: allow --dotenv=<file> arg
Makes it easier to run the tools with different configs, without either
passing everything explicitly or making separate directories for .env
files.
2022-07-19 14:57:25 +02:00
Christian Kamm 7e0e6e4506 Liq: use clap+dotenv instead of toml config file 2022-07-19 11:35:59 +02:00
Christian Kamm 348d8cfcd8 Liq/Client: Various improvements
- Abstract away account fetching, so it can be done via RPC or from a
  websocket stream (or a geyser plugin) that populates a ChainData
  instance.

- Separate out information about tokens, markets into MangoGroupContext.

- Separate all gPA calls into functions in a new file

- The liquidator re-fetches critical accounts via RPC before
  liquidation. Unfortunately the websocket stream seems slower :/

- Don't re-implement health account derivation in the liquidator.
  Instead reuse the existing code from the client.

- More smaller stuff.
2022-07-18 18:18:57 +02:00
Christian Kamm 50f9eb6913 Liq: trigger a full health check after the snapshot 2022-07-18 18:18:57 +02:00
Christian Kamm 4e87c07a9a Prefer "group" argument to keeper/liquidator
The admin keypair doesn't need to be passed in. It's only convenient for
testing.
2022-07-18 18:18:57 +02:00
microwavedcola1 95c06c2bfc
Mc/liquidator (#64)
* Copy over and integrate liquidatable-accounts-feed (doesn't compile)

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Liquidator

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Adapt to refactoring

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* remove dead code

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Use copies of AccountSharedData

* Implement AccountReader for AccountSharedData

* use LoadZeroCopy in liquidator

* Fix from review

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

Co-authored-by: Christian Kamm <mail@ckamm.de>
2022-06-18 16:31:28 +02:00