Commit Graph

11 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 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
microwavedcola1 ef7d2862da
wip: dynamic rates (#98)
* dynamic rates

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

* fmt

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-11 17:08:32 +02:00
Christian Kamm f132f30874 Better error messages 2022-07-08 12:48:43 +02:00
microwavedcola1 0ff269c38c Merge branch 'main' into dev 2022-07-06 17:47:45 +02:00
microwavedcola1 ab3abc69e7 Fix flash loan3 - fetching of bank from retriever
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-06 17:41:08 +02:00
Christian Kamm 35ca4d31b3 liq_token_bankruptcy instruction for socialized loss 2022-07-06 09:07:49 +02:00
microwavedcola1 d74cc78a84
edit tokens, perp markets, mango accounts, allow delegate to perform certain operations (#94)
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-07-05 19:31:47 +02:00
Christian Kamm 6d05306859 Improve FlashLoan3 docs 2022-06-30 18:45:17 +02:00
Nicholas Clarke f8da1f6a40
Clarkeni/logging (#81)
* Add logging

* Added new_fixed_order_account_retriever to allow us to more easily access oracle prices outside of health calculations for logging purposes

* Add token balances logging to token and token liquidation and add logging to margin trade

* rust format

* fix clippy errors

* Address PR requested changes

* fix flash_loan

* Recalculate raw_token_index in token withdraw to account for position becoming inactive

* Fix retrieving oracle for logging

in get_mut_or_create(), return the raw index into the account's token
positions as well as the index into active positions only. The latter
index is useful for indexing into banks in the health account list.

* Add logging flash_loan2 and flash_loan3

* Refactoring flash loan logging

Co-authored-by: Christian Kamm <mail@ckamm.de>
2022-06-30 14:35:05 +02:00
Christian Kamm 86d635f5d0 FlashLoan3: Variant that transfers directly
FlashLoan2 requires the user to set up transfers to and from the Mango
vault accounts. This version directly provides the loaned funds into a
target token account and repays everything that exceeds the initial
token account balance at the end.
2022-06-28 15:32:26 +02:00