Skip to content

Commit de8d11d

Browse files
authored
Runlogs for AMO operations (#2620)
1 parent 290eee1 commit de8d11d

1 file changed

Lines changed: 117 additions & 0 deletions

File tree

brownie/runlogs/2025_08_strategist.py

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,120 @@ def main():
101101
print("SuperOETH supply change", "{:.6f}".format(supply_change / 10**18), supply_change)
102102
print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change)
103103
print("-----")
104+
105+
# -------------------------------------
106+
# July 28, 2025 - Withdraw 60 WETH from new Curve AMO
107+
# -------------------------------------
108+
from world import *
109+
110+
def main():
111+
with TemporaryForkForReallocations() as txs:
112+
# Before
113+
txs.append(vault_oeth_core.rebase(std))
114+
txs.append(oeth_vault_value_checker.takeSnapshot(std))
115+
116+
# AMO pool before
117+
wethPoolBalance = weth.balanceOf(OETH_CURVE_POOL)
118+
oethPoolBalance = oeth.balanceOf(OETH_CURVE_POOL)
119+
totalPool = wethPoolBalance + oethPoolBalance
120+
weth_out_before = oeth_curve_pool.get_dy(0, 1, 10**18)
121+
122+
print("Curve OETH/WETH Pool before")
123+
print("Pool WETH ", "{:.6f}".format(wethPoolBalance / 10**18), wethPoolBalance * 100 / totalPool)
124+
print("Pool OETH ", "{:.6f}".format(oethPoolBalance / 10**18), oethPoolBalance * 100 / totalPool)
125+
print("Pool Total ", "{:.6f}".format(totalPool / 10**18), totalPool)
126+
127+
amount_to_withdraw = 60 * 10**18 # 60 WETH
128+
129+
txs.append(
130+
vault_oeth_admin.withdrawFromStrategy(
131+
OETH_CURVE_AMO_STRAT,
132+
[WETH],
133+
[amount_to_withdraw],
134+
{'from': STRATEGIST}
135+
)
136+
)
137+
138+
# After
139+
vault_change = vault_oeth_core.totalValue() - oeth_vault_value_checker.snapshots(STRATEGIST)[0]
140+
supply_change = oeth.totalSupply() - oeth_vault_value_checker.snapshots(STRATEGIST)[1]
141+
profit = vault_change - supply_change
142+
143+
txs.append(oeth_vault_value_checker.checkDelta(profit, (1 * 10**18), vault_change, (1 * 10**18), std))
144+
145+
print("-----")
146+
print("Profit", "{:.6f}".format(profit / 10**18), profit)
147+
print("OETH supply change", "{:.6f}".format(supply_change / 10**18), supply_change)
148+
print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change)
149+
print("-----")
150+
151+
# AMO pool after
152+
wethPoolBalance = weth.balanceOf(OETH_CURVE_POOL)
153+
oethPoolBalance = oeth.balanceOf(OETH_CURVE_POOL)
154+
totalPool = wethPoolBalance + oethPoolBalance
155+
weth_out_after = oeth_curve_pool.get_dy(0, 1, 10**18)
156+
157+
print("Curve OETH/WETH Pool after")
158+
print("Pool WETH ", "{:.6f}".format(wethPoolBalance / 10**18), wethPoolBalance * 100 / totalPool)
159+
print("Pool OETH ", "{:.6f}".format(oethPoolBalance / 10**18), oethPoolBalance * 100 / totalPool)
160+
print("Pool Total ", "{:.6f}".format(totalPool / 10**18), totalPool)
161+
print("Sell 10 OETH Curve prices before and after", "{:.6f}".format(weth_out_before / 10**18), "{:.6f}".format(weth_out_after / 10**18))
162+
163+
# -------------------------------------
164+
# August 12, 2024 - Deposit 210 WETH to BASE Curve AMO
165+
# -------------------------------------
166+
from aerodrome_harvest import *
167+
from brownie import accounts
168+
import eth_abi
169+
def main():
170+
with TemporaryForkForReallocations() as txs:
171+
# Rebase
172+
txs.append(vault_core.rebase({ 'from': OETHB_MULTICHAIN_STRATEGIST }))
173+
174+
# Take Vault snapshot
175+
txs.append(vault_value_checker.takeSnapshot({ 'from': OETHB_MULTICHAIN_STRATEGIST }))
176+
177+
# AMO pool before
178+
wethPoolBalance = weth.balanceOf(CURVE_POOL_BASE)
179+
oethPoolBalance = oethb.balanceOf(CURVE_POOL_BASE)
180+
totalPool = wethPoolBalance + oethPoolBalance
181+
price_before = curve_pool.get_dy(1, 0, 10 * 10**18)
182+
183+
print("Curve SuperOETH/WETH Pool before")
184+
print("Pool WETH ", "{:.6f}".format(wethPoolBalance / 10**18), wethPoolBalance * 100 / totalPool)
185+
print("Pool SuperOETH ", "{:.6f}".format(oethPoolBalance / 10**18), oethPoolBalance * 100 / totalPool)
186+
print("Pool Total ", "{:.6f}".format(totalPool / 10**18))
187+
print("-----")
188+
189+
# Deposit WETH to Curve AMO strategy
190+
txs.append(
191+
vault_admin.depositToStrategy(
192+
OETHB_CURVE_AMO_STRATEGY,
193+
[weth],
194+
[210 * 10**18],
195+
{'from': OETHB_MULTICHAIN_STRATEGIST}
196+
)
197+
)
198+
199+
# AMO pool after
200+
wethPoolBalance = weth.balanceOf(CURVE_POOL_BASE)
201+
oethPoolBalance = oethb.balanceOf(CURVE_POOL_BASE)
202+
totalPool = wethPoolBalance + oethPoolBalance
203+
price_after = curve_pool.get_dy(1, 0, 10 * 10**18)
204+
205+
print("Curve SuperOETH/WETH Pool after")
206+
print("Pool WETH ", "{:.6f}".format(wethPoolBalance / 10**18), wethPoolBalance * 100 / totalPool)
207+
print("Pool SuperOETH ", "{:.6f}".format(oethPoolBalance / 10**18), oethPoolBalance * 100 / totalPool)
208+
print("Pool Total ", "{:.6f}".format(totalPool / 10**18))
209+
print("SuperOETH/WETH Curve prices before and after", "{:.6f}".format(price_before / 10**19), "{:.6f}".format(price_after / 10**19))
210+
211+
# After
212+
vault_change = vault_core.totalValue() - vault_value_checker.snapshots(OETHB_MULTICHAIN_STRATEGIST)[0]
213+
supply_change = oethb.totalSupply() - vault_value_checker.snapshots(OETHB_MULTICHAIN_STRATEGIST)[1]
214+
profit = vault_change - supply_change
215+
txs.append(vault_value_checker.checkDelta(profit, (1 * 10**18), vault_change, (10 * 10**18), {'from': OETHB_MULTICHAIN_STRATEGIST}))
216+
print("-----")
217+
print("Profit", "{:.6f}".format(profit / 10**18), profit)
218+
print("SuperOETH supply change", "{:.6f}".format(supply_change / 10**18), supply_change)
219+
print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change)
220+
print("-----")

0 commit comments

Comments
 (0)