Commit Graph

15 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 ee6fe93b26 Fix tests
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-05-16 10:49:11 +02:00
microwavedcola1 15961ec81c fees for borrows
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-05-09 11:14:50 +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
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 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 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 cea0f9441a Build fixes 2022-03-07 15:29:44 +01:00
Christian Kamm 98cf8a7cff Position lifetime, dust etc
- withdraw and deposit may deactivate positions explicitly
- adjusting bank positions may collect dust for positions between
  0 and 1 native tokens
- health check always assumes all active and new banks/oracles are
  passed
2022-03-07 15:21:19 +01:00