Christian Kamm
2d2cef35a0
Add HealthRegion instructions
...
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.
2022-08-24 10:07:45 +02:00
Christian Kamm
09fc5f716b
Renames in MangoAccount
...
- Accessors in MangoAccountValue
- PerpPositions -> PerpPosition
2022-08-19 14:58:20 +02:00
Nicholas Clarke
8a1c58e723
FlashLoan: Add flash_loan_type ( #164 )
...
Co-authored-by: Christian Kamm <mail@ckamm.de>
2022-08-17 12:36:55 +02:00
Christian Kamm
421b2d3d19
FlashLoan: Fix validation holes
...
- Pass the group to Begin and End and ensure it is the same.
- Enforce target token accounts can't be group-owned.
- Now End can consistently derive the number of vaults/token accounts.
2022-08-16 13:10:05 +02:00
Christian Kamm
54222c5b3f
liq_token_bankruptcy: don't pass redundant index
2022-08-16 13:08:57 +02:00
Christian Kamm
f169bcdafe
Client: add token_withdraw
2022-08-10 16:24:48 +02:00
Christian Kamm
3139b0816a
Client: Jupiter swaps preserve ata/token instructions
2022-08-10 16:24:48 +02:00
Christian Kamm
19153b8874
Client: Fix jupiter api field that is sometimes null
2022-08-10 16:24:48 +02:00
Christian Kamm
13e4d0a432
Client: Fix loan amount for jupiter ExactOut swaps
2022-08-10 16:18:41 +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
9bb125d016
Client: Allow getting the jupiter route
2022-08-10 16:18:41 +02:00
microwavedcola1
e06736660a
remove account size, make mango account feature position counts explicit ( #148 )
...
* remove account size from program, make position counts explicit
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* cargo-fix
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-07 14:16:06 +02:00
Christian Kamm
681c69e3a5
Client: Add jupiter_swap ( #139 )
2022-08-04 17:01:00 +02:00
Christian Kamm
d3a634c709
Cargo: Fix mango-v4 deps to specify client feature
2022-08-03 09:48:50 +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
c22590302a
Add "cli" command line tool to generate pda addresses
2022-08-02 09:45:12 +02:00
microwavedcola1
a9a03b97ac
mc/registration time ( #132 )
...
* registration time
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fix from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fix from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* mc/u32 numbers - consistent numbers in pdas (#133 )
* consistent numbers in pdas
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fix
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-01 18:46:45 +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
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
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
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
199819f9c6
Rust client: Print simulation log messages
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
ffd83a7a05
Rename instructions to follow naming pattern ( #97 )
2022-07-06 14:51:15 +02:00
Christian Kamm
de86b69e1a
Client/program interface changes
...
- rearrange structs to have gPA data in front and add comments about the
offsets being relevant
- add insuranceMint to group creation in client
- drop quoteTokenIndex storage on PerpMarket
- fixes to editAccount in example1-user and client
2022-07-06 11:34:07 +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
033cdeab7c
client: remove failing doctests
2022-06-22 16:51:16 +02:00
microwavedcola1
94f865fa57
todo
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-06-19 20:16:12 +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