Beta: Not production ready. Pending on-going audits.
On-chain portfolio management. Optimized for managing risk and liquidity.
A technical summary of Portfolio is detailed in the Yellow Paper.
The system is designed around a single invariant:
Balance >= Reserve
Exposed via: Portfolio.getNetBalance(token)
For more invariants, read this.
git clone https://github.com/primitivefinance/portfolio.git
Required:
- Foundry
- Python (if running echidna)
1. Install foundry. source
curl -L https://foundry.paradigm.xyz | bash
foundryup
forge install
forge test --match-contract TestRMM01
- Portfolio Yellow Paper
- RMM in desmos
- Original codebase
- solstat
- Replicating Market Makers
- RMM whitepaper
- High precision calculator
Security Firm | Review Time | Status |
---|---|---|
ChainSecurity | 8-weeks | Completed |
Trail of Bits | 8-weeks | Completed |
Spearbit | 5-weeks | Scheduled |
Important:
- This codebase uses the FORGE formatter. This is not prettier. If you have not already, make sure if you use vs code that the
formatOnSave
config variable uses forge fmt instead of prettier. - Setup the proper settings using this guide: forge fmt for formatOnSave vscode.
When making a pull request:
- All tests pass.
- Code coverage does not change.
- Code follows the style guide:
- Follows Primitive styling rules.
- Run
forge fmt
. - Code is thoroughly commented with natspec where relevant.
- If making a change to the contracts:
- Gas snapshots are provided and demonstrate an improvement (or an acceptable deficit given other improvements).
- New tests for all new features or code paths.
- If making a modification to third-party dependencies, yarn audit passes.
- A descriptive summary of the PR has been provided.