Commit Graph

13 Commits

Author SHA1 Message Date
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
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 20fc9d557a Satisfy anchor's lint by adding CHECK: comments 2022-06-24 12:36:35 +02:00
microwavedcola1 5b78293c5c minor refactoring
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-06-19 18:32:04 +02:00
microwavedcola1 0f34851c64
switchboard support (#67)
* switchboard support

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

* Fix from review

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-06-18 16:38:46 +02:00
Christian Kamm b3568b7f3e
Make health/oracle functions usable from clients (#63)
* Make health/oracle functions usable from clients

By creating a shared trait that is implementable for AccountInfo and
AccountSharedData.

* Health: fixup tests
2022-06-08 13:43:12 +02:00
microwavedcola1 a20d04b6ff
Fix oracle price read by using decimals from pyth (#62)
* Fix oracle price read by using decimals from pyth

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

* fix

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-06-02 10:36:04 +02:00
Christian Kamm 48cb1f0b88 Compute health in perp_place_order 2022-05-29 20:50:21 +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 f19f3da659 add todo
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-05-17 13:01:48 +02:00
Christian Kamm 9f0a7f67ae Orderbook: Port over unittests 2022-04-02 13:51:26 +02:00
Christian Kamm d26caf1c87 Perp: Rename fields to be explicit about being in lots 2022-04-01 15:47:12 +02:00
Christian Kamm 10ab9804d1 Rename perp instructions to have perp_ prefix 2022-04-01 08:01:56 +02:00