-
Notifications
You must be signed in to change notification settings - Fork 84
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/base-strategist-update
- Loading branch information
Showing
64 changed files
with
4,044 additions
and
1,274 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
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 |
---|---|---|
|
@@ -84,3 +84,6 @@ fork-coverage | |
unit-coverage | ||
|
||
.VSCodeCounter | ||
|
||
# Certora # | ||
.certora_internal |
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,85 @@ | ||
# ------------------------------------- | ||
# Jan 6, 2025 - Withdraw 1k from new OUSD Morpho Gauntlet Strategies | ||
# ------------------------------------- | ||
from world import * | ||
|
||
def main(): | ||
with TemporaryForkForReallocations() as txs: | ||
# Before | ||
txs.append(vault_core.rebase(std)) | ||
txs.append(vault_value_checker.takeSnapshot(std)) | ||
|
||
# Remove 1k USDC from Morpho Gauntlet Strategy | ||
txs.append( | ||
vault_admin.withdrawFromStrategy( | ||
MORPHO_GAUNTLET_PRIME_USDC_STRAT, | ||
[usdc], | ||
[1000 * 10**6], | ||
{'from': STRATEGIST} | ||
) | ||
) | ||
|
||
# Remove 1k USDT from Morpho Gauntlet Strategy | ||
txs.append( | ||
vault_admin.withdrawFromStrategy( | ||
MORPHO_GAUNTLET_PRIME_USDT_STRAT, | ||
[usdt], | ||
[1000 * 10**6], | ||
{'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, (1 * 10**18), vault_change, (1 * 10**18), std)) | ||
print("-----") | ||
print("Profit", "{:.6f}".format(profit / 10**18), profit) | ||
print("OUSD supply change", "{:.6f}".format(supply_change / 10**18), supply_change) | ||
print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change) | ||
print("-----") | ||
|
||
# ------------------------------------- | ||
# Jan 7, 2025 - Withdraw 100k USDC from Morpho Steakhouse and deposit in Morpho Gauntlet Prime | ||
# ------------------------------------- | ||
from world import * | ||
|
||
def main(): | ||
with TemporaryForkForReallocations() as txs: | ||
# Before | ||
txs.append(vault_core.rebase(std)) | ||
txs.append(vault_value_checker.takeSnapshot(std)) | ||
|
||
# Remove 100k USDC from Morpho Steakhouse Strategy | ||
txs.append( | ||
vault_admin.withdrawFromStrategy( | ||
MORPHO_META_USDC_STRAT, | ||
[usdc], | ||
[1000000 * 10**6], | ||
{'from': STRATEGIST} | ||
) | ||
) | ||
|
||
# Deposit 100k USDC tin Morpho Gauntlet Prime Strategy | ||
txs.append( | ||
vault_admin.depositToStrategy( | ||
MORPHO_GAUNTLET_PRIME_USDC_STRAT, | ||
[usdc], | ||
[1000000 * 10**6], | ||
{'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, (1 * 10**18), vault_change, (1 * 10**18), std)) | ||
print("-----") | ||
print("Profit", "{:.6f}".format(profit / 10**18), profit) | ||
print("OUSD supply change", "{:.6f}".format(supply_change / 10**18), supply_change) | ||
print("Vault Change", "{:.6f}".format(vault_change / 10**18), vault_change) | ||
print("-----") | ||
|
||
|
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,16 @@ | ||
{ | ||
"files": [ | ||
"contracts/contracts/token/OUSD.sol" | ||
], | ||
"msg": "OUSD Accounting invariants", | ||
"packages": [ | ||
"@openzeppelin/contracts=contracts/lib/openzeppelin/contracts", | ||
], | ||
"process": "emv", | ||
"prover_args": [ | ||
|
||
], | ||
"solc": "solc8.28", | ||
"verify": "OUSD:certora/specs/OUSD/AccountInvariants.spec", | ||
"server": "production", | ||
} |
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,18 @@ | ||
{ | ||
"files": [ | ||
"contracts/contracts/token/OUSD.sol" | ||
], | ||
"msg": "OUSD Balances invariants", | ||
"packages": [ | ||
"@openzeppelin/contracts=contracts/lib/openzeppelin/contracts", | ||
], | ||
"process": "emv", | ||
"prover_args": [ | ||
"-mediumTimeout 40", | ||
], | ||
"multi_assert_check":true, | ||
"smt_timeout":"1000", | ||
"solc": "solc8.28", | ||
"verify": "OUSD:certora/specs/OUSD/BalanceInvariants.spec", | ||
"server": "production" | ||
} |
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,17 @@ | ||
{ | ||
"files": [ | ||
"contracts/contracts/token/OUSD.sol" | ||
], | ||
"msg": "OUSD other invariants", | ||
"packages": [ | ||
"@openzeppelin/contracts=contracts/lib/openzeppelin/contracts", | ||
], | ||
"process": "emv", | ||
"prover_args": [ | ||
"-mediumTimeout 40", | ||
], | ||
"smt_timeout":"1000", | ||
"solc": "solc8.28", | ||
"verify": "OUSD:certora/specs/OUSD/OtherInvariants.spec", | ||
"server": "production" | ||
} |
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,19 @@ | ||
{ | ||
"files": [ | ||
"contracts/contracts/token/OUSD.sol" | ||
], | ||
"msg": "OUSD Sum of balances rules", | ||
"packages": [ | ||
"@openzeppelin/contracts=contracts/lib/openzeppelin/contracts", | ||
], | ||
"process": "emv", | ||
"prover_args": [ | ||
"-mediumTimeout 40", | ||
"-s [z3:lia2,z3:arith1,yices:def]", | ||
], | ||
"multi_assert_check":true, | ||
"smt_timeout":"1000", | ||
"solc": "solc8.28", | ||
"verify": "OUSD:certora/specs/OUSD/SumOfBalances.spec", | ||
"server": "production" | ||
} |
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,4 @@ | ||
certoraRun certora/confs/OUSD_accounting.conf | ||
certoraRun certora/confs/OUSD_balances.conf | ||
certoraRun certora/confs/OUSD_other.conf | ||
certoraRun certora/confs/OUSD_sumOfBalances.conf |
Oops, something went wrong.