tracer-pool-swaps v0.0.1
Tracer Perpetual Pools
Project base generated with the Typescript Solidity Dev Starter Kit. See Blog Post for more details
Frontend Notes
Calculating ABDKMathQuad values
The PoolSwapLibrary
contains several methods for generating, converting, and using the raw ratio values. These can be used in the frontend to estimate the result of a transaction. It is vital when estimating the result of a transaction that the shadow pool amount for the commit type's opposite is included in the token total supply.
Environment variables
The environment variables used in this project are documented in the example.env
file at the root of the project. To configure, create a copy of example.env
, rename to .env
, and replace the placeholders with the correct values.
Using this Project
Install the dependencies with yarn
.
Build everything with yarn compile
.
Run the tests with yarn test
.
Available Functionality
Build Contracts and Generate Typechain Typeings
You'll need to run this before running tests if typescript throws an error about not finding the typechain artifacts.
yarn refresh
Run Slither for static analysis report
If you have slither
installed and on your PATH, you can run npm run slither
to get a report on the current codebase.
Deploy to Ethereum
Create/modify network config in hardhat.config.ts
and add API key and private key, then run:
npx hardhat run --network rinkeby scripts/deploy.ts
Note: As of this commit, deploys are out of sync with the current contract set-up and therefore will not work.
Verify on Etherscan
Using the hardhat-etherscan plugin, add Etherscan API key to hardhat.config.ts
, then run:
npx hardhat verify --network rinkeby <DEPLOYED ADDRESS>
PRs and feedback welcome!
4 years ago