Note: This repository has been archived and is no longer maintained.
This repository initially served as a fork of Compound3 with a frontend implementation to facilitate OEV onboarding for both dApps and searchers. As the ecosystem has evolved, Api3 has successfully integrated with numerous dApps, making the Api3 documentation the recommended starting point for anyone interested in OEV. For searchers, we now recommend focusing on building bots for the existing OEV integrations rather than using this legacy repository.
This repository contains the smart contracts source code and market configurations for Compound v3(comet).
/api3-adaptors contains the necessary scripts to deploy and add the API3 Aggregator Adaptors and assets required for the protocol deployment.
- Install all the packages for the adaptors:
yarn adaptors:build- Open
api3-adaptors/config.jsonand add your asset and network details. You also need proxy contract address for each asset you are going to add. Head over to the API3 Market and get the proxy contract address for the assets you want to add.
You can also check out this guide on subscribing to dAPIs and getting a proxy address. For now, only 3 assets are supported. Do not add any more assets in the config.
NOTE: It is advisable to use a private RPC for the deployments. If the protocol deployment fails, try using another RPC.
Make a .env file in the root and add your mnemonic. This wallet needs to be funded to cover the gas costs for the deployments. Also add the other environment variables in the .env file. Make sure to add the ETHERSCAN_KEY(FOR MAINNET).
ETHERSCAN_KEY=""
BASESCAN_KEY="api-key"
SNOWTRACE_KEY="api-key"
INFURA_KEY="api-key"
POLYGONSCAN_KEY="api-key"
ARBISCAN_KEY="api-key"
LINEASCAN_KEY="api-key"
OPTIMISMSCAN_KEY="api-key"
MNEMONIC=""Run the following command to deploy the adaptors:
yarn adaptors:deployAfter deploying the adaptors, you can deploy the protocol. Install all the packages for the protocol:
yarnBuild all the packages:
yarn buildRun the following command to deploy the protocol:
NETWORK=your-network yarn protocol:deployThis would deploy Compound V3 USDC Market on your desired chain with all the collateral assets defined in the api3-adaptors/config.json file.
After the deployment, you can spin up the frontend to interact with the protocol. Generate frontend configuration:
yarn frontend:codegenRun the following command to start the frontend:
yarn frontend:dev