Commit Graph

25 Commits

Author SHA1 Message Date
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 ffd83a7a05
Rename instructions to follow naming pattern (#97) 2022-07-06 14:51:15 +02:00
Christian Kamm b25f6d5f4f Insurance fund 2022-07-06 09:07:50 +02:00
Christian Kamm 35ca4d31b3 liq_token_bankruptcy instruction for socialized loss 2022-07-06 09:07:49 +02:00
microwavedcola1 740ff0c09e
Close various things (#65)
* close bank, vaults, mint infos, stub oracles, serum OO (doesnt work, throws https://github.com/project-serum/serum-dex/blob/master/dex/src/error.rs\#L88), close serum market

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

* serum oo closing example in ts

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

* Fix from code review

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-06-09 18:27:31 +02:00
microwavedcola1 717b72857d
Remove anchor dummy type workaround (#53)
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-05-18 17:16:14 +02:00
microwavedcola1 1b1dd1a541 poc keeper
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-04-09 21:18:07 +02:00
Christian Kamm cbc3cc7bbd MangoAccount: Rename how tokens/serum3/perps data is stored
token_account_map -> tokens
serum3_account_map -> serum3
perp -> perps
2022-04-02 13:51:26 +02:00
microwavedcola1 0bdbd19ddd Make Serum3 ix anchor friendly
Make work with changes in mango account, add no deploy part to release script
Clippy
Fixes from cr

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-04-02 08:59:07 +02:00
Christian Kamm afbfd3b7f9 serum3_register_market: better validation
Previously we just trusted the base and quote token index to be correct,
now the appropriate banks are validated.
2022-03-30 12:24:49 +02:00
Christian Kamm 34d14ef267 Serum: serum3_liq_force_cancel_orders instruction
Still needs a test.
2022-03-21 17:39:52 +01:00
Christian Kamm 27f882a333 Tests: More flexible test context construction 2022-03-21 10:45:55 +01:00
Christian Kamm a6a31f226c Tests: Unify group + tokens setup 2022-03-21 07:49:51 +01:00
Christian Kamm 6f72cd27e8 Serum: Cancel order instruction 2022-03-19 12:19:16 +01:00
Christian Kamm 70316fb927 Serum: Settle funds instruction
Also move serum3 cpi helpers to a separate file, to allow reuse of calls
like settle_funds from multiple mango instructions.
2022-03-18 19:27:23 +01:00
Christian Kamm 9d05db68f9 Serum: Prefix instructions with serum3_ and related renames 2022-03-18 13:42:20 +01:00
Christian Kamm 3bb94777f3 MangoAccount field renames
indexed_positions -> token_account_map
serum_open_orders_map -> serum_account_map

in the future we should add the perp_account_map
2022-03-15 15:08:53 +01:00
Christian Kamm baa980c659 PlaceSerumOrder: Track vault balances before and after 2022-03-15 14:44:47 +01:00
Christian Kamm 6b342ffeb9 PlaceSerumOrder basic test 2022-03-14 17:21:16 +01:00
Christian Kamm 0b2f691f5b RegisterSerumMarket: pass market_index explicitly 2022-03-14 13:47:34 +01:00
Christian Kamm 1cd0f8d6be RegisterToken: Pass token_index explicitly
This guarantees stability when a gov proposal adds a new token and a new
market in one transaction. This way the RegisterMarket instruction knows
exactly what index the new token will have.

Previously, the new token index was generated automatically, meaning
you couldn't be sure what index a new token would get in advance.
2022-03-14 13:19:50 +01:00
Christian Kamm 693ac17996 Serum: Store open orders pubkey in account 2022-03-11 17:50:04 +01:00
Christian Kamm c86a6f8d29 Serum: Create OOs is functional and called from a test 2022-03-11 15:28:27 +01:00
Christian Kamm 9be5ad6488 Test: Add CreateSerumOpenOrders test stub 2022-03-11 14:26:42 +01:00
Christian Kamm dbd8409ce8 Test: Add RegisterSerumMarket test stub 2022-03-11 12:59:42 +01:00