Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changes in docs, target names and redeployments
Browse files Browse the repository at this point in the history
julianmrodri committed Nov 26, 2024
1 parent 0376218 commit 987e1dc
Showing 13 changed files with 53 additions and 51 deletions.
4 changes: 2 additions & 2 deletions contracts/plugins/assets/aerodrome/AerodromePoolTokens.sol
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import "contracts/plugins/assets/OracleLib.sol";
import "contracts/libraries/Fixed.sol";
import "./vendor/IAeroPool.sol";

/// Supports Aerodrome stable pools (2 tokens)
/// Supports Aerodrome stable and volatile pools (2 tokens)
contract AerodromePoolTokens {
using OracleLib for AggregatorV3Interface;
using FixLib for uint192;
@@ -20,7 +20,7 @@ contract AerodromePoolTokens {

enum AeroPoolType {
Stable,
Volatile // not supported in this version
Volatile
}

// === State (Immutable) ===
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ contract AerodromeStableCollateral is AerodromeVolatileCollateral {
using FixLib for uint192;

/// @dev config Unused members: chainlinkFeed, oracleError, oracleTimeout
/// @dev No revenue hiding (refPerTok() == FIX_ONE)
/// @dev No revenue hiding (refPerTok() is constant)
/// @dev config.erc20 should be an AerodromeStakingWrapper
constructor(CollateralConfig memory config, APTConfiguration memory aptConfig)
AerodromeVolatileCollateral(config, aptConfig)
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ contract AerodromeVolatileCollateral is FiatCollateral, AerodromePoolTokens {
using FixLib for uint192;

/// @dev config Unused members: chainlinkFeed, oracleError, oracleTimout
/// @dev No revenue hiding (refPerTok() == FIX_ONE)
/// @dev No revenue hiding (refPerTok() is constant)
/// @dev config.erc20 should be an AerodromeStakingWrapper
constructor(CollateralConfig memory config, APTConfiguration memory aptConfig)
FiatCollateral(config)
18 changes: 10 additions & 8 deletions contracts/plugins/assets/aerodrome/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Aerodrome Stable Collateral Plugin
# Aerodrome Collateral Plugins

[Aerodrome Finance](https://aerodrome.finance) is an AMM designed to serve as Base's central liquidity hub. This plugin enables the use of any Aerodrome Stable LP token as collateral within the Reserve Protocol.
[Aerodrome Finance](https://aerodrome.finance) is an AMM designed to serve as Base's central liquidity hub. This plugin enables the use of any Aerodrome Stable and Volatile LP token as collateral within the Reserve Protocol.

Aerodrome Finance offers two different liquidity pool types based on token pair needs, `Stable Pools` and `Volatile Pools`.

Only `Stable Pools` are currently supported. These pools are designed for tokens which have little to no volatility, and use the current formula for pricing tokens:
`Stable Pools` are designed for tokens which have little to no volatility, and use the current formula for pricing tokens: `x³y + y³x ≥ k`

`x³y + y³x ≥ k`
`Volatile Pools` are designed for tokens with high price volatility, and use a generic AMM formula: `x × y ≥ k`

## Usage

@@ -36,10 +36,12 @@ Internally, all `tokensPriceFeeds` are stored as multiple separate immutable var

### refPerTok

Aerodrome Stable Pools do not appreciate in value over time, so `refPerTok()` will be constant for these plugins and will not change. This also means there are no hard default checks in place.
Aerodrome Pools do not appreciate in value over time, so `refPerTok()` will be constant for these plugins and will not change. This also means there are no hard default checks in place.

## Implementation

| `tok` | `ref` | `target` | `UoA` |
| :------------------: | :---------------: | :------: | :---: |
| Aero Staking Wrapper | LP token /w shift | USD | USD |
| `tok` | `ref` | `target` | `UoA` |
| :------------------: | :---------------: | :--------: | :---: |

Stable | Aero Staking Wrapper | LP token /w shift | USD | USD |
Volatile | Aero Staking Wrapper | LP token /w shift | cpAMM | USD |
22 changes: 11 additions & 11 deletions scripts/addresses/8453-tmp-assets-collateral.json
Original file line number Diff line number Diff line change
@@ -14,13 +14,13 @@
"cUSDCv3": "0xf7a9D27c3B60c78c6F6e2c2d6ED6E8B94b352461",
"wstETH": "0x8b4374005291B8FCD14C4E947604b2FB3C660A73",
"aeroUSDCeUSD": "0x9216CD5cA133aBBd23cc6F873bB4a95A78032db0",
"aeroWETHAERO": "0x1bD9eAEB0eD1aB51dA1Ff8D437892488790bbde7",
"aeroMOGWETH": "0x6Ec09BD7d32F1023626AaEa1090e178d81C7701A",
"aeroWETHAERO": "0xaC23df4289e2FeaFb2851e63958C2AAF41DB4833",
"aeroMOGWETH": "0xfAa0cfc986041a3aF69207C6fCF35316D58fEA6a",
"meUSD": "0x0f1e10871e6a2D3A5Aa696b85b39d61a22A9e8C3",
"aeroUSDzUSDC": "0x8AAdfbea33146e28170F99D031B7747EAa87DDD4",
"aeroWETHcbBTC": "0x053faB552020e7E6Eda010134032d8d4A30aD0Ff",
"aeroWETHWELL": "0x0F9d92D28B33E79A56b32d15aEeDbE20820290E5",
"aeroWETHDEGEN": "0x672664DFdF6666F0dE32CA46F1390cFa74454F88"
"aeroWETHcbBTC": "0x5ABe1A8b04A2428589bAeF9486d12688d482D061",
"aeroWETHWELL": "0x7df3541FFeDAA956aE6136E64253f3749b055Be6",
"aeroWETHDEGEN": "0xc8E72288f717Da55b7231365daE17AcD91b59705"
},
"erc20s": {
"COMP": "0x9e1028F5F1D5eDE59748FFceE5532509976840E0",
@@ -34,13 +34,13 @@
"cUSDCv3": "0x53f1Df4E5591Ae35Bf738742981669c3767241FA",
"wstETH": "0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452",
"aeroUSDCeUSD": "0xDB5b8cead52f77De0f6B5255f73F348AAf2CBb8D",
"aeroWETHAERO": "0x3712DDCF9aE516dD01042948B76A76901a84CD36",
"aeroMOGWETH": "0xCcC18B21be01a37ebFa5C932eD09574752F88C15",
"aeroWETHAERO": "0x65f2c1b253a3E45670aDD259C9688Edf1A3b814d",
"aeroMOGWETH": "0xfaAC26b279338dF8cF56B11A572617f674A2F69C",
"meUSD": "0xbb819D845b573B5D7C538F5b85057160cfb5f313",
"AERO": "0x940181a94A35A4569E4529A3CDfB74e38FD98631",
"aeroUSDzUSDC": "0x246Df11B856E9fD6120494F168475e1b41321c61",
"aeroWETHcbBTC": "0x864E79375917c28879F2262F6AC3F08eC887A489",
"aeroWETHWELL": "0x8Fab568e9881b9c2aCC0e594A1DE8D463d783Ecb",
"aeroWETHDEGEN": "0x30d4993331F542300bc1f8247BEAA4e52219ba83"
"aeroWETHcbBTC": "0x4BD08a771CdAbA5333CAc6F20322eD7d72b6cBfA",
"aeroWETHWELL": "0x1F599F8657CAA38Ee825e4E2d64F695749E2a161",
"aeroWETHDEGEN": "0xA762F790a31654D9AeF7DE550A473A0F5621E4F1"
}
}
}
2 changes: 1 addition & 1 deletion scripts/addresses/8453-tmp-deployments.json
Original file line number Diff line number Diff line change
@@ -37,4 +37,4 @@
"stRSR": "0x4Cf200D7fA568611DD8B4BD85053ba9419982C7D"
}
}
}
}
20 changes: 10 additions & 10 deletions scripts/addresses/base-4.0.0/8453-tmp-assets-collateral.json
Original file line number Diff line number Diff line change
@@ -6,21 +6,21 @@
"meUSD": "0x0f1e10871e6a2D3A5Aa696b85b39d61a22A9e8C3",
"aeroUSDCeUSD": "0x9216CD5cA133aBBd23cc6F873bB4a95A78032db0",
"aeroUSDzUSDC": "0x8AAdfbea33146e28170F99D031B7747EAa87DDD4",
"aeroWETHAERO": "0x1bD9eAEB0eD1aB51dA1Ff8D437892488790bbde7",
"aeroMOGWETH": "0x6Ec09BD7d32F1023626AaEa1090e178d81C7701A",
"aeroWETHcbBTC": "0x053faB552020e7E6Eda010134032d8d4A30aD0Ff",
"aeroWETHWELL": "0x0F9d92D28B33E79A56b32d15aEeDbE20820290E5",
"aeroWETHDEGEN": "0x672664DFdF6666F0dE32CA46F1390cFa74454F88"
"aeroWETHAERO": "0xaC23df4289e2FeaFb2851e63958C2AAF41DB4833",
"aeroMOGWETH": "0xfAa0cfc986041a3aF69207C6fCF35316D58fEA6a",
"aeroWETHcbBTC": "0x5ABe1A8b04A2428589bAeF9486d12688d482D061",
"aeroWETHWELL": "0x7df3541FFeDAA956aE6136E64253f3749b055Be6",
"aeroWETHDEGEN": "0xc8E72288f717Da55b7231365daE17AcD91b59705"
},
"erc20s": {
"meUSD": "0xbb819D845b573B5D7C538F5b85057160cfb5f313",
"aeroUSDCeUSD": "0xDB5b8cead52f77De0f6B5255f73F348AAf2CBb8D",
"AERO": "0x940181a94A35A4569E4529A3CDfB74e38FD98631",
"aeroUSDzUSDC": "0x246Df11B856E9fD6120494F168475e1b41321c61",
"aeroWETHAERO": "0x3712DDCF9aE516dD01042948B76A76901a84CD36",
"aeroMOGWETH": "0xCcC18B21be01a37ebFa5C932eD09574752F88C15",
"aeroWETHcbBTC": "0x864E79375917c28879F2262F6AC3F08eC887A489",
"aeroWETHWELL": "0x8Fab568e9881b9c2aCC0e594A1DE8D463d783Ecb",
"aeroWETHDEGEN": "0x30d4993331F542300bc1f8247BEAA4e52219ba83"
"aeroWETHAERO": "0x65f2c1b253a3E45670aDD259C9688Edf1A3b814d",
"aeroMOGWETH": "0xfaAC26b279338dF8cF56B11A572617f674A2F69C",
"aeroWETHcbBTC": "0x4BD08a771CdAbA5333CAc6F20322eD7d72b6cBfA",
"aeroWETHWELL": "0x1F599F8657CAA38Ee825e4E2d64F695749E2a161",
"aeroWETHDEGEN": "0xA762F790a31654D9AeF7DE550A473A0F5621E4F1"
}
}
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ async function main() {

// Only for Base
if (baseL2Chains.includes(hre.network.name)) {
const AerodromeStableCollateralFactory = await hre.ethers.getContractFactory(
const AerodromeVolatileCollateralFactory = await hre.ethers.getContractFactory(
'AerodromeVolatileCollateral'
)
const AerodromeGaugeWrapperFactory = await ethers.getContractFactory('AerodromeGaugeWrapper')
@@ -87,14 +87,14 @@ async function main() {
`Deployed wrapper for Aerodrome Volatile MOG-WETH pool on ${hre.network.name} (${chainId}): ${wMogWeth.address} `
)

const oracleError = combinedError(MOG_ORACLE_ERROR, ETH_ORACLE_ERROR) // 0.5% & 0.5%
const oracleError = combinedError(MOG_ORACLE_ERROR, ETH_ORACLE_ERROR) // 0.5% & 0.15%

collateral = <AerodromeVolatileCollateral>await AerodromeStableCollateralFactory.connect(
collateral = <AerodromeVolatileCollateral>await AerodromeVolatileCollateralFactory.connect(
deployer
).deploy(
{
erc20: wMogWeth.address,
targetName: ethers.utils.formatBytes32String('50%ETH50%MOG'), // lexicographical order for tokens
targetName: ethers.utils.formatBytes32String('MOG_ETH_AERODROME_cpAMM'),
priceTimeout: PRICE_TIMEOUT,
chainlinkFeed: ONE_ADDRESS, // unused but cannot be zero
oracleError: oracleError.toString(), // unused but cannot be zero
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ async function main() {

// Only for Base
if (baseL2Chains.includes(hre.network.name)) {
const AerodromeStableCollateralFactory = await hre.ethers.getContractFactory(
const AerodromeVolatileCollateralFactory = await hre.ethers.getContractFactory(
'AerodromeVolatileCollateral'
)
const AerodromeGaugeWrapperFactory = await ethers.getContractFactory('AerodromeGaugeWrapper')
@@ -89,12 +89,12 @@ async function main() {

const oracleError = combinedError(AERO_ORACLE_ERROR, ETH_ORACLE_ERROR) // 0.5% & 0.15%

collateral = <AerodromeVolatileCollateral>await AerodromeStableCollateralFactory.connect(
collateral = <AerodromeVolatileCollateral>await AerodromeVolatileCollateralFactory.connect(
deployer
).deploy(
{
erc20: wWethAero.address,
targetName: ethers.utils.formatBytes32String('50%AERO50%ETH'), // lexicographical order for tokens
targetName: ethers.utils.formatBytes32String('ETH_AERO_AERODROME_cpAMM'),
priceTimeout: PRICE_TIMEOUT,
chainlinkFeed: ONE_ADDRESS, // unused but cannot be zero
oracleError: oracleError.toString(), // unused but cannot be zero
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ async function main() {

// Only for Base
if (baseL2Chains.includes(hre.network.name)) {
const AerodromeStableCollateralFactory = await hre.ethers.getContractFactory(
const AerodromeVolatileCollateralFactory = await hre.ethers.getContractFactory(
'AerodromeVolatileCollateral'
)
const AerodromeGaugeWrapperFactory = await ethers.getContractFactory('AerodromeGaugeWrapper')
@@ -89,12 +89,12 @@ async function main() {

const oracleError = combinedError(cbBTC_ORACLE_ERROR, ETH_ORACLE_ERROR) // 0.3% & 0.15%

collateral = <AerodromeVolatileCollateral>await AerodromeStableCollateralFactory.connect(
collateral = <AerodromeVolatileCollateral>await AerodromeVolatileCollateralFactory.connect(
deployer
).deploy(
{
erc20: wWethcbBTC.address,
targetName: ethers.utils.formatBytes32String('50%BTC50%ETH'), // lexicographical order for tokens
targetName: ethers.utils.formatBytes32String('ETH_BTC_AERODROME_cpAMM'),
priceTimeout: PRICE_TIMEOUT,
chainlinkFeed: ONE_ADDRESS, // unused but cannot be zero
oracleError: oracleError.toString(), // unused but cannot be zero
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ async function main() {

// Only for Base
if (baseL2Chains.includes(hre.network.name)) {
const AerodromeStableCollateralFactory = await hre.ethers.getContractFactory(
const AerodromeVolatileCollateralFactory = await hre.ethers.getContractFactory(
'AerodromeVolatileCollateral'
)
const AerodromeGaugeWrapperFactory = await ethers.getContractFactory('AerodromeGaugeWrapper')
@@ -89,12 +89,12 @@ async function main() {

const oracleError = combinedError(DEGEN_ORACLE_ERROR, ETH_ORACLE_ERROR) // 0.5% & 0.15%

collateral = <AerodromeVolatileCollateral>await AerodromeStableCollateralFactory.connect(
collateral = <AerodromeVolatileCollateral>await AerodromeVolatileCollateralFactory.connect(
deployer
).deploy(
{
erc20: wWethDEGEN.address,
targetName: ethers.utils.formatBytes32String('50%DEGEN50%ETH'), // lexicographical order for tokens
targetName: ethers.utils.formatBytes32String('ETH_DEGEN_AERODROME_cpAMM'),
priceTimeout: PRICE_TIMEOUT,
chainlinkFeed: ONE_ADDRESS, // unused but cannot be zero
oracleError: oracleError.toString(), // unused but cannot be zero
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ async function main() {

// Only for Base
if (baseL2Chains.includes(hre.network.name)) {
const AerodromeStableCollateralFactory = await hre.ethers.getContractFactory(
const AerodromeVolatileCollateralFactory = await hre.ethers.getContractFactory(
'AerodromeVolatileCollateral'
)
const AerodromeGaugeWrapperFactory = await ethers.getContractFactory('AerodromeGaugeWrapper')
@@ -89,12 +89,12 @@ async function main() {

const oracleError = combinedError(WELL_ORACLE_ERROR, ETH_ORACLE_ERROR) // 0.5% & 0.15%

collateral = <AerodromeVolatileCollateral>await AerodromeStableCollateralFactory.connect(
collateral = <AerodromeVolatileCollateral>await AerodromeVolatileCollateralFactory.connect(
deployer
).deploy(
{
erc20: wWethWELL.address,
targetName: ethers.utils.formatBytes32String('50%ETH50%WELL'), // lexicographical order for tokens
targetName: ethers.utils.formatBytes32String('ETH_WELL_AERODROME_cpAMM'),
priceTimeout: PRICE_TIMEOUT,
chainlinkFeed: ONE_ADDRESS, // unused but cannot be zero
oracleError: oracleError.toString(), // unused but cannot be zero
2 changes: 1 addition & 1 deletion test/plugins/individual-collateral/aerodrome/constants.ts
Original file line number Diff line number Diff line change
@@ -107,7 +107,7 @@ export const FIX_ONE = 1n * 10n ** 18n
export const ORACLE_ERROR = fp('0.005')
export const PRICE_TIMEOUT = bn('604800') // 1 week
export const DEFAULT_THRESHOLD = fp('0.02') // 2%
export const DELAY_UNTIL_DEFAULT = bn('259200') // 72h CAREFUL THIS IS ONLY FOR RTOKEN POOLS
export const DELAY_UNTIL_DEFAULT = bn('259200') // 72h CAREFUL THIS IS ONLY FOR STABLE POOLS
export const MAX_TRADE_VOL = fp('1e6')

export enum AerodromePoolType {

0 comments on commit 987e1dc

Please sign in to comment.