Skip to content

Commit 2986c32

Browse files
committed
Merge remote-tracking branch 'origin/master' into sparrowDom/deploy_134
2 parents e201d2c + bc6092c commit 2986c32

27 files changed

+4865
-772
lines changed

brownie/abi/ousd_curve_amo_strat.json

Lines changed: 583 additions & 0 deletions
Large diffs are not rendered by default.

brownie/abi/ousd_curve_pool.json

Lines changed: 680 additions & 0 deletions
Large diffs are not rendered by default.

brownie/addresses.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747

4848
MORPHO_GAUNTLET_PRIME_USDC_STRAT = '0x2b8f37893ee713a4e9ff0ceb79f27539f20a32a1'
4949
MORPHO_GAUNTLET_PRIME_USDT_STRAT = '0xe3ae7c80a1b02ccd3fb0227773553aeb14e32f26'
50+
OUSD_CURVE_AMO_STRAT = "0x26a02ec47ACC2A3442b757F45E0A82B8e993Ce11"
5051

5152
# OETH Contracts
5253
OETH = '0x856c4Efb76C1D1AE02e20CEB03A2A6a08b0b8dC3'
@@ -107,6 +108,8 @@
107108
OETHB_WETH_BRIBE_CONTRACT = '0x685ce0e36ca4b81f13b7551c76143d962568f6dd'
108109
OETHB_ZAPPER = "0x3b56c09543D3068f8488ED34e6F383c3854d2bC1"
109110

111+
CURVE_POOL_BASE = "0x302A94E3C28c290EAF2a4605FC52e11Eb915f378"
112+
110113
# OGV Contracts
111114
OGV = "0x9c354503C38481a7A7a51629142963F98eCC12D0"
112115
REWARDS = "0x7d82E86CF1496f9485a8ea04012afeb3C7489397"
@@ -135,6 +138,7 @@
135138
FRAX_METAPOOL = '0xd632f22692FaC7611d2AA1C0D552930D43CAEd3B'
136139
BUSD_METAPOOL = '0x4807862AA8b2bF68830e4C8dc86D0e9A998e085a'
137140
THREEPOOL = '0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7'
141+
OUSD_CURVE_POOL = '0x6d18E1a7faeB1F0467A77C0d293872ab685426dc'
138142

139143
# Other
140144
UNISWAP_V2_ROUTER = '0x7a250d5630b4cf539739df2c5dacb4c659f2488d'

