Skip to content

feat: onboard PT-sUSDe-22OCT2026 to the LlamaRisk PT Risk Oracle on Plasma - #1208

Merged
DhairyaSethi merged 8 commits into
aave-dao:mainfrom
llama-risk:feat/onboard-pt-susde-22oct2026-oracle-plasma
Sep 29, 2026
Merged

DhairyaSethi merged 8 commits into
aave-dao:mainfrom
llama-risk:feat/onboard-pt-susde-22oct2026-oracle-plasma

Conversation

@samtin0x

@samtin0x samtin0x commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Context

This payload onboards PT-sUSDe-22OCT2026 to the LlamaRisk PT Risk Oracle system on Plasma. It registers the predeployed Aave discount-rate and eMode agents in MiscPlasma.AGENT_HUB, grants the permissions required to apply updates, and configures the maximum change accepted per injection.

Both agents are verified deployments of the official aave-dao/aave-risk-agents implementations. Their addresses, the LlamaRisk RiskOracle, and the Router are sourced from the Aave address book.

Reusable update types, delays, expiration periods, and range limits are defined in src/helpers/agent-hub/Configs.sol. Shared agent registration, role-granting, and range-configuration logic lives in AgentHubAgentActivationPayload.sol. Both helpers merged with the Ethereum activation (#1184) and are reused unchanged.

Summary

  • Register the predeployed AaveDiscountRateAgent and AaveEModeAgent sourced from MiscPlasma.
  • Register both agents against MiscPlasma.LLAMARISK_RISK_ORACLE, using the IDs returned by registerAgent rather than predicting them.
  • Grant both agents RISK_ADMIN.
  • Restrict the discount agent to PT-sUSDe-22OCT2026 and the eMode agent to categories 25 and 26.
  • Configure absolute per-injection bounds for every parameter the agents can update.
  • Leave CRE workflow deployment and Router route registration to the post-AIP activation process described below.

Payload actions

  1. Register MiscPlasma.LLAMARISK_PT_DISCOUNT_RATE_AGENT for PendleDiscountRateUpdate, with PT-sUSDe-22OCT2026 as its only allowed market, a 2-day minimum delay, and a 2-day expiration period.
  2. Register MiscPlasma.LLAMARISK_PT_EMODE_AGENT for EModeCategoryUpdate, with eMode categories 25 and 26 as its only allowed markets, a 3-day minimum delay, a 3-day expiration period, and AaveV3Plasma.CONFIG_ENGINE encoded as its context.
  3. Grant both predeployed agents RISK_ADMIN through AaveV3Plasma.ACL_MANAGER.
  4. Configure the following absolute maximum changes in MiscPlasma.RANGE_VALIDATION_MODULE:
Agent Parameter Maximum change per injection
Discount rate PendleDiscountRateUpdate 100 bps (1e16)
eMode EModeLTV 50 bps
eMode EModeLiquidationThreshold 50 bps
eMode EModeLiquidationBonus 50 bps

Both registrations use MiscPlasma.PROTOCOL_GUARDIAN as agent admin; the AgentHub itself is owned by GovernanceV3Plasma.EXECUTOR_LVL_1. Agent IDs are captured from registerAgent, so registrations occurring before execution cannot cause the payload to configure the wrong agents.

Agent compatibility

The predeployed AaveEModeAgent supplies isolated: EngineFlags.KEEP_CURRENT when constructing the six-field EModeCategoryUpdate expected by the live v3.7 ConfigEngine. This preserves the existing governance-configured isolation setting. The discount-rate agent is unaffected by the v3.7 change and calls setDiscountRatePerYear directly on the Pendle price-cap adapter.

Address-book dependencies

The payload imports the RiskOracle and both predeployed agents from MiscPlasma:

Both agents are deployed from aave-dao/aave-risk-agents@dec4cc7 using that repository's build settings, so their verified bytecode reproduces against origin.

No LlamaRisk contract addresses are hardcoded in the payload. The Router is used by the tests to publish RiskOracle updates through the authorized production path.

These constants land with aave-dao/aave-address-book#1581; this PR bumps the dependency once the release ships, which also unlocks compilation and the generated diffs/ report.

Post-AIP activation

This payload does not deploy CRE workflows or register Router routes. After the AIP executes, LlamaRisk will use the agent IDs assigned by the AgentHub to deploy and connect the production workflows. These operational steps are outside the scope of this payload.

Test plan

RPC_PLASMA=<plasma-rpc> \
FOUNDRY_SRC=src/20260925_AaveV3Plasma_Onboard_PTsUSDe22OCT2026_Oracle \
FOUNDRY_TEST=src/20260925_AaveV3Plasma_Onboard_PTsUSDe22OCT2026_Oracle \
FOUNDRY_PROFILE=test forge test --isolate \
  --match-path=src/20260925_AaveV3Plasma_Onboard_PTsUSDe22OCT2026_Oracle/AaveV3Plasma_Onboard_PTsUSDe22OCT2026_Oracle_20260925.t.sol -vv

The suite verifies:

  • both predeployed agents have bytecode and the expected immutable wiring;
  • the registered RiskOracle and update types;
  • RISK_ADMIN grants;
  • allowed PT/eMode markets, minimum delays, and ConfigEngine context;
  • all four range configurations;
  • successful end-to-end RiskOracle updates;
  • rejection of out-of-range updates;
  • successful default proposal execution; and
  • no unexpected Aave reserve configuration changes.

Refs #1184

Refs aave-dao/aave-address-book#1581

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
🌈Test Results Compiling 598 files with Solc 0.8.28 Solc 0.8.28 finished in 265.22s Compiler run successful with warnings: Warning (2018): Function state mutability can be restricted to view --> lib/aave-helpers/src/dependencies/v4/Helpers.sol:42:3: | 42 | function _makeSigner() internal returns (uint256 privateKey, address signer) { | ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
--> src/20260826_Multi_LowAdoptionAssetDeprecationOnAaveV3/AaveV3Arbitrum_LowAdoptionAssetDeprecationOnAaveV3_20260826.t.sol:41:3:
|
41 | function test_preExecutionReserveState() public {
| ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
--> src/20260826_Multi_LowAdoptionAssetDeprecationOnAaveV3/AaveV3Avalanche_LowAdoptionAssetDeprecationOnAaveV3_20260826.t.sol:41:3:
|
41 | function test_preExecutionReserveState() public {
| ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
--> src/20260826_Multi_LowAdoptionAssetDeprecationOnAaveV3/AaveV3BNB_LowAdoptionAssetDeprecationOnAaveV3_20260826.t.sol:41:3:
|
41 | function test_preExecutionReserveState() public {
| ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
--> src/20260826_Multi_LowAdoptionAssetDeprecationOnAaveV3/AaveV3Base_LowAdoptionAssetDeprecationOnAaveV3_20260826.t.sol:41:3:
|
41 | function test_preExecutionReserveState() public {
| ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
--> src/20260826_Multi_LowAdoptionAssetDeprecationOnAaveV3/AaveV3EthereumLido_LowAdoptionAssetDeprecationOnAaveV3_20260826.t.sol:43:3:
|
43 | function test_preExecutionReserveState() public {
| ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
--> src/20260826_Multi_LowAdoptionAssetDeprecationOnAaveV3/AaveV3Ethereum_LowAdoptionAssetDeprecationOnAaveV3Part2_20260826.t.sol:41:3:
|
41 | function test_preExecutionReserveState() public {
| ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
--> src/20260826_Multi_LowAdoptionAssetDeprecationOnAaveV3/AaveV3Ethereum_LowAdoptionAssetDeprecationOnAaveV3_20260826.t.sol:41:3:
|
41 | function test_preExecutionReserveState() public {
| ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
--> src/20260826_Multi_LowAdoptionAssetDeprecationOnAaveV3/AaveV3Gnosis_LowAdoptionAssetDeprecationOnAaveV3_20260826.t.sol:41:3:
|
41 | function test_preExecutionReserveState() public {
| ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
--> src/20260826_Multi_LowAdoptionAssetDeprecationOnAaveV3/AaveV3MegaEth_LowAdoptionAssetDeprecationOnAaveV3_20260826.t.sol:41:3:
|
41 | function test_preExecutionReserveState() public {
| ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
--> src/20260826_Multi_LowAdoptionAssetDeprecationOnAaveV3/AaveV3Metis_LowAdoptionAssetDeprecationOnAaveV3_20260826.t.sol:41:3:
|
41 | function test_preExecutionReserveState() public {
| ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
--> src/20260826_Multi_LowAdoptionAssetDeprecationOnAaveV3/AaveV3Optimism_LowAdoptionAssetDeprecationOnAaveV3_20260826.t.sol:41:3:
|
41 | function test_preExecutionReserveState() public {
| ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
--> src/20260826_Multi_LowAdoptionAssetDeprecationOnAaveV3/AaveV3Plasma_LowAdoptionAssetDeprecationOnAaveV3_20260826.t.sol:41:3:
|
41 | function test_preExecutionReserveState() public {
| ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
--> src/20260826_Multi_LowAdoptionAssetDeprecationOnAaveV3/AaveV3Polygon_LowAdoptionAssetDeprecationOnAaveV3_20260826.t.sol:41:3:
|
41 | function test_preExecutionReserveState() public {
| ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
--> src/20260826_Multi_LowAdoptionAssetDeprecationOnAaveV3/AaveV3Scroll_LowAdoptionAssetDeprecationOnAaveV3_20260826.t.sol:41:3:
|
41 | function test_preExecutionReserveState() public {
| ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
--> src/20260826_Multi_LowAdoptionAssetDeprecationOnAaveV3/AaveV3Soneium_LowAdoptionAssetDeprecationOnAaveV3_20260826.t.sol:41:3:
|
41 | function test_preExecutionReserveState() public {
| ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
--> src/20260826_Multi_LowAdoptionAssetDeprecationOnAaveV3/AaveV3Sonic_LowAdoptionAssetDeprecationOnAaveV3_20260826.t.sol:41:3:
|
41 | function test_preExecutionReserveState() public {
| ^ (Relevant source part starts here and spans across multiple lines).

Warning (4591): There are more than 256 warnings. Ignoring the rest.

Ran 7 tests for src/20260925_AaveV3Plasma_Onboard_PTsUSDe22OCT2026_Oracle/AaveV3Plasma_Onboard_PTsUSDe22OCT2026_Oracle_20260925.t.sol:AaveV3Plasma_Onboard_PTsUSDe22OCT2026_Oracle_20260925_Test
[PASS] test_agentsPredeployedAndWired() (gas: 925137)
[PASS] test_agentsRegisteredAndRiskAdminGranted() (gas: 1235397)
[PASS] test_defaultProposalExecution() (gas: 32219219)
Logs:
0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb
0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34
0x211Cc4DD073734dA055fbF44a2b4667d5E5fE5d2
0x1B64B9025EEbb9A6239575dF9Ea4b9Ac46D4d193
0xA3D68b74bF0528fdD07263c60d6488749044914b
0x9895D81bB462A195b4922ED7De0e3ACD007c32CB
0x93B544c330F60A2aa05ceD87aEEffB8D38FD8c9a
0x02FCC4989B4C9D435b7ceD3fE1Ba4CF77BBb5Dd8
0xe48D935e6C9e735463ccCf29a7F11e32bC09136E
0xe561FE05C39075312Aa9Bc6af79DdaE981461359
0xC4374775489CB9C56003BF2C9b12495fC64F0771
0x6100E367285b01F48D07953803A2d8dCA5D19873
0xab509448ad489e2E1341e25CC500f2596464Cc82
0x54Dc267be2839303ff1e323584A16e86CeC4Aa44
0xb77E872A68C62CfC0dFb02C067Ecc3DA23B4bbf3
0x23B17d3944742ACe3d0C71586FcB320d1e4a1Ed2
0x30559E3d35e33AB69399a3fe9F383d32bd3c016E
0xf7fB83435F455Bd970F2D9f943f4eECE1941b3e9
E2E: Collateral USDT0, TestAsset USDT0
SUPPLY: USDT0, Amount: 100025006251
SUPPLY: USDT0, Amount: 10002500625
WITHDRAW: USDT0, Amount: 5001250312
WITHDRAW: USDT0, Amount: 5001250312
BORROW: USDT0, Amount 10002500625
REPAY: USDT0, Amount: 10002500626
REPAY: USDT0, Amount: 10002500626
LIQUIDATE: USDT0, Amount: 115792089237316195423570985008687907853269984665640564039457584007913129639935, Debt Amount: 10002500626
LIQUIDATE: USDT0, Amount: 115792089237316195423570985008687907853269984665640564039457584007913129639935, Debt Amount: 10002500626
FLASH LOAN: USDT0, Amount: 10002500625
FLASH LOAN: USDT0, Amount: 10002500625
E2E: Collateral USDT0, TestAsset USDe
SUPPLY: USDT0, Amount: 100025006251
SUPPLY: USDe, Amount: 10002500625156289072268
WITHDRAW: USDe, Amount: 5001250312578144536134
WITHDRAW: USDe, Amount: 5001250312578144536133
BORROW: USDe, Amount 10002500625156289072268
REPAY: USDe, Amount: 10002500625156289072269
REPAY: USDe, Amount: 10002500625156289072269
LIQUIDATE: USDe, Amount: 115792089237316195423570985008687907853269984665640564039457584007913129639935, Debt Amount: 10002500625156289072269
LIQUIDATE: USDe, Amount: 115792089237316195423570985008687907853269984665640564039457584007913129639935, Debt Amount: 10002500625156289072269
FLASH LOAN: USDe, Amount: 10002500625156289072268
FLASH LOAN: USDe, Amount: 10002500625156289072268
E2E: Collateral sUSDe, TestAsset USDT0
SUPPLY: sUSDe, Amount: 80007158400476407425125
SUPPLY: USDT0, Amount: 10002500625
WITHDRAW: USDT0, Amount: 5001250312
WITHDRAW: USDT0, Amount: 5001250312
BORROW: USDT0, Amount 10002500625
REPAY: USDT0, Amount: 10002500626
REPAY: USDT0, Amount: 10002500626
LIQUIDATE: USDT0, Amount: 115792089237316195423570985008687907853269984665640564039457584007913129639935, Debt Amount: 10002500626
LIQUIDATE: USDT0, Amount: 115792089237316195423570985008687907853269984665640564039457584007913129639935, Debt Amount: 10002500626
FLASH LOAN: USDT0, Amount: 10002500625
FLASH LOAN: USDT0, Amount: 10002500625
E2E: Collateral XAUt0, TestAsset USDT0
SUPPLY: XAUt0, Amount: 24106086
SUPPLY: USDT0, Amount: 10002500625
WITHDRAW: USDT0, Amount: 5001250312
WITHDRAW: USDT0, Amount: 5001250312
BORROW: USDT0, Amount 10002500625
REPAY: USDT0, Amount: 10002500626
REPAY: USDT0, Amount: 10002500626
LIQUIDATE: USDT0, Amount: 115792089237316195423570985008687907853269984665640564039457584007913129639935, Debt Amount: 10002500626
LIQUIDATE: USDT0, Amount: 115792089237316195423570985008687907853269984665640564039457584007913129639935, Debt Amount: 10002500626
FLASH LOAN: USDT0, Amount: 10002500625
FLASH LOAN: USDT0, Amount: 10002500625
E2E: TestAsset weETH SKIPPED
E2E: TestAsset WETH SKIPPED
E2E: TestAsset PT-USDe-15JAN2026 SKIPPED
E2E: TestAsset PT-sUSDE-15JAN2026 SKIPPED
E2E: TestAsset wstETH SKIPPED
E2E: TestAsset wrsETH SKIPPED
E2E: Collateral syrupUSDT, TestAsset USDT0
SUPPLY: syrupUSDT, Amount: 87347879736
SUPPLY: USDT0, Amount: 10002500625
WITHDRAW: USDT0, Amount: 5001250312
WITHDRAW: USDT0, Amount: 5001250312
BORROW: USDT0, Amount 10002500625
REPAY: USDT0, Amount: 10002500626
REPAY: USDT0, Amount: 10002500626
LIQUIDATE: USDT0, Amount: 115792089237316195423570985008687907853269984665640564039457584007913129639935, Debt Amount: 10002500626
LIQUIDATE: USDT0, Amount: 115792089237316195423570985008687907853269984665640564039457584007913129639935, Debt Amount: 10002500626
FLASH LOAN: USDT0, Amount: 10002500625
FLASH LOAN: USDT0, Amount: 10002500625
E2E: Collateral WXPL, TestAsset USDT0
SUPPLY: WXPL, Amount: 985763796405077156718108
SUPPLY: USDT0, Amount: 10002500625
WITHDRAW: USDT0, Amount: 5001250312
WITHDRAW: USDT0, Amount: 5001250312
FLASH LOAN: USDT0, Amount: 10002500625
E2E: TestAsset PT-sUSDE-9APR2026 SKIPPED
E2E: TestAsset PT-USDe-9APR2026 SKIPPED
E2E: Collateral USDT0, TestAsset GHO
SUPPLY: USDT0, Amount: 100025006251
SUPPLY: GHO, Amount: 10000000000000000000000
WITHDRAW: GHO, Amount: 5000000000000000000000
WITHDRAW: GHO, Amount: 4999999999999999999998
BORROW: GHO, Amount 10000000000000000000000
REPAY: GHO, Amount: 10000000000000000000001
REPAY: GHO, Amount: 10000000000000000000001
LIQUIDATE: GHO, Amount: 115792089237316195423570985008687907853269984665640564039457584007913129639935, Debt Amount: 10000000000000000000001
LIQUIDATE: GHO, Amount: 115792089237316195423570985008687907853269984665640564039457584007913129639935, Debt Amount: 10000000000000000000001
FLASH LOAN: GHO, Amount: 10000000000000000000000
FLASH LOAN: GHO, Amount: 10000000000000000000000
E2E: TestAsset PT-USDe-18JUN2026 SKIPPED
E2E: TestAsset PT-sUSDE-18JUN2026 SKIPPED
E2E: Collateral PT-sUSDE-22OCT2026, TestAsset USDT0
SUPPLY: PT-sUSDE-22OCT2026, Amount: 100282802517238739106216
SUPPLY: USDT0, Amount: 10002500625
WITHDRAW: USDT0, Amount: 5001250312
WITHDRAW: USDT0, Amount: 5001250312
BORROW: USDT0, Amount 10002500625
REPAY: USDT0, Amount: 10002500626
REPAY: USDT0, Amount: 10002500626
LIQUIDATE: USDT0, Amount: 115792089237316195423570985008687907853269984665640564039457584007913129639935, Debt Amount: 10002500626
LIQUIDATE: USDT0, Amount: 115792089237316195423570985008687907853269984665640564039457584007913129639935, Debt Amount: 10002500626
FLASH LOAN: USDT0, Amount: 10002500625
FLASH LOAN: USDT0, Amount: 10002500625

[PASS] test_e2eAgentsInjectRiskOracleUpdates() (gas: 2105958)
[PASS] test_rangeConfiguration() (gas: 856593)
[PASS] test_reserveConfigChanges() (gas: 31563350)
[PASS] test_revertOutOfRangeDiscountUpdate() (gas: 1268506)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 14.15s (27.95s CPU time)

Ran 1 test suite in 14.50s (14.15s CPU time): 7 tests passed, 0 failed, 0 skipped (7 total tests)

…sma)

Payload, fork tests, AIP text, deploy script and config, following the
merged Ethereum activation and reusing the src/helpers/agent-hub
helpers. Compiles once the aave-address-book release carrying the
MiscPlasma.LLAMARISK_* constants lands and the dependency is bumped.
@samtin0x
samtin0x force-pushed the feat/onboard-pt-susde-22oct2026-oracle-plasma branch from 40b42ef to 9fefa47 Compare September 25, 2026 13:32
@samtin0x
samtin0x marked this pull request as ready for review September 25, 2026 13:47
address public constant AGENT_ADMIN = MiscPlasma.PROTOCOL_GUARDIAN;

/// @dev No suffix is needed because this RiskOracle is dedicated to the LlamaGuard stack.
string public constant UPDATE_TYPE_SUFFIX = '';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this will be added for each onboarding onto LlamaGuard, pls move it to AgentHubAgentActivationPayload

@Kogaroshi Kogaroshi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • pull main and bum the aave-address-book to latest
  • fix any "TBD" left in the writeup
  • clean up unused imports

…k, no TBDs

Moves UPDATE_TYPE_SUFFIX into AgentHubAgentActivationPayload (both
payloads inherit the public getter), drops the unused GovernanceV3Plasma
import, bumps @aave-dao/aave-address-book to ^4.70.3, and replaces the
remaining writeup TBDs with links.
Generated against the address book at 28d6d020, the commit that adds the
MiscPlasma LLAMARISK_* constants. Agent ids land at 2 and 3 as predicted,
eModes 25 and 26, ranges absolute, and the reserve diff is empty.
Ships the MiscPlasma LLAMARISK_* constants. The Solidity side resolves
through lib/aave-helpers, which still pins the address book at f08dbd21,
so that submodule needs its own bump upstream before this compiles.
Picks up aave-helpers#829, which points its address-book submodule at
4.71.0 and so supplies the MiscPlasma LLAMARISK_* constants the payload
imports.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants