From 1d8435f0f246d2a3c1d434e6d7973d26d43aed5e Mon Sep 17 00:00:00 2001 From: Domen Grabec Date: Sat, 5 Oct 2024 00:59:21 +0200 Subject: [PATCH 1/2] add runlog (#2270) --- brownie/runlogs/2024_10_strategist.py | 47 ++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/brownie/runlogs/2024_10_strategist.py b/brownie/runlogs/2024_10_strategist.py index 826ca803cb..315c7fb089 100644 --- a/brownie/runlogs/2024_10_strategist.py +++ b/brownie/runlogs/2024_10_strategist.py @@ -122,4 +122,49 @@ def main(): aero.approve(OETHB_HARVESTER, 0, from_strategist) ) - print(to_gnosis_json(txs, OETHB_STRATEGIST, "8453")) \ No newline at end of file + print(to_gnosis_json(txs, OETHB_STRATEGIST, "8453")) + +# ---------------------------------------------------------- +# Oct 5, 2024 - Swap AERO to superOETHb & payback treasury +# ---------------------------------------------------------- +from aerodrome_harvest import * +from eth_abi.packed import encode_packed +import eth_abi + +def main(): + txs = [] + + oethbSwapAmount = 42000 * 10**18 + treasury_address = "0x3c112E20141B65041C252a68a611EF145f58B7bc" + + # Approve the swap router to move it + txs.append( + aero.approve(AERODROME_SWAP_ROUTER_BASE, oethbSwapAmount, from_strategist) + ) + + oethb_path = encode_packed( + ['address', 'int24', 'address', 'int24', 'address'], + [ + AERO_BASE, + 200, # AERO > WETH tickSpacing + WETH_BASE, + 1, # WETH > OETHb tickSpacing + OETHB + ] + ).hex() + + # Do the AERO > OETHb swap + txs.append( + aero_router.exactInput( + swap_params_multiple( + oethbSwapAmount, + oethb_path, + recipient=treasury_address, + to_token=AERO_BASE, + to_token_label="superOETHb" + ), + from_strategist + ) + ) + + print(to_gnosis_json(txs, OETHB_STRATEGIST, "8453")) \ No newline at end of file From 2674950ace606a64a054bb51b713a87f191d7267 Mon Sep 17 00:00:00 2001 From: Nick Addison Date: Tue, 8 Oct 2024 15:57:56 +1100 Subject: [PATCH 2/2] Run log Remove default strategy for WETH and deposit to AMO (#2271) --- brownie/runlogs/2024_10_strategist.py | 43 ++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/brownie/runlogs/2024_10_strategist.py b/brownie/runlogs/2024_10_strategist.py index 315c7fb089..55d82feef7 100644 --- a/brownie/runlogs/2024_10_strategist.py +++ b/brownie/runlogs/2024_10_strategist.py @@ -167,4 +167,45 @@ def main(): ) ) - print(to_gnosis_json(txs, OETHB_STRATEGIST, "8453")) \ No newline at end of file + print(to_gnosis_json(txs, OETHB_STRATEGIST, "8453")) + + +# ------------------------------- +# Oct 8, 2024 - Remove default strategy for WETH and deposit to AMO +# ------------------------------- +from world import * + +def main(): + with TemporaryForkForReallocations() as txs: + # Before + txs.append(oeth_dripper.collectAndRebase(std)) + txs.append(oeth_vault_value_checker.takeSnapshot(std)) + + # Remove the second Native Staking Strategy as the default strategy from WETH + txs.append( + vault_oeth_admin.setAssetDefaultStrategy( + WETH, + "0x0000000000000000000000000000000000000000", + std + ) + ) + + # Deposit WETH to the AMO + txs.append( + vault_oeth_admin.depositToStrategy( + OETH_CONVEX_OETH_ETH_STRAT, + [WETH], + [900 * 10**18], + std + ) + ) + + # After + vault_change = vault_oeth_core.totalValue() - oeth_vault_value_checker.snapshots(STRATEGIST)[0] + supply_change = oeth.totalSupply() - oeth_vault_value_checker.snapshots(STRATEGIST)[1] + profit = vault_change - supply_change + + txs.append(oeth_vault_value_checker.checkDelta(profit, (1 * 10**17), vault_change, (1 * 10**17), std)) + print("-----") + print("Profit", "{:.6f}".format(profit / 10**18), profit) + print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change)