Skip to content

Zap to mint seth and deposit to Curve/Convex

Notifications You must be signed in to change notification settings

convex-community/seth-zap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Synthetix sETH to Curve/Convex Zap

Deposit ETH and borrows then sETH and then deposits sETH into a Curve pool. Possibility to stake on Convex on mainnet.

The same contract can be deployed to Ethereum mainnet and Optimism.

Deployment addresses

  • Ethereum: #
  • Optimism: #

Requirements

  • Python 3.9+
  • Vyper 0.3.4
  • Brownie (latest from the repository)
  • Ganache

To install Brownie, use (the currently availabe 1.19 version does not yet support Vyper 0.3.4): pip install git+git:github.com/eth-brownie/brownie.git#egg=eth-brownie

Tests

  • Ethereum: brownie test
  • Optimism: brownie test --chain op (require an optimism-fork network to be setup with brownie)

Deployment

There is a deployment scripts in /script that can be run as follows, after creating an account in Brownie and updating the account's name in deploy.py

Mainnet: brownie run scripts/deploy.py

Optimism: brownie run scripts/deploy.py --network optimism

Deployment parameters:

Param Description ETH Value OP Value
eth_collateral Address of the Synthetix ETH Collateral contract 0x5c83...5DfA 0x308A...1A41a
seth Address of the sETH token 0x5e74...31cb 0xE405...ee49
curve_pool Address of the ETH/sETH Curve pool 0xc542...4567 0x7Bc5...B35E
token_index Index of sETH token in Curve pool (0 or 1) 1 1
lp_token Address of ETH/sETH Curve pool LP token 0xA3D8...74A9c 0x7Bc5...B35E
booster Address of the Convex Booster contract 0xF403...AE31 0x0000...0000

Deposit

The deposit is a payable function. The specified payable value is used to borrow the specified amount of sETH. No collateral ratio is enforced by the Zap itself (the underlying Synthetix contract will revert if the ratio is too low).

The contract will return Curve LP token to the users. The min_lp_tokens_out parameter can be used to set a minimum expected amount of Curve liquidity tokens to receive in order to prevent front-running.

If the stake_on_convex option is set to true on Ethereum mainnet, the Curve LP tokens will automatically be staked on Convex on behalf of the caller.

Deposit parameters:

Param Description Default value
msg.value Amount of ETH to borrow against N/A
amount Exact amount of sETH to borrow N/A
min_lp_tokens_out Minimum amount of expected Curve sETH/ETH LP tokens 0
stake_on_convex Whether to stake Curve LP tokens on Convex or not False

About

Zap to mint seth and deposit to Curve/Convex

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%