Skip to content

dahlia-labs/squared

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Squared

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.

Installation

forge install dahlia-labs/squared

Local development

This project uses Foundry as the development framework.

Dependencies

forge install

@openzeppelin/contracts-upgrade
@transmissions11/solmate

CREATE2

The factory.sol deploys squared.sol to a predetermined address using .create2deploy()

Compilation

forge build

Test

forge test

Local setup

In order to test third party integrations such as interfaces, it is possible to set up a forked mainnet with several positions open

sh anvil.sh

then, in a separate terminal,

sh setup.sh

About

Market maker for variance swaps

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •