mango-v4/programs/mango-v4
Nicholas Clarke 348fbc1cb9
Track cumulative net deposits (deposits - withdraws) (#91)
Track cumulative net deposits (deposits - withdraws) using prices at the time of the deposit and withdraw.
This is used for calculating overall pnl (across all tokens).
I want to store UI amount * UI price = (native amount / base decimals) * (oracle price * base decimals / quote decimals) => native amount * oracle price / quote decimals.
I have used f32 here to reduce the space required on the mango account - we don't need so much precision for this as it's purely a display value.
I've also included a field for net_settled - this will be used for perp pnl but is not implemented yet (as perp settling instructions are not ready).

Co-authored-by: Christian Kamm <mail@ckamm.de>
2022-07-06 12:07:30 +02:00
..
resources/test switchboard support (#67) 2022-06-18 16:38:46 +02:00
src Track cumulative net deposits (deposits - withdraws) (#91) 2022-07-06 12:07:30 +02:00
tests Track cumulative net deposits (deposits - withdraws) (#91) 2022-07-06 12:07:30 +02:00
Cargo.toml Clarkeni/logging (#81) 2022-06-30 14:35:05 +02:00
Xargo.toml First commit 2022-01-21 19:21:46 +01:00