Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
251 changes: 249 additions & 2 deletions brownie/runlogs/2023_03_strategist.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# --------------------------------
# Feb 28, 2023 - Weekly allocation
# Mar 10, 2023 - Weekly allocation
#

from addresses import *
Expand Down Expand Up @@ -56,4 +56,251 @@
# safe = ApeSafe('0xF14BBdf064E3F67f51cd9BD646aE3716aD938FDC')
# safe_tx = safe.multisend_from_receipts(txs)
# safe.sign_with_frame(safe_tx)
# r = safe.post_transaction(safe_tx)
# r = safe.post_transaction(safe_tx)



# --------------------------------
# March 10, 2023 - USDC Depeg
#

from addresses import *
from world import *
from allocations import *
from ape_safe import ApeSafe

votes = """
Morpho Aave USDT 39.04%
Convex OUSD+3Crv 32.18%
Morpho Aave DAI 9.23%
Morpho Aave USDC 9.23%
Convex DAI+USDC+USDT 4.96%
Aave USDT 1.02%
Compound USDC 1.02%
Morpho Compound DAI 1.02%
Morpho Compound USDC 1.02%
Morpho Compound USDT 1.02%
Convex LUSD+3Crv 0.3%
Existing Allocation 0%
Aave DAI 0%
Aave USDC 0%
Compound DAI 0%
Compound USDT 0%
"""

with TemporaryForkWithVaultStats(votes):
before_votes = with_target_allocations(load_from_blockchain(), votes)

txs = []
txs.extend(auto_take_snapshot())

# From
txs.append(vault_admin.withdrawAllFromStrategy(LUSD_3POOL_STRAT, {'from': STRATEGIST}))
txs.append(vault_admin.withdrawAllFromStrategy(CONVEX_STRAT, {'from': STRATEGIST}))

txs.extend(auto_check_snapshot())

print("Est Gas Max: {:,}".format(1.10*sum([x.gas_used for x in txs])))


safe = ApeSafe('0xF14BBdf064E3F67f51cd9BD646aE3716aD938FDC')
safe_tx = safe.multisend_from_receipts(txs)
safe.sign_with_frame(safe_tx)
r = safe.post_transaction(safe_tx)



# --------------------------------
# March 10, 2023 - USDC Depeg
#

from addresses import *
from world import *
from allocations import *
from ape_safe import ApeSafe

votes = """
Morpho Aave USDT 39.04%
Convex OUSD+3Crv 32.18%
Morpho Aave DAI 9.23%
Morpho Aave USDC 9.23%
Convex DAI+USDC+USDT 4.96%
Aave USDT 1.02%
Compound USDC 1.02%
Morpho Compound DAI 1.02%
Morpho Compound USDC 1.02%
Morpho Compound USDT 1.02%
Convex LUSD+3Crv 0.3%
Existing Allocation 0%
Aave DAI 0%
Aave USDC 0%
Compound DAI 0%
Compound USDT 0%
"""

with TemporaryForkWithVaultStats(votes):
before_votes = with_target_allocations(load_from_blockchain(), votes)

txs = []
txs.extend(auto_take_snapshot())

# From
txs.append(vault_admin.withdrawAllFromStrategy(OUSD_METASTRAT, {'from': STRATEGIST}))

txs.extend(auto_check_snapshot())

print("Est Gas Max: {:,}".format(1.10*sum([x.gas_used for x in txs])))


safe = ApeSafe('0xF14BBdf064E3F67f51cd9BD646aE3716aD938FDC')
safe_tx = safe.multisend_from_receipts(txs)
safe.sign_with_frame(safe_tx)
r = safe.post_transaction(safe_tx)



# --------------------------------
# March 10, 2023 - USDC Depeg
#

from addresses import *
from world import *
from allocations import *
from ape_safe import ApeSafe

votes = """
Morpho Aave USDT 39.04%
Convex OUSD+3Crv 32.18%
Morpho Aave DAI 9.23%
Morpho Aave USDC 9.23%
Convex DAI+USDC+USDT 4.96%
Aave USDT 1.02%
Compound USDC 1.02%
Morpho Compound DAI 1.02%
Morpho Compound USDC 1.02%
Morpho Compound USDT 1.02%
Convex LUSD+3Crv 0.3%
Existing Allocation 0%
Aave DAI 0%
Aave USDC 0%
Compound DAI 0%
Compound USDT 0%
"""