brownie/runlogs/2025_04_strategist.py

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
# -------------------------------------
2+
# Apr 24, 2025 - Withdraw 100k USDC from OUSD Morpho Steakhouse and
3+
# deposit to the new OUSD Curve AMO
4+
# -------------------------------------
5+
from world import *
6+
7+
def main():
8+
with TemporaryForkForReallocations() as txs:
9+
# Before
10+
txs.append(vault_core.rebase(std))
11+
txs.append(vault_value_checker.takeSnapshot(std))
12+
13+
# AMO pool before
14+
usdcPoolBalance = usdc.balanceOf(OUSD_CURVE_POOL)
15+
ousdPoolBalance = ousd.balanceOf(OUSD_CURVE_POOL)
16+
totalPool = usdcPoolBalance * 10**12 + ousdPoolBalance
17+
price_before = ousd_curve_pool.get_dy(0, 1, 10 * 10**18)
18+
19+
print("Curve OUSD/USDC Pool before")
20+
print("Pool USDC ", "{:.6f}".format(usdcPoolBalance / 10**6), usdcPoolBalance * 10**12 * 100 / totalPool)
21+
print("Pool OUSD ", "{:.6f}".format(ousdPoolBalance / 10**18), ousdPoolBalance * 100 / totalPool)
22+
print("Pool Total ", "{:.6f}".format(totalPool / 10**18))
23+
24+
# Remove 100k USDC from Morpho Steakhouse Strategy
25+
txs.append(
26+
vault_admin.withdrawFromStrategy(
27+
MORPHO_META_USDC_STRAT,
28+
[usdc],
29+
[100000 * 10**6],
30+
{'from': STRATEGIST}
31+
)
32+
)
33+
34+
# Deposit 100k USDC to Curve AMO
35+
txs.append(
36+
vault_admin.depositToStrategy(
37+
OUSD_CURVE_AMO_STRAT,
38+
[usdc],
39+
[100000 * 10**6],
40+
{'from': STRATEGIST}
41+
)
42+
)
43+
44+
# After
45+
vault_change = vault_core.totalValue() - vault_value_checker.snapshots(STRATEGIST)[0]
46+
supply_change = ousd.totalSupply() - vault_value_checker.snapshots(STRATEGIST)[1]
47+
profit = vault_change - supply_change
48+
txs.append(vault_value_checker.checkDelta(profit, (1 * 10**18), vault_change, (1 * 10**18), std))
49+
print("-----")
50+
print("Profit", "{:.6f}".format(profit / 10**18), profit)
51+
print("OUSD supply change", "{:.6f}".format(supply_change / 10**18), supply_change)
52+
print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change)
53+
print("-----")
54+
55+
# AMO pool after
56+
usdcPoolBalance = usdc.balanceOf(OUSD_CURVE_POOL)
57+
ousdPoolBalance = ousd.balanceOf(OUSD_CURVE_POOL)
58+
totalPool = usdcPoolBalance * 10**12 + ousdPoolBalance
59+
price_after = ousd_curve_pool.get_dy(0, 1, 10 * 10**18)
60+
61+
print("Curve OUSD/USDC Pool after")
62+
print("Pool USDC ", "{:.6f}".format(usdcPoolBalance / 10**6), usdcPoolBalance * 10**12 * 100 / totalPool)
63+
print("Pool OUSD ", "{:.6f}".format(ousdPoolBalance / 10**18), ousdPoolBalance * 100 / totalPool)
64+
print("Pool Total ", "{:.6f}".format(totalPool / 10**18))
65+
print("OUSD/USDC Curve prices before and after", "{:.6f}".format(price_before / 10**7), "{:.6f}".format(price_after / 10**7))
66+
67+
68+
# -------------------------------------
69+
# Apr 24, 2025 - Remove and Burn OUSD from the OUSD/USDC Curve Pool
70+
# -------------------------------------
71+
from world import *
72+
73+
def main():
74+
with TemporaryForkForReallocations() as txs:
75+
# Before
76+
txs.append(vault_core.rebase(std))
77+
txs.append(vault_value_checker.takeSnapshot(std))
78+
79+
# AMO pool before
80+
usdcPoolBalance = usdc.balanceOf(OUSD_CURVE_POOL)
81+
ousdPoolBalance = ousd.balanceOf(OUSD_CURVE_POOL)
82+
totalPool = usdcPoolBalance * 10**12 + ousdPoolBalance
83+
price_before = ousd_curve_pool.get_dy(0, 1, 10 * 10**18)
84+
85+
print("Curve OUSD/USDC Pool before")
86+
print("Pool USDC ", "{:.6f}".format(usdcPoolBalance / 10**6), usdcPoolBalance * 10**12 * 100 / totalPool)
87+
print("Pool OUSD ", "{:.6f}".format(ousdPoolBalance / 10**18), ousdPoolBalance * 100 / totalPool)
88+
print("Pool Total ", "{:.6f}".format(totalPool / 10**18))
89+
90+
# Remove and burn OUSD from the Curve pool
91+
curve_lp = 50000 * 10**18
92+
txs.append(
93+
ousd_curve_amo_strat.removeAndBurnOTokens(
94+
curve_lp,
95+
{'from': STRATEGIST}
96+
)
97+
)
98+
99+
# After
100+
vault_change = vault_core.totalValue() - vault_value_checker.snapshots(STRATEGIST)[0]
101+
supply_change = ousd.totalSupply() - vault_value_checker.snapshots(STRATEGIST)[1]
102+
profit = vault_change - supply_change
103+
txs.append(vault_value_checker.checkDelta(profit, (1 * 10**18), vault_change, (1 * 10**18), std))
104+
print("-----")
105+
print("Profit", "{:.6f}".format(profit / 10**18), profit)
106+
print("OUSD supply change", "{:.6f}".format(supply_change / 10**18), supply_change)
107+
print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change)
108+
print("-----")
109+
110+
# AMO pool after
111+
usdcPoolBalance = usdc.balanceOf(OUSD_CURVE_POOL)
112+
ousdPoolBalance = ousd.balanceOf(OUSD_CURVE_POOL)
113+
totalPool = usdcPoolBalance * 10**12 + ousdPoolBalance
114+
price_after = ousd_curve_pool.get_dy(0, 1, 10 * 10**18)
115+
116+
print("Curve OUSD/USDC Pool after")
117+
print("Pool USDC ", "{:.6f}".format(usdcPoolBalance / 10**6), usdcPoolBalance * 10**12 * 100 / totalPool)
118+
print("Pool OUSD ", "{:.6f}".format(ousdPoolBalance / 10**18), ousdPoolBalance * 100 / totalPool)
119+
print("Pool Total ", "{:.6f}".format(totalPool / 10**18))
120+
print("OUSD/USDC Curve prices before and after", "{:.6f}".format(price_before / 10**7), "{:.6f}".format(price_after / 10**7))
121+
122+
123+
# -------------------------------------
124+
# Apr 29, 2025 - Deposit to third native staking strategy
125+
# -------------------------------------
126+
from world import *
127+
128+
def main():
129+
with TemporaryForkForReallocations() as txs:
130+
# Before
131+
txs.append(vault_oeth_core.rebase(std))
132+
txs.append(oeth_vault_value_checker.takeSnapshot(std))
133+
134+
# Deposit WETH to Third Native Staking Strategy
135+
txs.append(
136+
vault_oeth_admin.depositToStrategy(
137+
OETH_NATIVE_STAKING_3_STRAT,
138+
[WETH],
139+
# 8 validator
140+
[256 * 10**18],
141+
std
142+
)
143+
)
144+
145+
# After
146+
vault_change = vault_oeth_core.totalValue() - oeth_vault_value_checker.snapshots(STRATEGIST)[0]
147+
supply_change = oeth.totalSupply() - oeth_vault_value_checker.snapshots(STRATEGIST)[1]
148+
profit = vault_change - supply_change
149+
txs.append(oeth_vault_value_checker.checkDelta(profit, (1 * 10**18), vault_change, (1 * 10**18), std))
150+
print("-----")
151+
print("Profit", "{:.6f}".format(profit / 10**18), profit)
152+
print("OETH supply change", "{:.6f}".format(supply_change / 10**18), supply_change)
153+
print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change)
154+
print("-----")
155+
156+
# -------------------------------------
157+
# Apr 29, 2025 - Base deposit to Curve AMO strategy
158+
# -------------------------------------
159+
from aerodrome_harvest import *
160+
from brownie import accounts
161+
import eth_abi
162+
163+
def main():
164+
with TemporaryForkForReallocations() as txs:
165+
# Rebase
166+
txs.append(vault_core.rebase({ 'from': OETHB_MULTICHAIN_STRATEGIST }))
167+
168+
# Take Vault snapshot
169+
txs.append(vault_value_checker.takeSnapshot({ 'from': OETHB_MULTICHAIN_STRATEGIST }))
170+
171+
# AMO pool before
172+
wethPoolBalance = weth.balanceOf(CURVE_POOL_BASE)
173+
oethPoolBalance = oethb.balanceOf(CURVE_POOL_BASE)
174+
totalPool = wethPoolBalance + oethPoolBalance
175+
price_before = curve_pool.get_dy(1, 0, 10 * 10**18)
176+
177+
print("Curve SuperOETH/WETH Pool before")
178+
print("Pool WETH ", "{:.6f}".format(wethPoolBalance / 10**18), wethPoolBalance * 100 / totalPool)
179+
print("Pool SuperOETH ", "{:.6f}".format(oethPoolBalance / 10**18), oethPoolBalance * 100 / totalPool)
180+
print("Pool Total ", "{:.6f}".format(totalPool / 10**18))
181+
print("-----")
182+
183+
# Deposit 165 WETH to Curve AMO strategy
184+
txs.append(
185+
vault_admin.depositToStrategy(
186+
OETHB_CURVE_AMO_STRATEGY,
187+
[weth],
188+
[165 * 10**18],
189+
{'from': OETHB_MULTICHAIN_STRATEGIST}
190+
)
191+
)
192+
193+
# AMO pool after
194+
wethPoolBalance = weth.balanceOf(CURVE_POOL_BASE)
195+
oethPoolBalance = oethb.balanceOf(CURVE_POOL_BASE)
196+
totalPool = wethPoolBalance + oethPoolBalance
197+
price_after = curve_pool.get_dy(1, 0, 10 * 10**18)
198+
199+
print("Curve SuperOETH/WETH Pool after")
200+
print("Pool WETH ", "{:.6f}".format(wethPoolBalance / 10**18), wethPoolBalance * 100 / totalPool)
201+
print("Pool SuperOETH ", "{:.6f}".format(oethPoolBalance / 10**18), oethPoolBalance * 100 / totalPool)
202+
print("Pool Total ", "{:.6f}".format(totalPool / 10**18))
203+
print("SuperOETH/WETH Curve prices before and after", "{:.6f}".format(price_before / 10**19), "{:.6f}".format(price_after / 10**19))
204+
205+
# After
206+
vault_change = vault_core.totalValue() - vault_value_checker.snapshots(OETHB_MULTICHAIN_STRATEGIST)[0]
207+
supply_change = oethb.totalSupply() - vault_value_checker.snapshots(OETHB_MULTICHAIN_STRATEGIST)[1]
208+
profit = vault_change - supply_change
209+
txs.append(vault_value_checker.checkDelta(profit, (1 * 10**18), vault_change, (1 * 10**18), {'from': OETHB_MULTICHAIN_STRATEGIST}))
210+
print("-----")
211+
print("Profit", "{:.6f}".format(profit / 10**18), profit)
212+
print("SuperOETH supply change", "{:.6f}".format(supply_change / 10**18), supply_change)
213+
print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change)
214+
print("-----")

