Skip to content

Commit

Permalink
add runlog (#2258)
Browse files Browse the repository at this point in the history
  • Loading branch information
sparrowDom authored Sep 25, 2024
1 parent 8cdad56 commit 4cb3229
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions brownie/runlogs/2024_09_strategist.py
Original file line number Diff line number Diff line change
Expand Up @@ -1172,3 +1172,58 @@ def main():
from_strategist
)
)

# -----------------------------------------------------
# Sept 18 2024 - OETHb allocation & rebalance 22:50 CET
# -----------------------------------------------------

from world_base import *

def main():
with TemporaryForkForOETHbReallocations() as txs:
# Before
txs.append(vault_core.rebase({ 'from': OETHB_STRATEGIST }))
txs.append(vault_value_checker.takeSnapshot({ 'from': OETHB_STRATEGIST }))

# Deposit all WETH
wethDepositAmount = weth.balanceOf(OETHB_VAULT_PROXY_ADDRESS)
txs.append(
vault_admin.depositToStrategy(
OETHB_AERODROME_AMO_STRATEGY,
[weth],
[wethDepositAmount],
{'from': OETHB_STRATEGIST}
)
)

amo_snapsnot()
swapWeth = True
swapAmount = 0
minAmount = swapAmount * 0.98
print("--------------------")
print("WETH Deposit ", c18(wethDepositAmount))
print("-----")
print("Swap amount ", c18(swapAmount))
print("Min amount ", c18(minAmount))
print("-----")

txs.append(
amo_strat.rebalance(
swapAmount,
swapWeth,
minAmount,
{'from': OETHB_STRATEGIST}
)
)

# After
vault_change = vault_core.totalValue() - vault_value_checker.snapshots(OETHB_STRATEGIST)[0]
supply_change = oethb.totalSupply() - vault_value_checker.snapshots(OETHB_STRATEGIST)[1]
profit = vault_change - supply_change

txs.append(vault_value_checker.checkDelta(profit, (1 * 10**18), vault_change, (1 * 10**18), {'from': OETHB_STRATEGIST}))

amo_snapsnot()
print("--------------------")
print("Profit ", c18(profit), profit)
print("Vault Change ", c18(vault_change), vault_change)

0 comments on commit 4cb3229

Please sign in to comment.