Commit Graph

9 Commits

Author SHA1 Message Date
Christian Kamm 21af012d1f Improvements to margin_trade
- don't hard-code the group as the first passed account
- token::approve() banks for each token vault
- sign for each bank
- deal with using tokens without an existing position
- handle deactivation of token account if balance goes to 0
2022-05-20 10:16:09 +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
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 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
microwavedcola1 e742926ce2 change seeds literals to camelcase, camel case was how mango did in v3, also matches struct names
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-03-11 20:10:15 +01:00
microwavedcola1 b3f2ca51fa fixes from cr
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-03-08 11:11:28 +01:00