Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a978f9b
strategy
nialexsan Dec 10, 2025
5bb42a8
switch strategy
nialexsan Dec 10, 2025
ccebb8a
Merge branch 'main' into nialexsan/wbtc-weth
nialexsan Dec 10, 2025
cbea629
setup scripts
nialexsan Dec 10, 2025
bd95ca8
fix typo
nialexsan Dec 10, 2025
961f187
fix typo
nialexsan Dec 10, 2025
12b4805
fix contract
nialexsan Dec 10, 2025
d2ece22
Update cadence/contracts/FlowYieldVaultsStrategies.cdc
nialexsan Dec 10, 2025
1745eb1
Merge branch 'main' into nialexsan/wbtc-weth
nialexsan Dec 18, 2025
818450f
Merge branch 'main' into nialexsan/wbtc-weth
nialexsan Dec 18, 2025
836530c
add config
nialexsan Dec 18, 2025
440221c
fix typo
nialexsan Dec 18, 2025
6a3c102
fix config
nialexsan Dec 20, 2025
3291272
Merge branch 'main' into nialexsan/wbtc-weth
nialexsan Dec 20, 2025
0dc3ae9
Update flow.json
nialexsan Dec 22, 2025
d9ee846
add mainnet setup
nialexsan Dec 22, 2025
7d6c2bb
temporarily delete strategy
nialexsan Dec 22, 2025
2d4e129
fix schedule time
nialexsan Dec 22, 2025
976fee8
Revert "temporarily delete strategy"
nialexsan Dec 22, 2025
d201f91
update env vars
nialexsan Dec 22, 2025
244209a
add missing files
nialexsan Dec 23, 2025
c9691a2
tweak nil checks
nialexsan Dec 23, 2025
b9ba3be
bump
nialexsan Dec 23, 2025
d1813fa
remove comments
nialexsan Jan 6, 2026
18264cb
Merge branch 'main' into nialexsan/wbtc-weth
nialexsan Jan 6, 2026
defcb60
address PR comments
nialexsan Jan 7, 2026
9d6de4f
fix test
nialexsan Jan 7, 2026
a074e62
fix access
nialexsan Jan 7, 2026
ac8cf2b
address PR comments
nialexsan Jan 8, 2026
d3cfcb3
address comments
nialexsan Jan 12, 2026
6f00c68
fix typo
nialexsan Jan 12, 2026
88f3e5e
typos
nialexsan Jan 12, 2026
05d179b
restore getSupportedComposers method
nialexsan Jan 12, 2026
6119231
Merge branch 'main' into nialexsan/wbtc-weth
nialexsan Jan 12, 2026
8c98ed5
Merge branch 'main' into nialexsan/wbtc-weth
nialexsan Jan 13, 2026
e98494f
pre deployment fixes
nialexsan Jan 13, 2026
7f88290
revert FlowCreditMarket submodule update
nialexsan Jan 14, 2026
2c2baa0
mainnet config
nialexsan Jan 15, 2026
a25a721
Merge branch 'main' into nialexsan/wbtc-weth
nialexsan Jan 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cadence/contracts/FlowYieldVaults.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -467,4 +467,4 @@ access(all) contract FlowYieldVaults {
let cap = self.account.capabilities.storage.issue<&StrategyFactory>(self.FactoryStoragePath)
self.account.capabilities.publish(cap, at: self.FactoryPublicPath)
}
}
}
773 changes: 773 additions & 0 deletions cadence/contracts/FlowYieldVaultsStrategiesV1_1.cdc

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions cadence/tests/test_helpers.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,17 @@ access(all) fun deployContracts() {
)
Test.expect(err, Test.beNil())

err = Test.deployContract(
name: "FlowYieldVaultsStrategiesV1_1",
path: "../contracts/FlowYieldVaultsStrategiesV1_1.cdc",
arguments: [
"0x986Cb42b0557159431d48fE0A40073296414d410",
"0x92657b195e22b69E4779BBD09Fa3CD46F0CF8e39",
"0x8dd92c8d0C3b304255fF9D98ae59c3385F88360C"
]
)

