Flat Perp
Democratized access to flat power perps via a composable, tokenized vault standard.
How it works
Flat Perp alternates between two different Power Perp strategies!
Vault States
- Vault is below 6.9 ETH: Funds go into the Euler strategy
- Vault is above 6.9 ETH: Funds go into the Power strategy
Euler Vault
(Deposit ETH -> Borrow oSQTH -> Short oSQTH)
Power Vault
(Withdraw ETH -> Swap to oSQTH -> Repay oSQTH Loan -> Take out ETH Profit)
Getting started
- Git clone this repo:
git clone https://github.com/fei-protocol/ethAmsterdam-getting-started.git
- Install Forge and contract dependencies:
git submodule update --init --recursive
- Install developer dependencies:
npm install
- Compile contracts:
forge build
- Run tests by forking mainnet:
API_KEY=0x123 forge test --fork-url https://eth-mainnet.alchemyapi.io/v2/$API_KEY
Prerequisites
Forge installed. To install:
curl -L https://foundry.paradigm.xyz | bash
foundryup
Background
FlatPerp is built on top of three products: ERC4626, Squeeth & Euler!
ERC-4626
A new standard for Tokenized vaults. It represents a strategy which is itself also tokenised
Squeeth
Euler
ABIs and Mainnet addresses
Commonly required ABIs and mainnet addresses, for use when creating Hardhat based hacks, are available in the protocolArtifacts/
dir.