This repo holds Astrolab DAO's yield primitives and dependencies.
Besides harvesting/compounding automation (cf. Astrolab Botnet), most of CSA and NSA strategies have off-chain components (eg. cross-chain arb, triangular arb, carry trading), which are not part of this repository, and kept closed-source as part of our Protocol secret sauce.
Astrolab DAO and its core team members will not be held accountable for losses related to the deployment and use of this repository's codebase. As per the licence states, the code is provided as-is and is under active development. The codebase, documentation, and other aspects of the project may be subject to changes and improvements over time.
-
Core contracts
- StrategyV5.sol π― Strategy base contract, extended by all, delegating common logic to StrategyV5Agent
- StrategyV5Agent.sol π Shared strategy back-end, inheriting from As4626
-
Base contracts
- As4626.sol π¦ Full-featured ERC4626 tokenized vault implementation
- AsPermissioned π‘οΈ
AccessControllerconsummer enabling contract RBAC - AsPriceAware π‘
PriceProviderconsummer feeding contracts with live exchange rates - AsFlashLender π¦ Grants the contract EIP-3156 flash lending capabilitites
- AsRescuable βοΈ Grants the contract native and ERC20 emergency token rescue capabilities
-
Standalone deployments
- AccessController π‘οΈ DAO's standalone access controller used for RBAC
- PriceProvider π‘ Oracle adapter dedicated to price retrieval from Chainlink, Pyth, Redstone and more
- Bridger βοΈ Bridge aggregator unifying cross-chain interoperability through Axelar, LayerZero, Wormhole, Chainlink CCTP. Powers the DAO's cross-chain composite Strategies, acUSD, acETH and acBTC (to be migrated from v0)
- Swapper β»οΈ DAO's standalone liquidity aggregator
-
Implementations of DeFi multi-protocol, multi-chain strategies (cf. below)
-
Libs π
- AsCast.sol Safe and unsafe casting
- AsMaths.sol Standard maths library, borrowing from OZ's, ABDK's, PRB's, Uniswap's and Vectorized's
- AsArrays.sol Array manipulation library
- AsAccounting.sol Strategy accounting library
- AsRisk.sol Protocol risk management library
Testing As4626+StrategyV5 with Hardhat (make sure to set HARDHAT_CHAIN_ID=42161 in .env to run the below test to be successful):
yarn test-hardhat # yarn hardhat test test/Compound/CompoundV3Optimizer.test.ts --network hardhatTesting As4626+StrategyV5 with Tenderly (make sure to set TENDERLY_CHAIN_ID=42161 and define your tenderly fork ids in .env for the below test to be successful):
yarn test-tenderly # yarn hardhat test test/Compound/CompoundV3Optimizer.test.ts --network tenderlyFoundry tests are also in the works, used for fuzzing, drafting and debugging (not integration as test suites require extensive data manipulation and http querying).
The repo depends on @astrolabs/hardhat, therefore you can use our generic deployment functions for fine-grain partial deployments of the stack:
import { deployAll } from "@astrolabs/hardhat";
async function main() {
await deployAll({
name: "AsMaths", // deployment unit name
contract: "AsMaths", // contract name
verify: true, // automatically verify on Tenderly or relevant explorer
export: false, // do not export abi+deployment .json
});
}| Type | Symbol | Description | Maximum Leverage | Underlyings |
|---|---|---|---|---|
| Lending | LND | Liquidity providing to highly utilized money markets or CDP issuers (eg. Maker, Frax) | 20:1 | Stables, ETH, BTC, LSDs, LRTs |
| Spot Market Making | SMM | Liquidity providing to bridges (eg. Stargate, Connext) and spot DEXs (eg. Uniswap V2's volatile market making aka. vAMM, Curve's stable market making aka. sAMM, Uniswap V3 concentrated liquidity market making aka. CLMM) direct or delegated to ALMs (active liquidity managers, eg. Gamma for CLMM, Elixir for central limit order books aka. CLOBs) | 20:1 | Stables, ETH, BTC, LSDs, LRTs |
| Derivatives Market Making | DMM | Liquidity providing to derivatives DEXs (eg. GMX, Hyperliquid, Gains) direct or delegated to liquidity managers (eg. Pendle, Elixir for CLOBs) | 20:1 | Stables, ETH, BTC, LSDs, LRTs |
| Unsecured Govt Debt | UGD | Liquidity providing to government debt (eg. US treasuries) through relevant on-chain issuers (e.g. Ondo, Backed) | 10:1 | Stables |
| Unsecured Corp Debt | UCD | Liquidity providing to corporate debt through relevant on-chain issuers (e.g. Maple, Clearpool, Goldfinch) | 10:1 | Stables |
| Hyper Staking | HST | Augmented staking (direct or delegated eg. Lido, Rocket Pool, Ankr, Coinbase, Binance) with restaking (eg. EigenLayer) and LSD arbitrage | 20:1 | Stables, ETH, BTC, LSDs, LRTs |
| Covered Stat Arb | CSA | Delta-neutral trading: carry trading (direct or delegated eg. Ethena), cross-DEX and cross-chain arbitrage | 500:1 | Stables, ETH, BTC, LSDs, LRTs, Alts |
| Naked Stat Arb | NSA | High delta trading: crypto, FX, and equity derivatives (trend following, momentum, mean reversal) | 500:1 | Stables, ETH, BTC, LSDs, LRTs, Alts |
| Insurance | INS | Liquidity providing to protocol-specific (eg. AAVE Umbrella) or multi-protocol (eg. Nexus Mutual) insurers | 10:1 | Stables, ETH, BTC, Alts |
| Services | SER | Liquidity providing to infrastructure providers (governance, identity, gaming, betting eg. ) | 10:1 | Stables, ETH, BTC, Alts |
| Composite | CMP | Structured product that cannot fit a single of the above categories (eg. Astrolab Composites) | 10:1 | Stables, ETH, BTC, LSDs, LRTs |
| Name | Type | Identifier | Status | Compatible Chains |
|---|---|---|---|---|
| AaveV3 Optimizer | LND | AAVE3-O | βοΈ Tested | |
| AaveV3 Arbitrage | LND | AAVE3-A | π§ WIP | |
| Compound V3 Optimizer | LND | COMP3-O | βοΈ Tested | |
| Compound V3 Arbitrage | LND | COMP3-A | π§ WIP | |
| Venus Optimizer | LND | XVS-O | βοΈ Tested | |
| Venus Arbitrage | LND | XVS-A | βοΈ Tested | |
| Lodestar Optimizer | LND | LODE-O | βοΈ Tested | |
| Lodestar Arbitrage | LND | LODE-A | βοΈ Tested | |
| Moonwell Optimizer | LND | WELL-O | βοΈ Tested | |
| Moonwell Arbitrage | LND | WELL-A | π§ WIP | |
| Benqi Optimizer | LND | QI-O | βοΈ Tested | |
| Benqi Arbitrage | LND | QI-A | π§ WIP | |
| Agave Optimizer | LND | AGVE-O | β οΈ Axed | |
| Agave Arbitrage | LND | AGVE-A | β οΈ Axed | |
| Sonne Optimizer | LND | SONNE-O | β οΈ Axed | |
| Sonne Arbitrage | LND | SONNE-A | β οΈ Axed | |
| Stargate Optimizer | SMM | STG-O | βοΈ Tested | |
| Stargate V2 Optimizer | SMM | STG2-O | π§ WIP | |
| Hop Optimizer | SMM | HOP-O | βοΈ Tested | |
| Synapse Optimizer | SMM | SYN-O | π§ WIP | |
| Connext Optimizer | SMM | NEXT-O | π§ WIP | |
| Across Optimizer | SMM | ACX-O | π§ WIP | |
| Uniswap V3 Optimizer | SMM | UNI3-O | π§ WIP | |
| Uniswap V4 Optimizer | SMM | UNI4-O | π§ WIP | |
| Thena Optimizer | SMM | THE-O | βοΈ Tested | |
| Camelot Optimizer | SMM | GRAIL-O | π§ WIP | |
| Velodrome Optimizer | SMM | VELO-O | π§ WIP | |
| Aerodrome Optimizer | SMM | AERO-O | π§ WIP | |
| Toros Optimizer | DMM | TOROS-O | π§ WIP |
| Name | Type | Identifier | Status | Compatible Chains |
|---|---|---|---|---|
| Astrolab Composite USD | CMP | acUSD | π§ WIP | |
| Astrolab Composite ETH | CMP | acETH | π§ WIP | |
| Astrolab Composite BTC | CMP | acBTC | π§ WIP |
Primitives
- Lido/stETH
- RocketPool/rETH
- StakeWise/rETH2+osETH
- Stader/ETHx
- Swell/swETH
- Frax/sfrxETH
- Coinbase/cbETH
- Binance/WBETH
- Mantle/mETH
Derivatives
Primitives
Primitives
- Spark/sDAI
- stUSDT
- Ondo/USDY/OUSG
KYC - Matrixdock/STBT
KYC - OpenEden/TBill
KYC - BackedFi/bIB01
KYC - Hashnote/USYC
KYC - Goldfinch
- Centrifuge
- Maple
- TrueFi
Primitives
Derivatives
Primitives
- Uniswap V2
- Uniswap V3
- Uniswap V4
- Balancer V1
- Balancer V2
- Curve
- Maverick
- Sushi
- PancakeSwap
- QuickSwap
- Trader Joe
- KyberSwap
- DODO
- Wombat
- Biswap
- Camelot
- Velodrome
- iZUMi/iZiSwap
- SyncSwap
Derivatives
Primitives
Derivatives
Primitives
Derivatives
Primitives
Derivatives
Special thanks to peer aggregators who also open source their strategies
Contributions are welcome, the DAO is always open to team up with like-minded builders and strategists. Find us on Discord by day or night ππ Up to 20% of a strategy PnL is claimable to their rightful designer.
Astrolab DAO vetting process on strategy submission is in the works, and will be similar to that of Yearn
Feel free to open an issue or create a pull request if you have any improvements or suggestions.
Started with β€οΈ at DevCon/EthGlobal IST 2023