with TemporaryForkWithVaultStats(votes):
before_votes = with_target_allocations(load_from_blockchain(), votes)

txs = []
txs.extend(auto_take_snapshot())

# From
# txs.append(vault_admin.withdrawAllFromStrategy(LUSD_3POOL_STRAT, {'from': STRATEGIST}))
txs.append(vault_admin.withdrawAllFromStrategy(CONVEX_STRAT, {'from': STRATEGIST}))

txs.extend(auto_check_snapshot())

print("Est Gas Max: {:,}".format(1.10*sum([x.gas_used for x in txs])))


safe = ApeSafe('0xF14BBdf064E3F67f51cd9BD646aE3716aD938FDC')
safe_tx = safe.multisend_from_receipts(txs)
safe.sign_with_frame(safe_tx)
r = safe.post_transaction(safe_tx)



# --------------------------------
# March 10, 2023 - More Depeg
#

from addresses import *
from world import *
from allocations import *
from ape_safe import ApeSafe

votes = """
Morpho Aave USDT 39.04%
Convex OUSD+3Crv 32.18%
Morpho Aave DAI 9.23%
Morpho Aave USDC 9.23%
Convex DAI+USDC+USDT 4.96%
Aave USDT 1.02%
Compound USDC 1.02%
Morpho Compound DAI 1.02%
Morpho Compound USDC 1.02%
Morpho Compound USDT 1.02%
Convex LUSD+3Crv 0.3%
Existing Allocation 0%
Aave DAI 0%
Aave USDC 0%
Compound DAI 0%
Compound USDT 0%
"""

with TemporaryForkWithVaultStats(votes):
before_votes = with_target_allocations(load_from_blockchain(), votes)

txs = []
# txs.extend(auto_take_snapshot())

# From
txs.append(from_strat(MORPHO_COMP_STRAT, [[483_083, dai], [526_766, usdc], [3_155_766, usdt]]))
txs.append(from_strat(MORPHO_AAVE_STRAT, [ [3_155_766, usdt]]))

# txs.extend(auto_check_snapshot())

print("Est Gas Max: {:,}".format(1.10*sum([x.gas_used for x in txs])))


safe = ApeSafe('0xF14BBdf064E3F67f51cd9BD646aE3716aD938FDC')
safe_tx = safe.multisend_from_receipts(txs)
safe.sign_with_frame(safe_tx)
r = safe.post_transaction(safe_tx)


# --------------------------------
# March 11, 2023 - Depeg IN
#

from addresses import *
from world import *
from allocations import *
from ape_safe import ApeSafe

votes = """
Morpho Aave USDT 39.04%
Convex OUSD+3Crv 32.18%
Morpho Aave DAI 9.23%
Morpho Aave USDC 9.23%
Convex DAI+USDC+USDT 4.96%
Aave USDT 1.02%
Compound USDC 1.02%
Morpho Compound DAI 1.02%
Morpho Compound USDC 1.02%
Morpho Compound USDT 1.02%
Convex LUSD+3Crv 0.3%
Existing Allocation 0%
Aave DAI 0%
Aave USDC 0%
Compound DAI 0%
Compound USDT 0%
"""

with TemporaryForkWithVaultStats(votes):
before_votes = with_target_allocations(load_from_blockchain(), votes)

txs = []
txs.extend(auto_take_snapshot())

# From
txs.append(to_strat(OUSD_METASTRAT, [[1_000_000, usdc]]))

txs.extend(auto_check_snapshot())

print("Est Gas Max: {:,}".format(1.10*sum([x.gas_used for x in txs])))


safe = ApeSafe('0xF14BBdf064E3F67f51cd9BD646aE3716aD938FDC')
safe_tx = safe.multisend_from_receipts(txs)
safe.sign_with_frame(safe_tx)
r = safe.post_transaction(safe_tx)