Skip to content

Commit edf9614

Browse files
committed
Merge branch 'master' into shah/l2-governance
2 parents 71a30ef + e62e925 commit edf9614

37 files changed

+2765
-934
lines changed

brownie/abi/frxeth_redeem_strat.json

Lines changed: 669 additions & 0 deletions
Large diffs are not rendered by default.

brownie/runlogs/2024_03_strategist.py

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# -------------------------------
2+
# Mar 13, 2024 - OUSD Allocation
3+
# -------------------------------
4+
from world import *
5+
6+
def main():
7+
with TemporaryForkForReallocations() as txs:
8+
# Before
9+
txs.append(vault_core.rebase({'from':STRATEGIST}))
10+
txs.append(vault_value_checker.takeSnapshot({'from':STRATEGIST}))
11+
12+
# Withdraw all USDC and USDT from Flux
13+
txs.append(
14+
vault_admin.withdrawFromStrategy(
15+
FLUX_STRAT,
16+
[usdt, usdc],
17+
[flux_strat.checkBalance(usdt), flux_strat.checkBalance(usdc)],
18+
{'from': STRATEGIST}
19+
)
20+
)
21+
22+
# Put everything in Morpho Aave (default strategy for USDC and USDT)
23+
txs.append(vault_core.allocate({'from': STRATEGIST}))
24+
25+
# After
26+
vault_change = vault_core.totalValue() - vault_value_checker.snapshots(STRATEGIST)[0]
27+
supply_change = ousd.totalSupply() - vault_value_checker.snapshots(STRATEGIST)[1]
28+
profit = vault_change - supply_change
29+
30+
txs.append(vault_value_checker.checkDelta(profit, (500 * 10**18), vault_change, (500 * 10**18), {'from': STRATEGIST}))
31+
print("-----")
32+
print("Profit", "{:.6f}".format(profit / 10**18), profit)
33+
print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change)
34+
35+
# ---------------------------------
36+
# Mar 14, 2024 - Move out from Flux
37+
# ---------------------------------
38+
from world import *
39+
40+
def main():
41+
with TemporaryForkForReallocations() as txs:
42+
# Before
43+
txs.append(vault_core.rebase({'from':STRATEGIST}))
44+
txs.append(vault_value_checker.takeSnapshot({'from':STRATEGIST}))
45+
46+
# Withdraw all from Flux (including dust)
47+
txs.append(
48+
vault_admin.withdrawAllFromStrategy(
49+
FLUX_STRAT,
50+
{'from': STRATEGIST}
51+
)
52+
)
53+
54+
# Put everything in Morpho Aave (default strategy for USDC and USDT)
55+
txs.append(vault_core.allocate({'from': STRATEGIST}))
56+
57+
# After
58+
vault_change = vault_core.totalValue() - vault_value_checker.snapshots(STRATEGIST)[0]
59+
supply_change = ousd.totalSupply() - vault_value_checker.snapshots(STRATEGIST)[1]
60+
profit = vault_change - supply_change
61+
62+
txs.append(vault_value_checker.checkDelta(profit, (500 * 10**18), vault_change, (500 * 10**18), {'from': STRATEGIST}))
63+
print("-----")
64+
print("Profit", "{:.6f}".format(profit / 10**18), profit)
65+
print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change)
66+
67+
# -------------------------------------
68+
# Mar 15, 2024 - OETH Buyback
69+
# -------------------------------------
70+
from buyback import *
71+
72+
def main():
73+
txs = []
74+
75+
with TemporaryFork():
76+
txs.append(
77+
build_buyback_tx(
78+
OETH,
79+
oeth.balanceOf(OETH_BUYBACK),
80+
max_ogv_slippage=3,
81+
max_cvx_slippage=10
82+
)
83+
)
84+
85+
txs.append(
86+
cvx_locker.processExpiredLocks(True, std)
87+
)
88+
89+
print(to_gnosis_json(txs))
90+
91+
# -------------------------------------
92+
# Mar 15, 2024 - OETH Reallocation
93+
# -------------------------------------
94+
from world import *
95+
96+
def main():
97+
with TemporaryForkForReallocations() as txs:
98+
# Before
99+
txs.append(vault_oeth_core.rebase(std))
100+
txs.append(oeth_vault_value_checker.takeSnapshot(std))
101+
102+
# Deposit 467 rETH and 230 WERH to the Balancer strategy
103+
txs.append(
104+
vault_oeth_admin.depositToStrategy(
105+
BALANCER_RETH_STRATEGY,
106+
[reth, WETH],
107+
[467.04342 * 10**18, 230.56953 * 10**18],
108+
std
109+
)
110+
)
111+
112+
# After
113+
vault_change = vault_oeth_core.totalValue() - oeth_vault_value_checker.snapshots(STRATEGIST)[0]
114+
supply_change = oeth.totalSupply() - oeth_vault_value_checker.snapshots(STRATEGIST)[1]
115+
profit = vault_change - supply_change
116+
txs.append(oeth_vault_value_checker.checkDelta(profit, (1 * 10**18), vault_change, (1 * 10**18), std))
117+
print("-----")
118+
print("Profit", "{:.6f}".format(profit / 10**18), profit)
119+
print("OETH supply change", "{:.6f}".format(supply_change / 10**18), supply_change)
120+
print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change)
121+
print("-----")
122+
123+
# -------------------------------------
124+
# Mar 18, 2024 - OUSD Buyback
125+
# -------------------------------------
126+
from buyback import *
127+
128+
def main():
129+
txs = []
130+
131+
with TemporaryFork():
132+
txs.append(
133+
build_buyback_tx(
134+
OUSD,
135+
ousd.balanceOf(OUSD_BUYBACK),
136+
max_ogv_slippage=3,
137+
max_cvx_slippage=6
138+
)
139+
)
140+
141+
print(to_gnosis_json(txs))

