Skip to content

Commit

Permalink
add strategist runlog (#1855)
Browse files Browse the repository at this point in the history
  • Loading branch information
sparrowDom authored Oct 5, 2023
1 parent 829a127 commit 7606df1
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions brownie/runlogs/2023_10_strategist.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,63 @@ def main():
print("Profit", "{:.6f}".format(profit / 10**18), profit)
print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change)
print("-----")

# -------------------------------------
# Oct 03, 2023 - OETH Balancer rETH allocation
# -------------------------------------
from world import *

with TemporaryForkForReallocations() as txs:
# Before
txs.append(vault_oeth_core.rebase({'from': STRATEGIST}))
txs.append(oeth_vault_value_checker.takeSnapshot({'from': STRATEGIST}))

# Deposit 32 rETH to BalancerRethStrategy
txs.append(
vault_oeth_admin.depositToStrategy(
BALANCER_RETH_STRATEGY,
[reth],
[32 * 10**18],
{'from': STRATEGIST}
)
)

# 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, (0.1 * 10**18), vault_change, (0.1 * 10**18), {'from': STRATEGIST}))
print("-----")
print("Profit", "{:.6f}".format(profit / 10**18), profit)
print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change)
print("-----")

# -------------------------------------
# Oct 05, 2023 - OETH Balancer rETH allocation
# -------------------------------------
from world import *

with TemporaryForkForReallocations() as txs:
# Before
txs.append(vault_oeth_core.rebase({'from': STRATEGIST}))
txs.append(oeth_vault_value_checker.takeSnapshot({'from': STRATEGIST}))

# Deposit 32 rETH to BalancerRethStrategy
txs.append(
vault_oeth_admin.depositToStrategy(
BALANCER_RETH_STRATEGY,
[reth, weth],
[32 * 10**18, 36.57 * 10**18],
{'from': STRATEGIST}
)
)

# 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, (0.1 * 10**18), vault_change, (0.1 * 10**18), {'from': STRATEGIST}))
print("-----")
print("Profit", "{:.6f}".format(profit / 10**18), profit)
print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change)
print("-----")

0 comments on commit 7606df1

Please sign in to comment.