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> |
||
---|---|---|
.cargo | ||
.github/workflows | ||
client | ||
keeper | ||
lib/checked_math | ||
liquidator | ||
mango-macro | ||
migrations | ||
programs | ||
py | ||
ts/client | ||
.gitignore | ||
Anchor.toml | ||
Cargo.lock | ||
Cargo.toml | ||
README.md | ||
idl-fixup.sh | ||
mc-release-to-devnet.sh | ||
package.json | ||
release-to-devnet.sh | ||
release-to-mainnet.sh | ||
tsconfig.build.json | ||
tsconfig.cjs.json | ||
tsconfig.esm.json | ||
tsconfig.json | ||
update-local-idl.sh | ||
yarn.lock |
README.md
Development
- rust version 1.59.0 (9d1b2106e 2022-02-23)
- solana-cli 1.9.13
- anchor-cli 0.24.2
- npm 8.1.2
- node v16.13.1
Devnet deployment - m43thNJ58XCjL798ZSq6JGAG1BnWskhdq5or6kcnfsD
TS client based examples
- ts/client/src/scripts/example1-admin.ts
- ts/client/src/scripts/example1-user.ts