Christian Kamm
157b322635
ts: fix scripts
...
- group create
- perp event queue + book side sizes
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
9c10101166
remove traces of address lookup tables aka transactions v2
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-02 09:39:08 +02:00
microwavedcola1
54b8a940f2
rename
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-02 09:38:28 +02:00
microwavedcola1
374c0eb136
mc/clippy ( #135 )
...
* clippy pass 1
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* clippy pass 2
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-02 09:07:10 +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
microwavedcola1
5c3b2c1189
mc/kill flash loan 1 & 2 and rename flash loan 3 to flash loan ( #131 )
...
* remove flash loan 1 & 2
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* rename flash loan 3 to flash loan
* fix test
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-01 16:55:17 +02:00
microwavedcola1
c516e45d08
mc/review reserved on accounts ( #130 )
...
* review and extend reserved on accounts
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* revert changes to node size, stack gets smashed in rust unit tests
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* max possible
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* max
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* header version
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fix from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fix
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fix from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-01 16:53:30 +02:00
microwavedcola1
e8e774a1a4
mc/feature gating ( #129 )
...
* feature gating
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fixes from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-01 12:56:29 +02:00
Christian Kamm
16e1e83e26
Client: Move chain_data to client for reuse
2022-07-31 11:03:54 +02:00
microwavedcola1
91d59c1918
close insurance vault also
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-31 09:57:56 +02:00
microwavedcola1
0c3efe21a9
match latest changes in group creation
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-31 09:36:46 +02:00
microwavedcola1
45fd36642e
prepare group for ownership transfer to governance ( #125 )
...
* prepare group for ownership transfer to governance
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* Fixes from reviews
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
* fix from review
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-31 09:28:16 +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
14cd9ae9b7
remove stray heroku experiments
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-29 11:16:08 +02:00
microwavedcola1
3fcb9000a1
wip docker
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-29 11:15:26 +02:00
microwavedcola1
6a95295eba
ts and keeper improvements
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-27 08:55:19 +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
46b6bce14b
IDL: Remove NodeRef and NodeRefMut enums
...
Anchor cannot load idls that include enums with tuple variants.
2022-07-22 08:35:30 +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
Christian Kamm
ea85824ccb
Remove code copied from solana-address-lookup-table-program
...
This removes the ProgramInstruction enum from the IDL, which was unused
and could break clients.
2022-07-21 06:49:04 +02:00
microwavedcola1
39686d3d0f
CU of test has increased, accomodate only for this test
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-20 15:51:10 +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
2bff4bba3d
Drop being_liquidated after bankruptcy resolves
2022-07-20 09:47:37 +02:00
Christian Kamm
b5d3e2164c
Make Serum3Info and PerpInfo pub again
...
Accidentally reverted in bad merge
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
a82bab4ed7
Better error when vault doesn't have enough funds
...
The spl_token transfer cpi instruction just says "error code: 1", which
is too opaque.
2022-07-19 13:43:05 +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
eee7ed097b
fix getEquivalentNativeUsdcPosition for null TokenPosition
2022-07-18 18:18:57 +02:00
Christian Kamm
b44f628c01
LiqTokenWithToken: More error contexts
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
199819f9c6
Rust client: Print simulation log messages
2022-07-18 18:18:57 +02:00
Christian Kamm
45f3e26386
Improve scripts for making a liquidation candidate
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
5231ee7f98
Token edit: Fix bug where mintinfo.oracle goes out of sync
2022-07-18 18:18:57 +02:00
Christian Kamm
33d4412ff8
Example scripts: accept GROUP_NUM env var
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
Christian Kamm
a75e282793
ts: Always increase stack trace limit
2022-07-17 13:26:57 +02:00
Christian Kamm
88a292e656
Health: Add max_swap_for_source function
2022-07-15 10:09:36 +02:00
microwavedcola1
b3c30eeff1
Update mangoAccount.ts
2022-07-14 15:01:10 +02:00
microwavedcola1
227eda9844
Fix
...
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-14 14:29:44 +02:00