Skip to content

Commit 29bd169

Browse files
authored
USDC depeg runlogs (#1261)
1 parent dd54560 commit 29bd169

File tree

1 file changed

+249
-2
lines changed

1 file changed

+249
-2
lines changed

brownie/runlogs/2023_03_strategist.py

Lines changed: 249 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
# --------------------------------
3-
# Feb 28, 2023 - Weekly allocation
3+
# Mar 10, 2023 - Weekly allocation
44
#
55

66
from addresses import *
@@ -56,4 +56,251 @@
5656
# safe = ApeSafe('0xF14BBdf064E3F67f51cd9BD646aE3716aD938FDC')
5757
# safe_tx = safe.multisend_from_receipts(txs)
5858
# safe.sign_with_frame(safe_tx)
59-
# r = safe.post_transaction(safe_tx)
59+
# r = safe.post_transaction(safe_tx)
60+
61+
62+
63+
# --------------------------------
64+
# March 10, 2023 - USDC Depeg
65+
#
66+
67+
from addresses import *
68+
from world import *
69+
from allocations import *
70+
from ape_safe import ApeSafe
71+
72+
votes = """
73+
Morpho Aave USDT 39.04%
74+
Convex OUSD+3Crv 32.18%
75+
Morpho Aave DAI 9.23%
76+
Morpho Aave USDC 9.23%
77+
Convex DAI+USDC+USDT 4.96%
78+
Aave USDT 1.02%
79+
Compound USDC 1.02%
80+
Morpho Compound DAI 1.02%
81+
Morpho Compound USDC 1.02%
82+
Morpho Compound USDT 1.02%
83+
Convex LUSD+3Crv 0.3%
84+
Existing Allocation 0%
85+
Aave DAI 0%
86+
Aave USDC 0%
87+
Compound DAI 0%
88+
Compound USDT 0%
89+
"""
90+
91+
with TemporaryForkWithVaultStats(votes):
92+
before_votes = with_target_allocations(load_from_blockchain(), votes)
93+
94+
txs = []
95+
txs.extend(auto_take_snapshot())
96+
97+
# From
98+
txs.append(vault_admin.withdrawAllFromStrategy(LUSD_3POOL_STRAT, {'from': STRATEGIST}))
99+
txs.append(vault_admin.withdrawAllFromStrategy(CONVEX_STRAT, {'from': STRATEGIST}))
100+
101+
txs.extend(auto_check_snapshot())
102+
103+
print("Est Gas Max: {:,}".format(1.10*sum([x.gas_used for x in txs])))
104+
105+
106+
safe = ApeSafe('0xF14BBdf064E3F67f51cd9BD646aE3716aD938FDC')
107+
safe_tx = safe.multisend_from_receipts(txs)
108+
safe.sign_with_frame(safe_tx)
109+
r = safe.post_transaction(safe_tx)
110+
111+
112+
113+
# --------------------------------
114+
# March 10, 2023 - USDC Depeg
115+
#
116+
117+
from addresses import *
118+
from world import *
119+
from allocations import *
120+
from ape_safe import ApeSafe
121+
122+
votes = """
123+
Morpho Aave USDT 39.04%
124+
Convex OUSD+3Crv 32.18%
125+
Morpho Aave DAI 9.23%
126+
Morpho Aave USDC 9.23%
127+
Convex DAI+USDC+USDT 4.96%
128+
Aave USDT 1.02%
129+
Compound USDC 1.02%
130+
Morpho Compound DAI 1.02%
131+
Morpho Compound USDC 1.02%
132+
Morpho Compound USDT 1.02%
133+
Convex LUSD+3Crv 0.3%
134+
Existing Allocation 0%
135+
Aave DAI 0%
136+
Aave USDC 0%
137+
Compound DAI 0%
138+
Compound USDT 0%
139+
"""
140+
141+
with TemporaryForkWithVaultStats(votes):
142+
before_votes = with_target_allocations(load_from_blockchain(), votes)
143+
144+
txs = []
145+
txs.extend(auto_take_snapshot())
146+
147+
# From
148+
txs.append(vault_admin.withdrawAllFromStrategy(OUSD_METASTRAT, {'from': STRATEGIST}))
149+
150+
txs.extend(auto_check_snapshot())
151+
152+
print("Est Gas Max: {:,}".format(1.10*sum([x.gas_used for x in txs])))
153+
154+
155+
safe = ApeSafe('0xF14BBdf064E3F67f51cd9BD646aE3716aD938FDC')
156+
safe_tx = safe.multisend_from_receipts(txs)
157+
safe.sign_with_frame(safe_tx)
158+
r = safe.post_transaction(safe_tx)
159+
160+
161+
162+
# --------------------------------
163+
# March 10, 2023 - USDC Depeg
164+
#
165+
166+
from addresses import *
167+
from world import *
168+
from allocations import *
169+
from ape_safe import ApeSafe
170+
171+
votes = """
172+
Morpho Aave USDT 39.04%
173+
Convex OUSD+3Crv 32.18%
174+
Morpho Aave DAI 9.23%
175+
Morpho Aave USDC 9.23%
176+
Convex DAI+USDC+USDT 4.96%
177+
Aave USDT 1.02%
178+
Compound USDC 1.02%
179+
Morpho Compound DAI 1.02%
180+
Morpho Compound USDC 1.02%
181+
Morpho Compound USDT 1.02%
182+
Convex LUSD+3Crv 0.3%
183+
Existing Allocation 0%
184+
Aave DAI 0%
185+
Aave USDC 0%
186+
Compound DAI 0%
187+
Compound USDT 0%
188+
"""
189+
190+
with TemporaryForkWithVaultStats(votes):
191+
before_votes = with_target_allocations(load_from_blockchain(), votes)
192+
193+
txs = []
194+
txs.extend(auto_take_snapshot())
195+
196+
# From
197+
# txs.append(vault_admin.withdrawAllFromStrategy(LUSD_3POOL_STRAT, {'from': STRATEGIST}))
198+
txs.append(vault_admin.withdrawAllFromStrategy(CONVEX_STRAT, {'from': STRATEGIST}))
199+
200+
txs.extend(auto_check_snapshot())
201+
202+
print("Est Gas Max: {:,}".format(1.10*sum([x.gas_used for x in txs])))
203+
204+
205+
safe = ApeSafe('0xF14BBdf064E3F67f51cd9BD646aE3716aD938FDC')
206+
safe_tx = safe.multisend_from_receipts(txs)
207+
safe.sign_with_frame(safe_tx)
208+
r = safe.post_transaction(safe_tx)
209+
210+
211+
212+
# --------------------------------
213+
# March 10, 2023 - More Depeg
214+
#
215+
216+
from addresses import *
217+
from world import *
218+
from allocations import *
219+
from ape_safe import ApeSafe
220+
221+
votes = """
222+
Morpho Aave USDT 39.04%
223+
Convex OUSD+3Crv 32.18%
224+
Morpho Aave DAI 9.23%
225+
Morpho Aave USDC 9.23%
226+
Convex DAI+USDC+USDT 4.96%
227+
Aave USDT 1.02%
228+
Compound USDC 1.02%
229+
Morpho Compound DAI 1.02%
230+
Morpho Compound USDC 1.02%
231+
Morpho Compound USDT 1.02%
232+
Convex LUSD+3Crv 0.3%
233+
Existing Allocation 0%
234+
Aave DAI 0%
235+
Aave USDC 0%
236+
Compound DAI 0%
237+
Compound USDT 0%
238+
"""
239+
240+
with TemporaryForkWithVaultStats(votes):
241+
before_votes = with_target_allocations(load_from_blockchain(), votes)
242+
243+
txs = []
244+
# txs.extend(auto_take_snapshot())
245+
246+
# From
247+
txs.append(from_strat(MORPHO_COMP_STRAT, [[483_083, dai], [526_766, usdc], [3_155_766, usdt]]))
248+
txs.append(from_strat(MORPHO_AAVE_STRAT, [ [3_155_766, usdt]]))
249+
250+
# txs.extend(auto_check_snapshot())
251+
252+
print("Est Gas Max: {:,}".format(1.10*sum([x.gas_used for x in txs])))
253+
254+
255+
safe = ApeSafe('0xF14BBdf064E3F67f51cd9BD646aE3716aD938FDC')
256+
safe_tx = safe.multisend_from_receipts(txs)
257+
safe.sign_with_frame(safe_tx)
258+
r = safe.post_transaction(safe_tx)
259+
260+
261+
# --------------------------------
262+
# March 11, 2023 - Depeg IN
263+
#
264+
265+
from addresses import *
266+
from world import *
267+
from allocations import *
268+
from ape_safe import ApeSafe
269+
270+
votes = """
271+
Morpho Aave USDT 39.04%
272+
Convex OUSD+3Crv 32.18%
273+
Morpho Aave DAI 9.23%
274+
Morpho Aave USDC 9.23%
275+
Convex DAI+USDC+USDT 4.96%
276+
Aave USDT 1.02%
277+
Compound USDC 1.02%
278+
Morpho Compound DAI 1.02%
279+
Morpho Compound USDC 1.02%
280+
Morpho Compound USDT 1.02%
281+
Convex LUSD+3Crv 0.3%
282+
Existing Allocation 0%
283+
Aave DAI 0%
284+
Aave USDC 0%
285+
Compound DAI 0%
286+
Compound USDT 0%
287+
"""
288+
289+
with TemporaryForkWithVaultStats(votes):
290+
before_votes = with_target_allocations(load_from_blockchain(), votes)
291+
292+
txs = []
293+
txs.extend(auto_take_snapshot())
294+
295+
# From
296+
txs.append(to_strat(OUSD_METASTRAT, [[1_000_000, usdc]]))
297+
298+
txs.extend(auto_check_snapshot())
299+
300+
print("Est Gas Max: {:,}".format(1.10*sum([x.gas_used for x in txs])))
301+
302+
303+
safe = ApeSafe('0xF14BBdf064E3F67f51cd9BD646aE3716aD938FDC')
304+
safe_tx = safe.multisend_from_receipts(txs)
305+
safe.sign_with_frame(safe_tx)
306+
r = safe.post_transaction(safe_tx)

0 commit comments

Comments
 (0)