Skip to content

Commit

Permalink
add runlog
Browse files Browse the repository at this point in the history
  • Loading branch information
sparrowDom committed Oct 9, 2024
1 parent 2674950 commit 3a23072
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions brownie/runlogs/2024_10_strategist.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,58 @@ def main():
print("-----")
print("Profit", "{:.6f}".format(profit / 10**18), profit)
print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change)

# -----------------------------------------------------
# Oct 9th 2024 - OETHb allocation & rebalance
# -----------------------------------------------------

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 3a23072

Please sign in to comment.