brownie/world.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
comp_strat = load_contract('comp_strat', COMP_STRAT)
5252
convex_strat = load_contract('convex_strat', CONVEX_STRAT)
5353
ousd_meta_strat = load_contract('ousd_metastrat', OUSD_METASTRAT)
54+
ousd_curve_amo_strat = load_contract('ousd_curve_amo_strat', OUSD_CURVE_AMO_STRAT)
5455
morpho_comp_strat = load_contract('morpho_comp_strat', MORPHO_COMP_STRAT)
5556
morpho_aave_strat = load_contract('morpho_aave_strat', MORPHO_AAVE_STRAT)
5657
lusd_3pool_strat = load_contract('lusd_3pool_strat', LUSD_3POOL_STRAT)
@@ -64,6 +65,7 @@
6465

6566
ousd_metapool = load_contract("ousd_metapool", OUSD_METAPOOL)
6667
threepool = load_contract("threepool_swap", THREEPOOL)
68+
ousd_curve_pool = load_contract("ousd_curve_pool", OUSD_CURVE_POOL)
6769

6870
aave_incentives_controller = load_contract('aave_incentives_controller', '0xd784927Ff2f95ba542BfC824c8a8a98F3495f6b5')
6971
stkaave = load_contract('stkaave', '0x4da27a545c0c5B758a6BA100e3a049001de870f5')

