Commit Graph

77 Commits

Author SHA1 Message Date
Riordan Panayides bddb0f363e Add bin dockerfiles to subdirectories 2022-08-05 17:50:43 +01: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 16290e07f4 client: fix mango account reading 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
microwavedcola1 dfa268dfd6
fix small things to make ci work again (#126)
* checkout submodules on ci

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

* change to https, so that ci can clone

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

* fix clippy

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

* redundant clone

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-30 09:49:56 +02:00
microwavedcola1 f2bfb951fd
anchor as submodule (#121)
* anchor as submodule
* Use anchor submodule as dependency

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Co-authored-by: Christian Kamm <mail@ckamm.de>
2022-07-27 08:52:41 +02:00
microwavedcola1 2fb92abad8
Mc/ts upgrade (#122)
* upgrade anchor fork, supports anchor idl close now

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

* upgrade ts deps

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-26 17:14:07 +02:00
microwavedcola1 0b2e1e6e6c
Mc/realloc 4 (#119)
Realloc + dynamic mango account

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Co-authored-by: Christian Kamm <mail@ckamm.de>
2022-07-25 16:07:53 +02:00
Christian Kamm 7c4d052979 ChainData: Fix returning stale data
1. Only the CreatedBank message contains the parent and often that was
   not the first message received. That confused the data structure,
   because it then considered a chain of slots alive that had only a
   single slot in it.
   Fixed by tracking as "best_chain" only the top slot that actually has
   a parent set.
2. OptimisticallyConfirm messages sometimes arrive before CreateBank,
   which would change the slot status from Confirmed back to Processed.
   Nothing dependend on confirmed vs processed, but it's been fixed
   anyway by making slot status only increase confirmation status.
3. Accept account writes for slots newer than the current best_chain
   head as alive.
2022-07-21 12:33:03 +02:00
microwavedcola1 3eae2cdc34 upgrade anchor to latest, upgrade solana dependencies to match what latest anchor uses
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-20 15:51:10 +02:00
Christian Kamm f8d4b2443c Liq: Don't log common+expected simulation errors 2022-07-20 09:47:37 +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 ca8b900913 Liq: explain re-fetching reason 2022-07-18 18:18:57 +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 1be22faf0d Liq: Fix up max_swap call when liquidator didn't use tokens yet 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
Christian Kamm bbca1d8763 Liq: basic liq_token_bankruptcy use 2022-07-18 18:18:57 +02:00
Christian Kamm 74873ad46b Liq: format, error handling, logging 2022-07-18 18:18:57 +02:00
Christian Kamm 0158239a56 Liquidator: max_liab_transfer based on min health ratio 2022-07-18 18:18:57 +02:00
microwavedcola1 9fc8a5a56a
multiple banks (#82)
* multiple banks

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

* Fixes from review

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

* test for closing multiple banks for a registered token

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

* fix deregister_token

* update idl

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

* Fixes from review

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

Co-authored-by: Christian Kamm <mail@ckamm.de>
2022-06-27 11:27:17 +02:00
Christian Kamm aeb94642ce fix clippy warnings 2022-06-21 13:10:37 +02:00
microwavedcola1 0f34851c64
switchboard support (#67)
* switchboard support

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

* Fix from review

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-06-18 16:38:46 +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