348fbc1cb9
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> |
||
---|---|---|
.. | ||
resources/test | ||
src | ||
tests | ||
Cargo.toml | ||
Xargo.toml |