|
| 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("-----") |
0 commit comments