From 4e775fd3259964a278b7783f2f67e36b3fef7537 Mon Sep 17 00:00:00 2001 From: YBM <31329384+yan-man@users.noreply.github.com> Date: Wed, 10 Dec 2025 20:45:53 -0600 Subject: [PATCH 1/4] test: base tests for param registry updates; first update --- tests/horizon/ParameterRegistryUpdate.t.sol | 74 +++++++++++++++ .../horizon/ParameterRegistryUpdateBase.t.sol | 95 +++++++++++++++++++ 2 files changed, 169 insertions(+) create mode 100644 tests/horizon/ParameterRegistryUpdate.t.sol create mode 100644 tests/horizon/ParameterRegistryUpdateBase.t.sol diff --git a/tests/horizon/ParameterRegistryUpdate.t.sol b/tests/horizon/ParameterRegistryUpdate.t.sol new file mode 100644 index 00000000..3b7880b7 --- /dev/null +++ b/tests/horizon/ParameterRegistryUpdate.t.sol @@ -0,0 +1,74 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import 'tests/horizon/ParameterRegistryUpdateBase.t.sol'; + +contract ParameterRegistryUpdateTest is ParameterRegistryUpdateBaseTest { + function setUp() public override { + super.setUp(); + vm.createSelectFork('mainnet'); + } + + function _loadExpectedParams() internal override { + expectedParams[AaveV3EthereumHorizonCustom.USYC_UNDERLYING] = ParamRegistryFields({ + maxExpectedApy: 375, + upperBoundTolerance: 10, + lowerBoundTolerance: 5, + maxDiscount: 10, + lookbackWindowSize: 4, + isUpperBoundEnabled: true, + isLowerBoundEnabled: true, + isActionTakingEnabled: false + }); + expectedParams[AaveV3EthereumHorizonCustom.JAAA_UNDERLYING] = ParamRegistryFields({ + maxExpectedApy: 500, + upperBoundTolerance: 25, + lowerBoundTolerance: 10, + maxDiscount: 75, + lookbackWindowSize: 4, + isUpperBoundEnabled: true, + isLowerBoundEnabled: true, + isActionTakingEnabled: false + }); + expectedParams[AaveV3EthereumHorizonCustom.JTRSY_UNDERLYING] = ParamRegistryFields({ + maxExpectedApy: 375, + upperBoundTolerance: 10, + lowerBoundTolerance: 5, + maxDiscount: 10, + lookbackWindowSize: 4, + isUpperBoundEnabled: true, + isLowerBoundEnabled: true, + isActionTakingEnabled: false + }); + expectedParams[AaveV3EthereumHorizonCustom.USTB_UNDERLYING] = ParamRegistryFields({ + maxExpectedApy: 375, + upperBoundTolerance: 10, + lowerBoundTolerance: 5, + maxDiscount: 10, + lookbackWindowSize: 4, + isUpperBoundEnabled: true, + isLowerBoundEnabled: true, + isActionTakingEnabled: false + }); + expectedParams[AaveV3EthereumHorizonCustom.USCC_UNDERLYING] = ParamRegistryFields({ + maxExpectedApy: 750, + upperBoundTolerance: 50, + lowerBoundTolerance: 10, + maxDiscount: 40, + lookbackWindowSize: 4, + isUpperBoundEnabled: true, + isLowerBoundEnabled: true, + isActionTakingEnabled: false + }); + expectedParams[AaveV3EthereumHorizonCustom.VBILL_UNDERLYING] = ParamRegistryFields({ + maxExpectedApy: 0, + upperBoundTolerance: 10, + lowerBoundTolerance: 10, + maxDiscount: 0, + lookbackWindowSize: 4, + isUpperBoundEnabled: true, + isLowerBoundEnabled: true, + isActionTakingEnabled: false + }); + } +} diff --git a/tests/horizon/ParameterRegistryUpdateBase.t.sol b/tests/horizon/ParameterRegistryUpdateBase.t.sol new file mode 100644 index 00000000..9b48949e --- /dev/null +++ b/tests/horizon/ParameterRegistryUpdateBase.t.sol @@ -0,0 +1,95 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {console2 as console} from 'forge-std/console2.sol'; +import {Test, Vm} from 'forge-std/Test.sol'; +import {AaveV3EthereumHorizonCustom} from './utils/AaveV3EthereumHorizonCustom.sol'; +import {IRwaOracleParameterRegistry} from './dependencies/IRwaOracleParameterRegistry.sol'; + +abstract contract ParameterRegistryUpdateBaseTest is Test { + struct ParamRegistryFields { + uint64 maxExpectedApy; + uint32 upperBoundTolerance; + uint32 lowerBoundTolerance; + uint32 maxDiscount; + uint80 lookbackWindowSize; + bool isUpperBoundEnabled; + bool isLowerBoundEnabled; + bool isActionTakingEnabled; + } + IRwaOracleParameterRegistry public parameterRegistry; + mapping(address => ParamRegistryFields) public expectedParams; + + function setUp() public virtual { + parameterRegistry = IRwaOracleParameterRegistry( + AaveV3EthereumHorizonCustom.RWA_ORACLE_PARAMS_REGISTRY + ); + _loadExpectedParams(); + } + + function test_parameterRegistryUpdate_USTB() public view { + _assertParameters( + AaveV3EthereumHorizonCustom.USTB_UNDERLYING, + expectedParams[AaveV3EthereumHorizonCustom.USTB_UNDERLYING] + ); + } + + function test_parameterRegistryUpdate_USCC() public view { + _assertParameters( + AaveV3EthereumHorizonCustom.USCC_UNDERLYING, + expectedParams[AaveV3EthereumHorizonCustom.USCC_UNDERLYING] + ); + } + + function test_parameterRegistryUpdate_USYC() public view { + _assertParameters( + AaveV3EthereumHorizonCustom.USYC_UNDERLYING, + expectedParams[AaveV3EthereumHorizonCustom.USYC_UNDERLYING] + ); + } + + function test_parameterRegistryUpdate_JAAA() public view { + _assertParameters( + AaveV3EthereumHorizonCustom.JAAA_UNDERLYING, + expectedParams[AaveV3EthereumHorizonCustom.JAAA_UNDERLYING] + ); + } + + function test_parameterRegistryUpdate_JTRSY() public view { + _assertParameters( + AaveV3EthereumHorizonCustom.JTRSY_UNDERLYING, + expectedParams[AaveV3EthereumHorizonCustom.JTRSY_UNDERLYING] + ); + } + + function test_parameterRegistryUpdate_VBILL() public view { + _assertParameters( + AaveV3EthereumHorizonCustom.VBILL_UNDERLYING, + expectedParams[AaveV3EthereumHorizonCustom.VBILL_UNDERLYING] + ); + } + + function _loadExpectedParams() internal virtual {} + + function _assertParameters(address asset, ParamRegistryFields memory expectedParam) public view { + ( + uint64 maxExpectedApy, + uint32 upperBoundTolerance, + uint32 lowerBoundTolerance, + uint32 maxDiscount, + uint80 lookbackWindowSize, + bool isUpperBoundEnabled, + bool isLowerBoundEnabled, + bool isActionTakingEnabled + ) = parameterRegistry.getParametersForAsset(asset); + + assertEq(maxExpectedApy, expectedParam.maxExpectedApy, 'maxExpectedApy'); + assertEq(upperBoundTolerance, expectedParam.upperBoundTolerance, 'upperBoundTolerance'); + assertEq(lowerBoundTolerance, expectedParam.lowerBoundTolerance, 'lowerBoundTolerance'); + assertEq(maxDiscount, expectedParam.maxDiscount, 'maxDiscount'); + assertEq(lookbackWindowSize, expectedParam.lookbackWindowSize, 'lookbackWindowSize'); + assertEq(isUpperBoundEnabled, expectedParam.isUpperBoundEnabled, 'isUpperBoundEnabled'); + assertEq(isLowerBoundEnabled, expectedParam.isLowerBoundEnabled, 'isLowerBoundEnabled'); + assertEq(isActionTakingEnabled, expectedParam.isActionTakingEnabled, 'isActionTakingEnabled'); + } +} From a3cf10817ef85c14cead97aeedc3757006d546ec Mon Sep 17 00:00:00 2001 From: YBM <31329384+yan-man@users.noreply.github.com> Date: Wed, 10 Dec 2025 21:08:24 -0600 Subject: [PATCH 2/4] fix: skip test until after execution --- tests/horizon/ParameterRegistryUpdate.t.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/horizon/ParameterRegistryUpdate.t.sol b/tests/horizon/ParameterRegistryUpdate.t.sol index 3b7880b7..c5ec92b2 100644 --- a/tests/horizon/ParameterRegistryUpdate.t.sol +++ b/tests/horizon/ParameterRegistryUpdate.t.sol @@ -5,6 +5,7 @@ import 'tests/horizon/ParameterRegistryUpdateBase.t.sol'; contract ParameterRegistryUpdateTest is ParameterRegistryUpdateBaseTest { function setUp() public override { + vm.skip('post tx execution'); super.setUp(); vm.createSelectFork('mainnet'); } From e483fcb0c001663ba1e11df64eb27f22371e35cc Mon Sep 17 00:00:00 2001 From: YBM <31329384+yan-man@users.noreply.github.com> Date: Wed, 10 Dec 2025 21:11:51 -0600 Subject: [PATCH 3/4] fix: skip test --- tests/horizon/ParameterRegistryUpdate.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/horizon/ParameterRegistryUpdate.t.sol b/tests/horizon/ParameterRegistryUpdate.t.sol index c5ec92b2..2cef4db1 100644 --- a/tests/horizon/ParameterRegistryUpdate.t.sol +++ b/tests/horizon/ParameterRegistryUpdate.t.sol @@ -5,7 +5,7 @@ import 'tests/horizon/ParameterRegistryUpdateBase.t.sol'; contract ParameterRegistryUpdateTest is ParameterRegistryUpdateBaseTest { function setUp() public override { - vm.skip('post tx execution'); + vm.skip(true, 'post tx execution'); super.setUp(); vm.createSelectFork('mainnet'); } From 4b574672f4911a291c1726c299be572d58b79d93 Mon Sep 17 00:00:00 2001 From: YBM <31329384+yan-man@users.noreply.github.com> Date: Thu, 11 Dec 2025 11:48:44 -0600 Subject: [PATCH 4/4] test: mainnet fork test --- tests/horizon/ParameterRegistryUpdate.t.sol | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/horizon/ParameterRegistryUpdate.t.sol b/tests/horizon/ParameterRegistryUpdate.t.sol index 2cef4db1..84e26e6f 100644 --- a/tests/horizon/ParameterRegistryUpdate.t.sol +++ b/tests/horizon/ParameterRegistryUpdate.t.sol @@ -5,9 +5,8 @@ import 'tests/horizon/ParameterRegistryUpdateBase.t.sol'; contract ParameterRegistryUpdateTest is ParameterRegistryUpdateBaseTest { function setUp() public override { - vm.skip(true, 'post tx execution'); super.setUp(); - vm.createSelectFork('mainnet'); + vm.createSelectFork('mainnet', 23990951); } function _loadExpectedParams() internal override {