brownie/world_base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
aero_quoter = load_contract('aerodrome_quoter', AERODROME_QUOTER_BASE)
2121
aero_helper = load_contract('aerodrome_slipstream_sugar_helper', AERODROME_SUGAR_HELPER_BASE)
2222
amo_pool = load_contract('aerodrome_slipstream_pool', AERODROME_WETH_OETHB_POOL_BASE)
23+
curve_pool = load_contract('curve_pool_base', CURVE_POOL_BASE)
2324

2425
ogn_pool = load_contract('aerodrome_ogn_pool', AERODROME_OGN_OETHB_POOL_BASE)
2526
oethb_weth_bribe = load_contract('aero_bribes', OETHB_WETH_BRIBE_CONTRACT)
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
const { deployOnBase } = require("../../utils/deploy-l2");
2+
const { deployWithConfirmation } = require("../../utils/deploy");
3+
const { parseUnits } = require("ethers/lib/utils.js");
4+
const addresses = require("../../utils/addresses");
5+
6+
module.exports = deployOnBase(
7+
{
8+
deployName: "028_vault_woeth_upgrade",
9+
},
10+
async ({ ethers }) => {
11+
const cOETHbVaultProxy = await ethers.getContract("OETHBaseVaultProxy");
12+
const cwOETHbProxy = await ethers.getContract("WOETHBaseProxy");
13+
const cOETHbProxy = await ethers.getContract("OETHBaseProxy");
14+
15+
const cOETHbVault = await ethers.getContractAt(
16+
"IVault",
17+
cOETHbVaultProxy.address
18+
);
19+
20+
// Deploy new implementation
21+
const dOETHbVaultCore = await deployWithConfirmation("OETHBaseVaultCore", [
22+
addresses.base.WETH,
23+
]);
24+
const dOETHbVaultAdmin = await deployWithConfirmation(
25+
"OETHBaseVaultAdmin",
26+
[addresses.base.WETH]
27+
);
28+
29+
const dwOETHb = await deployWithConfirmation("WOETHBase", [
30+
cOETHbProxy.address, // Base OETH token
31+
]);
32+
33+
const cwOETHb = await ethers.getContractAt(
34+
"WOETHBase",
35+
cwOETHbProxy.address
36+
);
37+
38+
// ----------------
39+
// Governance Actions
40+
// ----------------
41+
return {
42+
name: "Add rate limiting to Origin Base Vault",
43+
actions: [
44+
// 1. Upgrade Vault proxy to VaultCore
45+
{
46+
contract: cOETHbVaultProxy,
47+
signature: "upgradeTo(address)",
48+
args: [dOETHbVaultCore.address],
49+
},
50+
// 2. Set the VaultAdmin
51+
{
52+
contract: cOETHbVault,
53+
signature: "setAdminImpl(address)",
54+
args: [dOETHbVaultAdmin.address],
55+
},
56+
// 3. Default to a short dripper, since currently we are running zero dripper.
57+
{
58+
contract: cOETHbVault,
59+
signature: "setDripDuration(uint256)",
60+
args: [4 * 60 * 60],
61+
},
62+
// 4. Default to a 20% APR rebase rate cap
63+
{
64+
contract: cOETHbVault,
65+
signature: "setRebaseRateMax(uint256)",
66+
args: [parseUnits("20", 18)],
67+
},
68+
{
69+
// 5. Upgrade wOETHb proxy
70+
contract: cwOETHbProxy,
71+
signature: "upgradeTo(address)",
72+
args: [dwOETHb.address],
73+
},
74+
// 6. Run the second initializer
75+
{
76+
contract: cwOETHb,
77+
signature: "initialize2()",
78+
args: [],
79+
},
80+
],
81+
};
82+
}
83+
);

contracts/deploy/mainnet/132_upgrade_wousd.js

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)