Skip to content

Commit 9209009

Browse files
authored
Runlog 10 July 2026 - Withdraw all from Hydrex AMO on Base (#2935)
* Withdraw all from Hydrex AMO on Base * Added withdraw from Base Curve AMO to run log
1 parent b8618fe commit 9209009

3 files changed

Lines changed: 111 additions & 1 deletion

File tree

brownie/addresses.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
OETHB = '0xDBFeFD2e8460a6Ee4955A68582F85708BAEA60A3'
7878
OETHB_VAULT_VALUE_CHECKER = '0x9D98Cf85B65Fa1ACef5e9AAA2300753aDF7bcf6A'
7979
OETHB_AERODROME_AMO_STRATEGY = '0xF611cC500eEE7E4e4763A05FE623E2363c86d2Af'
80+
OETHB_HYDREX_AMO_STRATEGY = '0x926846b8fa246B30652B103C369fce5db8B2F593'
8081
OETHB_WOETH_STRATEGY = '0x80c864704DD06C3693ed5179190786EE38ACf835'
8182
OETHB_CURVE_AMO_STRATEGY = '0x9cfcAF81600155e01c63e4D2993A8A81A8205829'
8283
OETHB_STRATEGIST = '0x4FF1b9D9ba8558F5EAfCec096318eA0d8b541971'
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# -------------------------------------------------------------
2+
# Jul 10, 2026 - Withdraw all liquidity from Hydrex AMO into the Super OETH Vault
3+
# -------------------------------------------------------------
4+
5+
from world_base import *
6+
7+
8+
def main():
9+
with TemporaryForkForOETHbReallocations() as txs:
10+
# Before
11+
txs.append(vault_core.rebase(from_strategist))
12+
txs.append(vault_value_checker.takeSnapshot(from_strategist))
13+
14+
vault_weth_before = weth.balanceOf(OETHB_VAULT_PROXY_ADDRESS)
15+
hydrex_weth_before = hydrex_amo_strat.checkBalance(WETH_BASE)
16+
17+
print("-----")
18+
print("Hydrex WETH before", c18(hydrex_weth_before), hydrex_weth_before)
19+
print("Vault WETH before ", c18(vault_weth_before), vault_weth_before)
20+
print("-----")
21+
22+
# Withdraw all WETH liquidity from the Hydrex AMO strategy into the vault.
23+
txs.append(
24+
vault_admin.withdrawAllFromStrategy(
25+
OETHB_HYDREX_AMO_STRATEGY,
26+
from_strategist
27+
)
28+
)
29+
30+
vault_weth_after = weth.balanceOf(OETHB_VAULT_PROXY_ADDRESS)
31+
hydrex_weth_after = hydrex_amo_strat.checkBalance(WETH_BASE)
32+
withdrawn_weth = vault_weth_after - vault_weth_before
33+
34+
assert hydrex_weth_after == 0, "Hydrex AMO still has WETH balance"
35+
assert withdrawn_weth > 0, "No WETH was withdrawn into the vault"
36+
37+
# After
38+
vault_change = vault_core.totalValue() - vault_value_checker.snapshots(OETHB_MULTICHAIN_STRATEGIST)[0]
39+
supply_change = oethb.totalSupply() - vault_value_checker.snapshots(OETHB_MULTICHAIN_STRATEGIST)[1]
40+
profit = vault_change - supply_change
41+
txs.append(vault_value_checker.checkDelta(profit, (1 * 10**18), vault_change, (10 * 10**18), from_strategist))
42+
43+
print("-----")
44+
print("Hydrex WETH after ", c18(hydrex_weth_after), hydrex_weth_after)
45+
print("Vault WETH after ", c18(vault_weth_after), vault_weth_after)
46+
print("Withdrawn WETH ", c18(withdrawn_weth), withdrawn_weth)
47+
print("Profit ", c18(profit), profit)
48+
print("OETHb supply change", c18(supply_change), supply_change)
49+
print("Vault Change ", c18(vault_change), vault_change)
50+
print("-----")
51+
52+
53+
# -------------------------------------------------------------
54+
# Jul 10, 2026 - Withdraw 15 WETH from Base Curve AMO into the Super OETH Vault
55+
# -------------------------------------------------------------
56+
57+
from world_base import *
58+
59+
60+
def main():
61+
with TemporaryForkForOETHbReallocations() as txs:
62+
amount = 15 * 10**18
63+
64+
# Before
65+
txs.append(vault_core.rebase(from_strategist))
66+
txs.append(vault_value_checker.takeSnapshot(from_strategist))
67+
68+
vault_weth_before = weth.balanceOf(OETHB_VAULT_PROXY_ADDRESS)
69+
curve_amo_weth_before = base_curve_amo_strat.checkBalance(WETH_BASE)
70+
71+
print("-----")
72+
print("Curve AMO WETH before", c18(curve_amo_weth_before), curve_amo_weth_before)
73+
print("Vault WETH before ", c18(vault_weth_before), vault_weth_before)
74+
print("Withdraw amount ", c18(amount), amount)
75+
print("-----")
76+
77+
assert curve_amo_weth_before >= amount, "Curve AMO has less than 15 WETH"
78+
79+
# Withdraw 15 WETH from the Base Curve AMO strategy into the vault.
80+
txs.append(
81+
vault_admin.withdrawFromStrategy(
82+
OETHB_CURVE_AMO_STRATEGY,
83+
[WETH_BASE],
84+
[amount],
85+
from_strategist
86+
)
87+
)
88+
89+
vault_weth_after = weth.balanceOf(OETHB_VAULT_PROXY_ADDRESS)
90+
curve_amo_weth_after = base_curve_amo_strat.checkBalance(WETH_BASE)
91+
withdrawn_weth = vault_weth_after - vault_weth_before
92+
93+
assert withdrawn_weth >= amount, "15 WETH was not withdrawn into the vault"
94+
95+
# After
96+
vault_change = vault_core.totalValue() - vault_value_checker.snapshots(OETHB_MULTICHAIN_STRATEGIST)[0]
97+
supply_change = oethb.totalSupply() - vault_value_checker.snapshots(OETHB_MULTICHAIN_STRATEGIST)[1]
98+
profit = vault_change - supply_change
99+
txs.append(vault_value_checker.checkDelta(profit, (1 * 10**18), vault_change, (10 * 10**18), from_strategist))
100+
101+
print("-----")
102+
print("Curve AMO WETH after ", c18(curve_amo_weth_after), curve_amo_weth_after)
103+
print("Vault WETH after ", c18(vault_weth_after), vault_weth_after)
104+
print("Withdrawn WETH ", c18(withdrawn_weth), withdrawn_weth)
105+
print("Profit ", c18(profit), profit)
106+
print("OETHb supply change ", c18(supply_change), supply_change)
107+
print("Vault Change ", c18(vault_change), vault_change)
108+
print("-----")

brownie/world_base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
oethb_weth_bribe = load_contract('aero_bribes', OETHB_WETH_BRIBE_CONTRACT)
3232

3333
amo_strat = load_contract('aerodrome_amo_strategy', OETHB_AERODROME_AMO_STRATEGY)
34+
hydrex_amo_strat = load_contract('aerodrome_amo_strategy', OETHB_HYDREX_AMO_STRATEGY)
3435
vault_admin = load_contract('vault_admin', OETHB_VAULT_PROXY_ADDRESS)
3536
vault_core = load_contract('vault_core', OETHB_VAULT_PROXY_ADDRESS)
3637
vault_value_checker = load_contract('vault_value_checker', OETHB_VAULT_VALUE_CHECKER)
@@ -122,4 +123,4 @@ def amo_snapshot():
122123
# print(" ", leading_whitespace("Amount"), leading_whitespace("Percentage"))
123124
# print("WETH ", c18(wethPoolBalance), pcts(wethPoolBalance * 100 / total))
124125
# print("superOETH ", c18(superOETHbPoolBalance), pcts(superOETHbPoolBalance * 100 / total))
125-
# print("Total ", c18(poolTotal), pcts(100))
126+
# print("Total ", c18(poolTotal), pcts(100))

0 commit comments

Comments
 (0)