Test.expect(err, Test.beNil())
// FLOW looping strategy
err = Test.deployContract(
name: "PMStrategiesV1",
Expand Down
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
)
}
}
}
72 changes: 70 additions & 2 deletions flow.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@
"testnet": "d2580caf2ef07c2f"
}
},
"FlowYieldVaultsStrategiesV1_1": {
"source": "cadence/contracts/FlowYieldVaultsStrategiesV1_1.cdc",
"aliases": {
"emulator": "045a1763c93006ca",
"mainnet": "b1d63873c3cc9f79",
"testing": "0000000000000009",
"testnet": "d2580caf2ef07c2f"
}
},
"FungibleTokenConnectors": {
"source": "./lib/FlowCreditMarket/FlowActions/cadence/contracts/connectors/FungibleTokenConnectors.cdc",
"aliases": {
Expand Down Expand Up @@ -305,7 +314,7 @@
},
"EVM": {
"source": "mainnet://e467b9dd11fa00df.EVM",
"hash": "2a4782c7459dc5b72c034f67c8dd1beac6bb9b29104772a3e6eb6850718bb3b4",
"hash": "c77a07a7eac28b1470b148204d6f2e3527d931b2d2df341618ab888201316a0b",
"aliases": {
"emulator": "f8d6e0586b0a20c7",
"mainnet": "e467b9dd11fa00df",
Expand Down Expand Up @@ -470,7 +479,7 @@
},
"FlowTransactionSchedulerUtils": {
"source": "mainnet://e467b9dd11fa00df.FlowTransactionSchedulerUtils",
"hash": "b5d6f06dd43e4cee907e08a5bc46df0bb9c2338d806d9d253789aee4c4ac01ad",
"hash": "429ed886472cd65def9e5ab1dd20079b0dcfb23095d18d54077767ac3316a8ce",
"aliases": {
"emulator": "f8d6e0586b0a20c7",
"mainnet": "e467b9dd11fa00df",
Expand Down Expand Up @@ -728,6 +737,14 @@
"resourceID": "projects/dl-flow-devex-production/locations/us-central1/keyRings/tidal-keyring/cryptoKeys/tidal_admin_pk/cryptoKeyVersions/1"
}
},
"mainnet-band-oracle-connectors": {
"address": "e36ef556b8b5d955",
"key": {
"type": "google-kms",
"hashAlgorithm": "SHA2_256",
"resourceID": "projects/flow-foundation-admin/locations/global/keyRings/defi-actions/cryptoKeys/mainnet-defi-actions/cryptoKeyVersions/1"
}
},
"mainnet-flow-credit-market-deployer": {
"address": "6b00ff876c299c61",
"key": {
Expand Down Expand Up @@ -855,6 +872,23 @@
}
]
},
{
"name": "FlowYieldVaultsStrategiesV1_1",
"args": [
{
"value": "0x986Cb42b0557159431d48fE0A40073296414d410",
"type": "String"
},
{
"value": "0x92657b195e22b69E4779BBD09Fa3CD46F0CF8e39",
"type": "String"
},
{
"value": "0x8dd92c8d0C3b304255fF9D98ae59c3385F88360C",
"type": "String"
}
]
},
{
"name": "PMStrategiesV1",
"args": [
Expand Down Expand Up @@ -966,6 +1000,23 @@
}
]
},
{
"name": "FlowYieldVaultsStrategiesV1_1",
"args": [
{
"value": "0xca6d7Bb03334bBf135902e1d919a5feccb461632",
"type": "String"
},
{
"value": "0xeEDC6Ff75e1b10B903D9013c358e446a73d35341",
"type": "String"
},
{
"value": "0x370A8DF17742867a44e56223EC20D82092242C85",
"type": "String"
}
]
},
{
"name": "PMStrategiesV1",
"args": [
Expand Down Expand Up @@ -1054,6 +1105,23 @@
}
]
},
{
"name": "FlowYieldVaultsStrategiesV1_1",
"args": [
{
"value": "0x92657b195e22b69E4779BBD09Fa3CD46F0CF8e39",
"type": "String"
},
{
"value": "0x2Db6468229F6fB1a77d248Dbb1c386760C257804",
"type": "String"
},
{
"value": "0xA1e0E4CCACA34a738f03cFB1EAbAb16331FA3E2c",
"type": "String"
}
]
},
{
"name": "PMStrategiesV1",
"args": [
Expand Down
12 changes: 12 additions & 0 deletions local/setup_emulator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ flow transactions send ./cadence/transactions/flow-yield-vaults/admin/add_strate
/storage/FlowYieldVaultsStrategyComposerIssuer_0x045a1763c93006ca \
--signer emulator-flow-yield-vaults

# flow transactions send ../cadence/transactions/flow-yield-vaults/admin/upsert_musdf_config.cdc \
# "A.0ae53cb6e3f42a79.FlowToken.Vault" \
# <yield token>



flow transactions send ./cadence/transactions/flow-yield-vaults/admin/add_strategy_composer.cdc \
'A.045a1763c93006ca.FlowYieldVaultsStrategiesV1_1.mUSDFStrategy' \
'A.045a1763c93006ca.FlowYieldVaultsStrategiesV1_1.mUSDFStrategyComposer' \
/storage/FlowYieldVaultsStrategyV1_1ComposerIssuer_0x045a1763c93006ca \
--signer emulator-flow-yield-vaults

# grant PoolBeta cap
echo "Grant Protocol Beta access to FlowYieldVaults"
flow transactions send ./lib/FlowCreditMarket/cadence/tests/transactions/flow-credit-market/pool-management/03_grant_beta.cdc \
Expand Down
129 changes: 118 additions & 11 deletions local/setup_mainnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,63 @@ flow transactions send ./lib/FlowCreditMarket/cadence/transactions/flow-credit-m
--network mainnet \
--signer mainnet-flow-credit-market-deployer

# add WBTC to band oracle
cd ./lib/FlowCreditMarket/FlowActions && flow transactions send ./cadence/transactions/band-oracle-connector/add_symbol.cdc "BTC" "A.1e4aa0b87d10b141.EVMVMBridgedToken_717dae2baf7656be9a9b01dee31d571a9d4c9579.Vault" --network mainnet --signer mainnet-band-oracle-connectors && cd ../../..

# add WETH to band oracle
cd ./lib/FlowCreditMarket/FlowActions && flow transactions send ./cadence/transactions/band-oracle-connector/add_symbol.cdc "ETH" "A.1e4aa0b87d10b141.EVMVMBridgedToken_2f6f07cdcf3588944bf4c42ac74ff24bf56e7590.Vault" --network mainnet --signer mainnet-band-oracle-connectors && cd ../../..

# WBTC simple curve
flow transactions send ./lib/FlowCreditMarket/cadence/transactions/flow-credit-market/pool-governance/add_supported_token_simple_interest_curve.cdc \
'A.1e4aa0b87d10b141.EVMVMBridgedToken_717dae2baf7656be9a9b01dee31d571a9d4c9579.Vault' \
0.8 \
1.0 \
1_000_000.0 \
1_000_000.0 \
--network mainnet \
--signer mainnet-flow-credit-market-deployer

# WETH simple curve
flow transactions send ./lib/FlowCreditMarket/cadence/transactions/flow-credit-market/pool-governance/add_supported_token_simple_interest_curve.cdc \
'A.1e4aa0b87d10b141.EVMVMBridgedToken_2f6f07cdcf3588944bf4c42ac74ff24bf56e7590.Vault' \
0.8 \
1.0 \
1_000_000.0 \
1_000_000.0 \
--network mainnet \
--signer mainnet-flow-credit-market-deployer

# kink interest curve setup
# enable when FCM_V1 is deployed
#
# # add WBTC as supported token
# flow transactions send ../lib/FlowCreditMarket/cadence/transactions/flow-credit-market/pool-governance/add_supported_token_kink_curve.cdc \
# 'A.1e4aa0b87d10b141.EVMVMBridgedToken_717dae2baf7656be9a9b01dee31d571a9d4c9579.Vault' \
# 0.8 \
# 1.0 \
# 0.8 \
# 0.0 \
# 0.04 \
# 0.4 \
# 1_000_000.0 \
# 1_000_000.0 \
# --network mainnet \
# --signer mainnet-flow-credit-market-deployer
#
# # add WETH as supported token
# flow transactions send ./lib/FlowCreditMarket/cadence/transactions/flow-credit-market/pool-governance/add_supported_token_kink_curve.cdc \
# 'A.1e4aa0b87d10b141.EVMVMBridgedToken_2f6f07cdcf3588944bf4c42ac74ff24bf56e7590.Vault' \
# 0.8 \
# 1.0 \
# 0.8 \
# 0.0 \
# 0.04 \
# 0.4 \
# 1_000_000.0 \
# 1_000_000.0 \
# --network mainnet \
# --signer mainnet-flow-credit-market-deployer

# TODO
# swap
# echo "swap Flow to MOET"
Expand All @@ -57,11 +114,42 @@ flow transactions send ./cadence/transactions/mocks/swapper/set_liquidity_connec
flow transactions send ./lib/FlowCreditMarket/FlowActions/cadence/transactions/fungible-tokens/setup_generic_vault.cdc 'A.1e4aa0b87d10b141.EVMVMBridgedToken_c52e820d2d6207d18667a97e2c6ac22eb26e803c.Vault' --network mainnet --signer mainnet-admin
# flow transactions send ./cadence/transactions/mocks/swapper/set_liquidity_connector.cdc /storage/EVMVMBridgedToken_4154d5b0e2931a0a1e5b733f19161aa7d2fc4b95Vault --network mainnet --signer mainnet-admin
#
# add TracerStrategy as supported Strategy with the ability to initialize when new YieldVaults are created


# Setup UniV3 path tauUSDFv -> USDF -> WFLOW
flow transactions send ./cadence/transactions/flow-yield-vaults/admin/upsert_musdf_config.cdc \
'A.1654653399040a61.FlowToken.Vault' \
"0xc52E820d2D6207D18667a97e2c6Ac22eB26E803c" \
'["0xc52E820d2D6207D18667a97e2c6Ac22eB26E803c","0x2aaBea2058b5aC2D339b163C6Ab6f2b6d53aabED","0xd3bF53DAC106A0290B0483EcBC89d40FcC961f3e"]' \
'[100,3000]' \
--network mainnet \
--signer mainnet-admin


# Setup UniV3 path tauUSDFv -> USDF -> WBTC
flow transactions send ./cadence/transactions/flow-yield-vaults/admin/upsert_musdf_config.cdc \
'A.1e4aa0b87d10b141.EVMVMBridgedToken_717dae2baf7656be9a9b01dee31d571a9d4c9579.Vault' \
"0xc52E820d2D6207D18667a97e2c6Ac22eB26E803c" \
'["0xc52E820d2D6207D18667a97e2c6Ac22eB26E803c","0x2aaBea2058b5aC2D339b163C6Ab6f2b6d53aabED","0x717DAE2BaF7656BE9a9B01deE31d571a9d4c9579"]' \
'[100,3000]' \
--network mainnet \
--signer mainnet-admin

# Setup UniV3 path tauUSDFv -> USDF -> WETH
flow transactions send ./cadence/transactions/flow-yield-vaults/admin/upsert_musdf_config.cdc \
'A.1e4aa0b87d10b141.EVMVMBridgedToken_2f6f07cdcf3588944bf4c42ac74ff24bf56e7590.Vault' \
"0xc52E820d2D6207D18667a97e2c6Ac22eB26E803c" \
'["0xc52E820d2D6207D18667a97e2c6Ac22eB26E803c","0x2aaBea2058b5aC2D339b163C6Ab6f2b6d53aabED","0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590"]' \
'[100,3000]' \
--network mainnet \
--signer mainnet-admin

#
# add mUSDFStrategy as supported Strategy with the ability to initialize when new YieldVaults are created
flow transactions send ./cadence/transactions/flow-yield-vaults/admin/add_strategy_composer.cdc \
'A.b1d63873c3cc9f79.FlowYieldVaultsStrategies.mUSDCStrategy' \
'A.b1d63873c3cc9f79.FlowYieldVaultsStrategies.mUSDCStrategyComposer' \
/storage/FlowYieldVaultsStrategyComposerIssuer_0xb1d63873c3cc9f79 \
'A.b1d63873c3cc9f79.FlowYieldVaultsStrategiesV1_1.mUSDFStrategy' \
'A.b1d63873c3cc9f79.FlowYieldVaultsStrategiesV1_1.mUSDFStrategyComposer' \
/storage/FlowYieldVaultsStrategyV1_1ComposerIssuer_0xb1d63873c3cc9f79 \
--network mainnet \
--signer mainnet-admin

Expand Down Expand Up @@ -128,31 +216,50 @@ flow transactions send ./lib/FlowCreditMarket/cadence/tests/transactions/flow-cr
# sanity test
# flow transactions send ./cadence/transactions/flow-yield-vaults/admin/grant_beta.cdc \
# --authorizer mainnet-admin,<TEST_USER> \
# --proposer <TEST_USER> \
# --payer mainnet-admin \
# --network mainnet
# --network mainnet \
# --proposer <TEST_USER>

# test FlowYieldVault strategy

# flow transactions send ./cadence/transactions/flow-yield-vaults/create_yield_vault.cdc \
# A.b1d63873c3cc9f79.FlowYieldVaultsStrategies.mUSDCStrategy \
# A.1654653399040a61.FlowToken.Vault \
# 1.0 \
# --signer <TEST_USER> \
# --compute-limit 9999 \
# --network mainnet
# --network mainnet \
# --signer <TEST_USER>
#
#
# WBTC (BTCf)
# flow transactions send ./cadence/transactions/flow-yield-vaults/create_yield_vault.cdc \
# A.b1d63873c3cc9f79.FlowYieldVaultsStrategiesV1_1.mUSDFStrategy \
# A.1e4aa0b87d10b141.EVMVMBridgedToken_717dae2baf7656be9a9b01dee31d571a9d4c9579.Vault \
# 0.0000001 \
# --compute-limit 9999 \
# --network mainnet \
# --signer <TEST_USER>
#
# WETH (ETHf)
# flow transactions send ./cadence/transactions/flow-yield-vaults/create_yield_vault.cdc \
# A.b1d63873c3cc9f79.FlowYieldVaultsStrategiesV1_1.mUSDFStrategy \
# A.1e4aa0b87d10b141.EVMVMBridgedToken_2f6f07cdcf3588944bf4c42ac74ff24bf56e7590.Vault \
# 0.00001 \
# --compute-limit 9999 \
# --network mainnet \
# --signer <TEST_USER>
#
#

# test PEAK MONEY strategy
#
# WFLOW
# flow transactions send ./cadence/transactions/flow-yield-vaults/create_yield_vault.cdc \
# A.b1d63873c3cc9f79.PMStrategiesV1.syWFLOWvStrategy \
# A.1654653399040a61.FlowToken.Vault \
# 1.0 \
# --signer <TEST_USER> \
# --compute-limit 9999 \
# --network mainnet
# --network mainnet \
# --signer <TEST_USER>
#
# PYUSD0
# flow transactions send ./cadence/transactions/flow-yield-vaults/create_yield_vault.cdc \
Expand Down
Loading