Perpetual Optimizoors provides a calldata-optimized router for Perpetual Protocol, providing significant gas savings to users. This work was funded by an Ethereum Foundation grant. Read our blog post to learn more about how we optimize protocols on L2.
To get started, clone this repo, then follow the below instructions:
# run these commands from the workspace root!
cp .env.example .env
# Run tests
forge test
# Build smart contracts
forge build
Documentation for the contracts can he found here.
Name | Address |
---|---|
Perpetual Router Factory | 0xbF2870611603b2f02B8616E0fE65C60f7657a0f4 |
We have a router factory which deploys calldata optimized routers for specific functionality within
Perpetual Protocol. Currently, we have two types of routers. One that has the functionality for opening and closing
positions which we call the PositionRouter
, and another to deposit ERC20 or Ethereum into a Perpetual vault which
we call the DepositRouter
.
There will be one PositionRouter
contract per position token. For example if a user is opening a vETH
position they will have to call the vETH position router. The same is also true for a DepositRouter
. There
will a DepositRouter
contract per token.
This project is available under the MIT license.
Copyright (c) 2023 ScopeLift