brownie/world.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def load_contract(name, address):
7070
lusd_3pool_strat = load_contract('lusd_3pool_strat', LUSD_3POOL_STRAT)
7171
oeth_morpho_aave_strat = load_contract('morpho_aave_strat', OETH_MORPHO_AAVE_STRAT)
7272
oeth_meta_strat = load_contract('oeth_meta_strat', OETH_CONVEX_OETH_ETH_STRAT)
73+
flux_strat = load_contract('comp_strat', FLUX_STRAT)
7374

7475
ousd_metapool = load_contract("ousd_metapool", OUSD_METAPOOL)
7576
threepool = load_contract("threepool_swap", THREEPOOL)

contracts/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,14 @@ There's an example
305305
npx hardhat --network mainnet verify --contract contracts/vault/VaultAdmin.sol:VaultAdmin 0x31a91336414d3B955E494E7d485a6B06b55FC8fB
306306
```
307307

308+
### Deployed contract code verification
309+
310+
To verify the deployed contract against the locally compiled contracts sol2uml from Nick Addison is convenient:
311+
```
312+
sol2uml diff [0x_address_of_the_deployed_contract] .,node_modules
313+
```
314+
315+
308316
## Continuous Integration
309317

310318
[GitHub Actions](https://github.com/features/actions) are used for the build. The configuration for GitHub Actions is in [.github/workflows/defi.yml](../.github/workflows/defi.yml). The action workflows can be found at https://github.com/OriginProtocol/origin-dollar/actions.

contracts/contracts/interfaces/IVault.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,6 @@ interface IVault {
198198
function setNetOusdMintForStrategyThreshold(uint256 _threshold) external;
199199

200200
function netOusdMintedForStrategy() external view returns (int256);
201+
202+
function weth() external view returns (address);
201203
}

contracts/contracts/proxies/Proxies.sol

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,13 @@ contract MakerDsrStrategyProxy is InitializeGovernedUpgradeabilityProxy {
189189

190190
}
191191

192+
/**
193+
* @notice FrxEthRedeemStrategyProxy delegates calls to a FrxEthRedeemStrategy implementation
194+
*/
195+
contract FrxEthRedeemStrategyProxy is InitializeGovernedUpgradeabilityProxy {
196+
197+
}
198+
192199
/**
193200
* @notice OETHBuybackProxy delegates calls to Buyback implementation
194201
*/

0 commit comments

Comments
 (0)