Steadefi is the next-gen DeFi protocol designed to provide the highest and most sustainable real yields to our investors without the stress of constant position management or the prolonged downturns of the crypto markets.
Steadefi provides vaults with automated risk management for earning leveraged yields effectively and passively in bull, crab and bear markets. With lending and leveraged delta long and neutral stategies, Steadefi's vaults cater to different risk/reward strategies to the best yield-generating DeFi protocols.
As of October 2023, Steadefi is looking to launch vaults that earn yield from GMX v2 on Arbitrum and Avalanche network.
There are 2 types of vaults: Lending Vaults and Strategy Vaults.
A typical set up for 3x Leverage, Delta Long and Delta Neutral strategies to the ETH-USDC GM LP pool on GMXv2, with isolated ETH and USDC lending vaults are as follows:
Note that Delta Long strategies borrow only USDC for more leverage, while Delta Neutral strategies borrow both USDC for leverage as well as borrow ETH in order to delta hedge the ETH exposure of the liquidity provided to the ETH-USDC GM LP pool (borrowing = hedging).
🚨 For more details, please check out the Technical Documentation directory in this repository.
|Lender||Lenders deposit assets to Lending Vaults (1 asset per Lending Vault) to earn safer, more stable borrow interest on their assets.|
|Depositor||Depositors deposit assets to Strategy Vaults (Strategy Vaults could accept different assets) to earn earn higher yields than if they were to supply their assets to the yield-earning protocol directly. Depending on the strategy however, they take on different types of risk which would affect their final profit and losses.|
|Keeper||Keepers are automated "bots" that run 24/7, frequently scheduled and/or event-triggered code scripts to perform various protocol maintainence tasks. These tasks include updating of borrow interest rates for Lending Vaults, rebalancing Strategy Vaults whose health are out of its' strategy parameter limits, compounding earned yield for Strategy Vaults, reverting certain issues for strategy vaults when they occur and triggering Emergency Pauses for lending and strategy vaults in the event of any possible issues.|
|Owner||Owner are administrators that have rights to configure and update various sensitive vault configurations and parameters. Owners of deployed smart-contracts (vaults, oracles, etc.) should be Timelocks of which are managed by Multi-Sigs that require at least a 2 out of 3 signing approval for any transactions to happen with a 24 hours delay. Note that on contract deployment, the immediate Owner is the hot wallet deployer account. After deploying and initial configuration of the contract, the ownership should be immediately transferred from the hot wallet deployer to a Timelock managed by a Multi-Sig.|
contracts ├── interfaces ├── oracles ├── IChainlinkOracle.sol ├── IGMXOracle.sol ├── strategy ├── gmx ├── IGMXVault.sol ├── IGMXVaultEvent.sol ├── oracles ├── ChainlinkARBOracle.sol ├── GMXOracle.sol ├── strategy ├── gmx ├── GMXCallback.sol ├── GMXChecks.sol ├── GMXCompound.sol ├── GMXDeposit.sol ├── GMXEmergency.sol ├── GMXManager.sol ├── GMXProcessDeposit.sol ├── GMXProcessWithdraw.sol ├── GMXReader.sol ├── GMXRebalance.sol ├── GMXTrove.sol ├── GMXTypes.sol ├── GMXVault.sol ├── GMXWithdraw.sol ├── GMXWorker.sol └── utils ├── Errors.sol
contracts ├── interfaces ├── lending ├── protocols ├── swap ├── tokens ├── lending ├── oracles ├── ChainlinkOracle.sol ├── mocks ├── swaps
Tokens on Arbitrum:
Tokens on Avalanche:
Install all project dependencies with yarn
Compile all contracts
$ yarn compile
Note: You may need to add Foundry to this Hardhat project if you do not have foundry installed: See instructions hereL: https://hardhat.org/hardhat-runner/docs/advanced/hardhat-and-foundry
Deploy scripts are all in the
/scripts directory. Short-cut helper bash functions are in
Note that deployment for different chains or strategies may have different contracts to deploy.
The steps below are for deploying strategy vaults for ETH-USDC on GMX, using Uniswap for asset swaps.
After deploying a contract successful, the address of the contract should be updated in
constants.ts file accordingly so future deploy scripts can utilise the correct deployed contracts.
0) Add deployer wallet private key to
Add deployer private key to
1) Deploy Chainlink Oracle
$ npx hardhat run --network arbitrumOne scripts/arb/oracles/deploy-oracle-chainlink-arb.ts
Note that the price feeds for ETH and USDC should be updated to this oracle.
This oracle is re-usable for future Arbitrum protocol oracles and strategy vaults.
2) Deploy GMX Oracle
$ npx hardhat run --network arbitrumOne scripts/arb/oracles/deploy-oracle-gmx.ts
This oracle is re-usable for future GMX strategy vaults.
3) Deploy a Swap
$ npx hardhat run --network arbitrumOne scripts/arb/swap/deploy-swap-uniswap.ts
Note that the fee tiers for ETH and USDC swap pool should be updated in this swap.
This swap is re-usable for future Arbitrum strategy vaults.
4) Deploy Lending Vaults
# Deploy a native ETH Lending Vault $ npx hardhat run --network arbitrumOne scripts/arb/lending/deploy-lending-vault-native.ts # Deploy a USDC Lending Vault $ npx hardhat run --network arbitrumOne scripts/arb/lending/deploy-lending-vault-stable.ts
These lending vaults will be re-usable for future ETH-USDC GMX strategy vaults.
5) Deploy Strategy Vaults
# Deploy re-usable strategy vault external library contracts $ npx hardhat run --network arbitrumOne scripts/arb/strategy/gmx/deploy-strategy-gmx-libraries.ts # Deploy a Leveraged Long strategy vault $ npx hardhat run --network arbitrumOne scripts/arb/strategy/gmx/deploy-strategy-gmx-long-eth.ts # Deploy a Leveraged Neutral strategy vault $ npx hardhat run --network arbitrumOne scripts/arb/strategy/gmx/deploy-strategy-gmx-neutral-eth.ts
The library contracts deployed will also be re-usable for other GMX strategy vaults.
5) Post-Deployment Setup (optional for audit)
$ forge coverage
Run all tests
$ forge test
Run a particular test suite
$ forge test --match-contract GMXDepositTest
Run a particular test with calltrace
$ forge test --match-test test_createDeposit -vvvv
GMXReader.additionalCapacity()where the computation of shortToken (tokenB) to borrow may underflow.
Additional known issues can be found here