-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
927fe2d
commit a1c31f8
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# ----------------------------------------------------- | ||
# Oct 3rd 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 = 1e18 | ||
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) |