-
Notifications
You must be signed in to change notification settings - Fork 0
Update recurring config #109
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
Changes from 6 commits
5063404
624722a
75ac4de
a75aaec
226a738
f205478
3d9d2aa
a5ddb05
ca02657
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -216,7 +216,7 @@ access(all) contract FlowYieldVaultsStrategies { | |
| // init YieldToken -> FLOW Swapper | ||
| let yieldToFlowSwapper = MockSwapper.Swapper( | ||
| inVault: yieldTokenType, | ||
| outVault: collateralType, | ||
| outVault: collateralType, | ||
| uniqueID: uniqueID | ||
| ) | ||
| // allows for YieldToken to be deposited to the Position | ||
|
|
@@ -336,6 +336,7 @@ access(all) contract FlowYieldVaultsStrategies { | |
| } | ||
|
|
||
| /// Composes a Strategy of the given type with the provided funds | ||
| /// TODO: Open up for multiple collateral types | ||
| access(all) fun createStrategy( | ||
| _ type: Type, | ||
| uniqueID: DeFiActions.UniqueIdentifier, | ||
|
|
@@ -496,7 +497,7 @@ access(all) contract FlowYieldVaultsStrategies { | |
| ?? panic("Could not find UniswapV3 address path for collateral type \(collateralType.identifier)") | ||
| assert(uniV3AddressPath.length > 1, message: "Invalid Uniswap V3 swap path length of \(uniV3AddressPath.length)") | ||
| assert(uniV3AddressPath[0].equals(yieldTokenEVMAddress), | ||
| message: "UniswapV3 swap path does not match - expected path[0] to be \(yieldTokenEVMAddress.toString()) but found \(uniV3AddressPath[0].toString())") | ||
| message: "UniswapV3 swap path does not match - expected path[0] to be \(yieldTokenEVMAddress.toString()) but found \(uniV3AddressPath[0].toString())") | ||
| let collateralUniV3FeePathConfig = collateralConfig["yieldToCollateralUniV3FeePaths"] as? {Type: [UInt32]} | ||
| ?? panic("Could not find UniswapV3 fee paths config when creating Strategy \(type.identifier) with collateral \(collateralType.identifier)") | ||
| let uniV3FeePath = collateralUniV3FeePathConfig[collateralType] | ||
|
|
@@ -545,7 +546,7 @@ access(all) contract FlowYieldVaultsStrategies { | |
| } | ||
|
|
||
| access(all) view fun getSupportedComposers(): {Type: Bool} { | ||
| return { | ||
| return { | ||
| Type<@mUSDCStrategyComposer>(): true, | ||
| Type<@TracerStrategyComposer>(): true | ||
| } | ||
|
|
@@ -617,11 +618,11 @@ access(all) contract FlowYieldVaultsStrategies { | |
| fun _createRecurringConfig(withID: DeFiActions.UniqueIdentifier?): DeFiActions.AutoBalancerRecurringConfig { | ||
| // Create txnFunder that can provide/accept FLOW for scheduling fees | ||
| let txnFunder = self._createTxnFunder(withID: withID) | ||
|
|
||
| return DeFiActions.AutoBalancerRecurringConfig( | ||
| interval: 60, // Rebalance every 60 seconds | ||
| interval: 60 * 10, // Rebalance every 10 minutes | ||
| priority: FlowTransactionScheduler.Priority.Medium, | ||
| executionEffort: 800, | ||
| executionEffort: 999, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this updated to 999? the new logic added from this PR increased the execution effort?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can bump this back down to 800. I do think it's helpful to have some buffer on execution effort, and reducing freguency + prio should give us relief on txn costs.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be settable now, so i guess it doesn't matter too much. Can adjust based on cost |
||
| forceRebalance: false, | ||
| txnFunder: txnFunder | ||
| ) | ||
|
|
||
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.
i assume that changing this mostly makes this more upgradable?
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.
I moved the supervisor cap from a contract field to account storage primarily so that it's accessible in transaction context. Previously the scheduler contract was doing this through an
access(all)method but that exposes a vulnerability. So instead, we access the authorized capability from storage. Normally, we would just reference the stored resource, but scheduling requires a capability and reissuing a capability every time creates a ton of CapabilityControllers that consumer resources.