Skip to content

Latest commit

 

History

82 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Onchain exchange for variance swaps.

Topics

Resources

Stars

8 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages