Skip to content

equilibria-xyz/perennial-v2

Repository files navigation

1500x500 perennial

🌸 Perennial V2 is a general-purpose synthetic derivatives primitive for decentralized finance.

Twitter Follow

📦 Packages

Package Description Latest Version
@perennial/core Core perennial smart contracts. npm version
@perennial/deploy Deployment scripts and artifacts. npm version
@perennial/extensions Extension smart contracts. npm version
@perennial/oracle Oracle provider smart contracts. npm version
@perennial/vault Vault smart contracts. npm version

🔗 Resources

👨‍💻 Usage

Pre Requisites

Before running any command, make sure to install dependencies

$ yarn

Compile

Compile the smart contracts for each package with Hardhat:

$ yarn workspaces run compile

This also generates the Typechain types

Test

Perennial has 4 logic packages: core, deploy, extensions, oracle, and vault

Run the Mocha unit tests a specific package:

$ yarn workspace @equilibria/<package-name> run test

For example, to run the tests for the core package:

$ yarn workspace @perennial/core run test

To run tests against a Mainnet fork, set your MAINNET_NODE_URL in the root .env and run

$ yarn workspace run @equilibria/<package-name> test:integration

For example, to run the integration tests for the core package:

$ yarn workspace @perennial/core run test:integration

🔐 Security

📜 License

The vast majority of the Perennial V2 codebase is licensed under the Apache 2.0 license to provide developers with the maximum amount of flexibility. A minimum subset of code was chosen to place under the Business Source License 1.1 so as not to permit a full protocol redeployment.

License License
Apache-2.0 All, unless stated otherwise.
BUSL-1.1 Smart contracts: Market.sol and MarketFactory.sol in the @perennial-v2 package.