1.3.0-beta • Published 10 months ago

@primitivexyz/portfolio v1.3.0-beta

Weekly downloads
-
License
AGPL-3.0-only
Repository
github
Last release
10 months ago

Beta: Not production ready. Pending on-going audits.

Primitive Portfolio

On-chain portfolio management. Optimized for managing risk and liquidity.

PRs Welcome npm.io Twitter Badge

Portfolio Security

Visit Primitive Security to view a comprehensive overview of the security initiatives of Portfolio.

System Invariants

The system is designed around a single invariant:

Actual balance of tokens in contract >= virtually tracked token balance in `__account__.reserves`.

Exposed via: Portfolio.getNetBalance(token)

For more invariants, read this.

Portfolio Manual

Clone

git clone https://github.com/primitivefinance/portfolio.git

Installation

Required:

  • Foundry
  • Python (if running echidna)

1. Install foundry. source

curl -L https://foundry.paradigm.xyz | bash

2. Restart terminal or reload PATH, then run:

foundryup

3. Install deps

forge install

4. Test

forge test --match-contract TestRMM01

Resources

Audits

Security FirmReview TimeStatus
ChainSecurity8-weeksCompleted
Trail of Bits8-weeksCompleted
Spearbit5-weeksCompleted
Spearbit Extension2-weeksPending

Contributing

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 formatOnSaveconfig 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.
1.3.0-beta

10 months ago

1.2.0-beta

12 months ago

1.1.1-beta

1 year ago