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.
- Ethereum: #
- Optimism: #
- 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
- Ethereum:
brownie test
- Optimism:
brownie test --chain op
(require anoptimism-fork
network to be setup with brownie)
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
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 |
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.
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 |