Premia - Next-Generation Options AMM

https://premia.finance

Deployments

DeploymentArbitrumArbitrum GoerliArbitrum Nova
Core Contracts📜📜📜
Option Physically Settled📜📜
Option Rewards📜📜
Vaults📜📜

Development

Install dependencies via Yarn:

yarn install

Setup Husky to format code on commit:

yarn postinstall

Create a .env file with the following values defined:

KeyDescriptionRequired for
API_KEY_ALCHEMYAlchemy API key for node connectivityTests + deployments
API_KEY_ARBISCANArbiscan API key for source code verificationContracts verification
PKEY_DEPLOYER_MAINcontract deployer private key for production use on mainnetsMainnet deployment
PKEY_DEPLOYER_TESTcontract deployer private key for test/development use on testnetsTestnet deployment
PKEY_PROPOSER_MAINSafe multi-sig transaction proposer private key for production use on mainnetsMainnet deployment
PKEY_PROPOSER_TESTSafe multi-sig transaction proposer private key for test/development use on testnetsTestnet deployment

Testing

Test contracts via Forge:

forge test -vv

Generate a code coverage report using Forge:

forge coverage

Generate a HTML code coverage report using Forge :

forge coverage --report lcov && genhtml lcov.info --branch-coverage --output-dir coverage

Deployment

Contracts deployment is done through Hardhat. Available networks : arbitrum, arbitrumNova, goerli, arbitrumGoerli

hardhat run ./scripts/deploy/0000-baseLayer.ts --network goerli

Contracts upgrade

Example to upgrade pools implementation on goerli network :

hardhat run ./scripts/upgrade/0000-pools.ts --network goerli

Other upgrades scripts are available in ./scripts/upgrade to upgrade different components of the protocol.

Docker

To run the code in developer mode using docker, start by building the docker image:

docker build -t premia-v3 .

Then run the docker container by using the command:

MacOS/Linux

docker run -it -u=$(id -u $USER):$(id -g $USER) \
           -v $PWD:/src \
           premia-v3

Windows

docker run -it -v %CD%:/src premia-v3

Upon executing, you will have access to the command line inside the container and will be able to run the commands for forge and hardhat.

Licensing

TBD