The repository contains the smart contracts suite of Squared, an automated market maker that interacts with external lending markets to boostrap variance swaps on any ERC-20 token. The mechanism is competely onchain and works in the absence of an existing market and traditional market makers. Thereby enabling traders to hedge cryptocurrency volatilty and gamma risk associated with Uniswap liquidity provisioning. Beyond hedging, Squared acts as an oracle for realized volatility on any ERC-20 token.
The codebase is an implementation of the capped quadratic market maker that mimics a variance swap exposure. We were luckily enough to recieve a small grant from the Uniswap Foundation in 2022 to build Squared.
forge install dahlia-labs/squaredThis project uses Foundry as the development framework.
forge install
@openzeppelin/contracts-upgrade
@transmissions11/solmateThe factory.sol deploys squared.sol to a predetermined address using .create2deploy()
forge buildforge testIn order to test third party integrations such as interfaces, it is possible to set up a forked mainnet with several positions open
sh anvil.shthen, in a separate terminal,
sh setup.sh