-
Notifications
You must be signed in to change notification settings - Fork 0
Nialexsan/wbtc weth #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Nialexsan/wbtc weth #108
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
a978f9b
strategy
nialexsan 5bb42a8
switch strategy
nialexsan ccebb8a
Merge branch 'main' into nialexsan/wbtc-weth
nialexsan cbea629
setup scripts
nialexsan bd95ca8
fix typo
nialexsan 961f187
fix typo
nialexsan 12b4805
fix contract
nialexsan d2ece22
Update cadence/contracts/FlowYieldVaultsStrategies.cdc
nialexsan 1745eb1
Merge branch 'main' into nialexsan/wbtc-weth
nialexsan 818450f
Merge branch 'main' into nialexsan/wbtc-weth
nialexsan 836530c
add config
nialexsan 440221c
fix typo
nialexsan 6a3c102
fix config
nialexsan 3291272
Merge branch 'main' into nialexsan/wbtc-weth
nialexsan 0dc3ae9
Update flow.json
nialexsan d9ee846
add mainnet setup
nialexsan 7d6c2bb
temporarily delete strategy
nialexsan 2d4e129
fix schedule time
nialexsan 976fee8
Revert "temporarily delete strategy"
nialexsan d201f91
update env vars
nialexsan 244209a
add missing files
nialexsan c9691a2
tweak nil checks
nialexsan b9ba3be
bump
nialexsan d1813fa
remove comments
nialexsan 18264cb
Merge branch 'main' into nialexsan/wbtc-weth
nialexsan defcb60
address PR comments
nialexsan 9d6de4f
fix test
nialexsan a074e62
fix access
nialexsan ac8cf2b
address PR comments
nialexsan d3cfcb3
address comments
nialexsan 6f00c68
fix typo
nialexsan 88f3e5e
typos
nialexsan 05d179b
restore getSupportedComposers method
nialexsan 6119231
Merge branch 'main' into nialexsan/wbtc-weth
nialexsan 8c98ed5
Merge branch 'main' into nialexsan/wbtc-weth
nialexsan e98494f
pre deployment fixes
nialexsan 7f88290
revert FlowCreditMarket submodule update
nialexsan 2c2baa0
mainnet config
nialexsan a25a721
Merge branch 'main' into nialexsan/wbtc-weth
nialexsan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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
54 changes: 54 additions & 0 deletions
54
cadence/transactions/flow-yield-vaults/admin/upsert_musdf_config.cdc
This file contains hidden or 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,54 @@ | ||
| import "FungibleToken" | ||
| import "EVM" | ||
| import "FlowYieldVaultsStrategiesV1_1" | ||
|
|
||
| /// Admin tx to (re)configure Uniswap paths for the mUSDFStrategy | ||
| /// | ||
| /// NOTE: | ||
| /// - Must be signed by the account that deployed FlowYieldVaultsStrategies | ||
| /// - You can omit some collaterals by passing empty arrays and guarding in prepare{} | ||
| transaction( | ||
| tokenTypeIdentifier: String, | ||
| yieldTokenEVMAddress: String, | ||
|
|
||
| // collateral path/fees: [YIELD, ..., <COLLATERAL>] | ||
| swapPath: [String], | ||
| fees: [UInt32] | ||
| ) { | ||
|
|
||
| prepare(acct: auth(Storage, Capabilities, BorrowValue) &Account) { | ||
| let tokenType = CompositeType(tokenTypeIdentifier) | ||
| ?? panic("Invalid tokenTypeIdentifier \(tokenTypeIdentifier)") | ||
| // This tx must run on the same account that stores the issuer | ||
| // otherwise this borrow will fail. | ||
| let issuer = acct.storage.borrow< | ||
| auth(FlowYieldVaultsStrategiesV1_1.Configure) &FlowYieldVaultsStrategiesV1_1.StrategyComposerIssuer | ||
| >(from: FlowYieldVaultsStrategiesV1_1.IssuerStoragePath) | ||
| ?? panic("Missing StrategyComposerIssuer at IssuerStoragePath") | ||
|
|
||
| let yieldEVM = EVM.addressFromString(yieldTokenEVMAddress) | ||
|
|
||
| // helper to map [String] -> [EVM.EVMAddress] | ||
| fun toEVM(_ hexes: [String]): [EVM.EVMAddress] { | ||
| let out: [EVM.EVMAddress] = [] | ||
| for h in hexes { | ||
| out.append(EVM.addressFromString(h)) | ||
| } | ||
| return out | ||
| } | ||
|
|
||
| let composerType = Type<@FlowYieldVaultsStrategiesV1_1.mUSDFStrategyComposer>() | ||
| let strategyType = Type<@FlowYieldVaultsStrategiesV1_1.mUSDFStrategy>() | ||
|
|
||
| if swapPath.length > 0 { | ||
| issuer.addOrUpdateCollateralConfig( | ||
| composer: composerType, | ||
| strategyType: strategyType, | ||
| collateralVaultType: tokenType, | ||
| yieldTokenEVMAddress: yieldEVM, | ||
| yieldToCollateralAddressPath: toEVM(swapPath), | ||
| yieldToCollateralFeePath: fees | ||
| ) | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liobrasil just a sanity check
do these params look correct for this config:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aave Rate Strategy (Volatile One)
Collateral / Borrow Factors (WBTC)
Deposit Capacity (WBTC)
depositRate = 0.006 WBTC/hrdepositCapacityCap = 0.1 WBTC