Skip to content

Commit ff627d2

Browse files
sparrowDomnaddison36Copilot
authored
Supernova AMO (#2800)
* initial commit * add some deployment files * commit for easier diffs * rename the variable in stableswap * fix the fork tests and adjust them to refactoring * fix fork tests * add strategy file * start re-working tests * migrate some more tests * more work on fork tests * fix the fork tests * prepare supernova fixture * separate pool tilt config into a separate file * fix 6 more fork tests * remove only * fix some more fork tests * fix the swap contract code issue and ~10 fork test as a side effect * test cleanup * moving additional values to configuration field * fix 3 more tests * fix fork test and prettier * WETH no longer requres whitelisting * typo * fix up the harvester test * Fix spelling in Sonic fixture Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Natspec of OETHSupernovaAMOProxy Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update comment in deployActions.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update comment in Sonic fixture Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix comment in Sonic fixture * Supernova AMO additions (#2811) * Removed asset and oToken from StableSwapAMMStrategy constructor Added oToken to IVault which is used by StableSwapAMMStrategy constructor Removed calculateRedeemOutput and calculateRedeemOutputs from IVault * Added contract diagrams for OETHSupernovaAMOStrategy * Fix SwapX AMO fork tests * Fix SwapX AMO fork tests * More rounding issues with Algebra fork tests * add live pool and gauge * fix fork tests * prettier * fix log * Bumped deploy number * correct comment * combine vault upgrade and supernova deploy into a single governance proposal * fix typo * prettier * fix some comments * send tokens after amount out calculation * add a nicer error message when pool is completely tilted into 1 direction * add range protection for maxDepeg * simplify code --------- Co-authored-by: Nick Addison <nick@addisonbrown.com.au> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 6b88f3d commit ff627d2

23 files changed

Lines changed: 4277 additions & 2498 deletions

contracts/contracts/interfaces/IVault.sol

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,18 @@ interface IVault {
139139

140140
function getAllStrategies() external view returns (address[] memory);
141141

142-
/// @notice Deprecated.
142+
function strategies(address _addr)
143+
external
144+
view
145+
returns (VaultStorage.Strategy memory);
146+
147+
/// @notice Deprecated: use `asset()` instead.
143148
function isSupportedAsset(address _asset) external view returns (bool);
144149

145150
function asset() external view returns (address);
146151

152+
function oToken() external view returns (address);
153+
147154
function initialize(address) external;
148155

149156
function addWithdrawalQueueLiquidity() external;

contracts/contracts/interfaces/sonic/ISwapXGauge.sol renamed to contracts/contracts/interfaces/algebra/IAlgebraGauge.sol

File renamed without changes.
File renamed without changes.

contracts/contracts/proxies/Proxies.sol

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,3 +242,10 @@ contract CompoundingStakingSSVStrategyProxy is
242242
contract OUSDMorphoV2StrategyProxy is InitializeGovernedUpgradeabilityProxy {
243243

244244
}
245+
246+
/**
247+
* @notice OETHSupernovaAMOProxy delegates calls to an OETHSupernovaAMOStrategy implementation
248+
*/
249+
contract OETHSupernovaAMOProxy is InitializeGovernedUpgradeabilityProxy {
250+
251+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// SPDX-License-Identifier: BUSL-1.1
2+
pragma solidity ^0.8.0;
3+
4+
/**
5+
* @title Supernova OETH Algorithmic Market Maker (AMO) Strategy
6+
* @notice AMO strategy for the Supernova OETH/WETH stable pool
7+
* @author Origin Protocol Inc
8+
*/
9+
import { StableSwapAMMStrategy } from "./StableSwapAMMStrategy.sol";
10+
11+
contract OETHSupernovaAMOStrategy is StableSwapAMMStrategy {
12+
/**
13+
* @param _baseConfig The `platformAddress` is the address of the Supernova OETH/WETH pool.
14+
* The `vaultAddress` is the address of the OETH Vault.
15+
* @param _gauge Address of the Supernova gauge for the pool.
16+
*/
17+
constructor(BaseStrategyConfig memory _baseConfig, address _gauge)
18+
StableSwapAMMStrategy(_baseConfig, _gauge)
19+
{}
20+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Diagrams
2+
3+
## OETH Supernova AMO Strategy
4+
5+
### Hierarchy
6+
7+
![OETH Supernova AMO Strategy Hierarchy](../../../docs/OETHSupernovaAMOStrategyHierarchy.svg)
8+
9+
### Interactions
10+
11+
![OETH Supernova AMO Strategy Interactions](../../../docs/OETHSupernovaAMOStrategyInteractions.svg)
12+
13+
### Squashed
14+
15+
![OETH Supernova AMO Strategy Squashed](../../../docs/OETHSupernovaAMOStrategySquashed.svg)
16+
17+
### Storage
18+
19+
![OETH Supernova AMO Strategy Storage](../../../docs/OETHSupernovaAMOStrategyStorage.svg)

0 commit comments

Comments
 (0)