From 553e168ddf140af71bde123f9986a347828fd91a Mon Sep 17 00:00:00 2001 From: Nick Addison Date: Mon, 6 May 2024 11:33:31 +1000 Subject: [PATCH] Burn around 10k OETH from the Curve pool (#2048) --- brownie/runlogs/2024_05_strategist.py | 43 +++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 brownie/runlogs/2024_05_strategist.py diff --git a/brownie/runlogs/2024_05_strategist.py b/brownie/runlogs/2024_05_strategist.py new file mode 100644 index 0000000000..4910ae9037 --- /dev/null +++ b/brownie/runlogs/2024_05_strategist.py @@ -0,0 +1,43 @@ + +# ------------------------------------- +# May 6, 2024 - OETH Reallocation +# ------------------------------------- +from world import * + +def main(): + with TemporaryForkForReallocations() as txs: + # Before + txs.append(vault_oeth_core.rebase(std)) + txs.append(oeth_vault_value_checker.takeSnapshot(std)) + + + eth_out_before = oeth_metapool.get_dy(1, 0, 100 * 10**18) + balances_before = oeth_metapool.get_balances() + + # remove the 10k OETH to increase the price of OETH in the OETH/ETH Curve pool + metapool_virtual_price = 1001445329258618599 + lp_amount = 10_050 * 10**18 * 10**18 / metapool_virtual_price + txs.append( + oeth_meta_strat.removeAndBurnOTokens( + lp_amount, + std + ) + ) + + eth_out_after = oeth_metapool.get_dy(1, 0, 100 * 10**18) + balances_after = oeth_metapool.get_balances() + + # 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**18), vault_change, (1 * 10**18), std)) + print("-----") + print("Profit", "{:.6f}".format(profit / 10**18), profit) + print("OETH supply change", "{:.6f}".format(supply_change / 10**18), supply_change) + print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change) + print("-----") + print("Burn LP amount", "{:.6f}".format(lp_amount / 10**18), lp_amount) + print("Sell 100 OETH Curve prices before and after", "{:.6f}".format(eth_out_before / 10**18), "{:.6f}".format(eth_out_after / 10**18)) + print("Curve ETH and OETH balances before", "{:.6f}".format(balances_before[0] / 10**18), "{:.6f}".format(balances_before[1] / 10**18)) + print("Curve ETH and OETH balances after", "{:.6f}".format(balances_after[0] / 10**18), "{:.6f}".format(balances_after[1] / 10**18))