-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into shah/l2-governance
- Loading branch information
Showing
37 changed files
with
2,765 additions
and
934 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,141 @@ | ||
# ------------------------------- | ||
# Mar 13, 2024 - OUSD Allocation | ||
# ------------------------------- | ||
from world import * | ||
|
||
def main(): | ||
with TemporaryForkForReallocations() as txs: | ||
# Before | ||
txs.append(vault_core.rebase({'from':STRATEGIST})) | ||
txs.append(vault_value_checker.takeSnapshot({'from':STRATEGIST})) | ||
|
||
# Withdraw all USDC and USDT from Flux | ||
txs.append( | ||
vault_admin.withdrawFromStrategy( | ||
FLUX_STRAT, | ||
[usdt, usdc], | ||
[flux_strat.checkBalance(usdt), flux_strat.checkBalance(usdc)], | ||
{'from': STRATEGIST} | ||
) | ||
) | ||
|
||
# Put everything in Morpho Aave (default strategy for USDC and USDT) | ||
txs.append(vault_core.allocate({'from': STRATEGIST})) | ||
|
||
# After | ||
vault_change = vault_core.totalValue() - vault_value_checker.snapshots(STRATEGIST)[0] | ||
supply_change = ousd.totalSupply() - vault_value_checker.snapshots(STRATEGIST)[1] | ||
profit = vault_change - supply_change | ||
|
||
txs.append(vault_value_checker.checkDelta(profit, (500 * 10**18), vault_change, (500 * 10**18), {'from': STRATEGIST})) | ||
print("-----") | ||
print("Profit", "{:.6f}".format(profit / 10**18), profit) | ||
print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change) | ||
|
||
# --------------------------------- | ||
# Mar 14, 2024 - Move out from Flux | ||
# --------------------------------- | ||
from world import * | ||
|
||
def main(): | ||
with TemporaryForkForReallocations() as txs: | ||
# Before | ||
txs.append(vault_core.rebase({'from':STRATEGIST})) | ||
txs.append(vault_value_checker.takeSnapshot({'from':STRATEGIST})) | ||
|
||
# Withdraw all from Flux (including dust) | ||
txs.append( | ||
vault_admin.withdrawAllFromStrategy( | ||
FLUX_STRAT, | ||
{'from': STRATEGIST} | ||
) | ||
) | ||
|
||
# Put everything in Morpho Aave (default strategy for USDC and USDT) | ||
txs.append(vault_core.allocate({'from': STRATEGIST})) | ||
|
||
# After | ||
vault_change = vault_core.totalValue() - vault_value_checker.snapshots(STRATEGIST)[0] | ||
supply_change = ousd.totalSupply() - vault_value_checker.snapshots(STRATEGIST)[1] | ||
profit = vault_change - supply_change | ||
|
||
txs.append(vault_value_checker.checkDelta(profit, (500 * 10**18), vault_change, (500 * 10**18), {'from': STRATEGIST})) | ||
print("-----") | ||
print("Profit", "{:.6f}".format(profit / 10**18), profit) | ||
print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change) | ||
|
||
# ------------------------------------- | ||
# Mar 15, 2024 - OETH Buyback | ||
# ------------------------------------- | ||
from buyback import * | ||
|
||
def main(): | ||
txs = [] | ||
|
||
with TemporaryFork(): | ||
txs.append( | ||
build_buyback_tx( | ||
OETH, | ||
oeth.balanceOf(OETH_BUYBACK), | ||
max_ogv_slippage=3, | ||
max_cvx_slippage=10 | ||
) | ||
) | ||
|
||
txs.append( | ||
cvx_locker.processExpiredLocks(True, std) | ||
) | ||
|
||
print(to_gnosis_json(txs)) | ||
|
||
# ------------------------------------- | ||
# Mar 15, 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)) | ||
|
||
# Deposit 467 rETH and 230 WERH to the Balancer strategy | ||
txs.append( | ||
vault_oeth_admin.depositToStrategy( | ||
BALANCER_RETH_STRATEGY, | ||
[reth, WETH], | ||
[467.04342 * 10**18, 230.56953 * 10**18], | ||
std | ||
) | ||
) | ||
|
||
# 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("-----") | ||
|
||
# ------------------------------------- | ||
# Mar 18, 2024 - OUSD Buyback | ||
# ------------------------------------- | ||
from buyback import * | ||
|
||
def main(): | ||
txs = [] | ||
|
||
with TemporaryFork(): | ||
txs.append( | ||
build_buyback_tx( | ||
OUSD, | ||
ousd.balanceOf(OUSD_BUYBACK), | ||
max_ogv_slippage=3, | ||
max_cvx_slippage=6 | ||
) | ||
) | ||
|
||
print(to_gnosis_json(txs)) |
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
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
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
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
Oops, something went wrong.