AaveDiscountRateAgent
Function index9 functions
The AaveDiscountRateAgent validates a PendleDiscountRateUpdate stored in RiskOracle. It resolves the PT's active price source through the configured Aave Oracle, checks the proposed rate against the RangeValidationModule, and, when called by AgentHub, writes the new annual discount rate to the Pendle price-cap adapter.
| Property | Value |
|---|---|
| AgentHub ID | 0 |
| Execution access | inject can only be called by the immutable AgentHub |
Example outputs
Example outputs remain TODO until a production deployment is published and can be queried.
DISCOUNT_AGENT=<discount-rate-agent-address>
AGENT_HUB=<agent-hub-address>
MARKET=<pt-market-address>Risk update input
Both validate and inject accept the RiskOracle update tuple:
| Field | Type | Discount-rate interpretation |
|---|---|---|
timestamp | uint256 | Publication time checked by AgentHub |
newValue | bytes | Encoded unsigned annual discount rate; at most 32 bytes |
referenceId | string | Calculation reference |
previousValue | bytes | Previous oracle value |
updateType | string | Must equal getUpdateType() |
updateId | uint256 | Replay-protected by AgentHub |
market | address | PT asset whose Aave price source is updated |
additionalData | bytes | Audit context; not decoded by the agent |
Dependencies and identity
AAVE_ORACLE
AaveDiscountRateAgent.AAVE_ORACLE() → address0x13f8bf67Returns the current aave oracle.
>>> AaveDiscountRateAgent.AAVE_ORACLE()
TODOAGENT_HUB
AaveDiscountRateAgent.AGENT_HUB() → address0x625cbff2Returns the current agent hub.
>>> AaveDiscountRateAgent.AGENT_HUB()
TODOPOOL
AaveDiscountRateAgent.POOL() → address0x7535d246Returns the current pool.
>>> AaveDiscountRateAgent.POOL()
TODORANGE_VALIDATION_MODULE
AaveDiscountRateAgent.RANGE_VALIDATION_MODULE() → address0xaea8e856Returns the current range validation module.
>>> AaveDiscountRateAgent.RANGE_VALIDATION_MODULE()
TODOUPDATE_TYPE
AaveDiscountRateAgent.UPDATE_TYPE() → bytes320x8111ad51Returns the current update type.
>>> AaveDiscountRateAgent.UPDATE_TYPE()
TODOgetUpdateType
AaveDiscountRateAgent.getUpdateType() → string0x2161bc0bReturns the update type handled by the agent.
>>> AaveDiscountRateAgent.getUpdateType()
TODOgetMarkets
AaveDiscountRateAgent.getMarkets(uint256) → address[]0x333c8403Returns the markets supplied by the agent.
| Input | Type | Description |
|---|---|---|
agentId | uint256 | Agent id. |
>>> AaveDiscountRateAgent.getMarkets(agentId)
TODOValidation
validate
AaveDiscountRateAgent.validate(uint256,bytes,(uint256,bytes,string,bytes,string,uint256,address,bytes)) → bool0x041b01b3Returns whether the proposed update satisfies the agent constraints.
| Input | Type | Description |
|---|---|---|
agentId | uint256 | Agent ID. |
context | bytes | Context. |
riskOracleUpdate | (uint256,bytes,string,bytes,string,uint256,address,bytes) | RiskOracle update. |
>>> AaveDiscountRateAgent.validate(agentId, context, riskOracleUpdate)
TODOvalidate rejects zero rates, no-op updates, mismatched update types, and movements outside the configured range.
Execution
inject
AaveDiscountRateAgent.inject(uint256,bytes,(uint256,bytes,string,bytes,string,uint256,address,bytes)) → void0x96e17302Applies an eligible risk update to the configured protocol target.
| Input | Type | Description |
|---|---|---|
agentId | uint256 | Agent ID. |
agentContext | bytes | Agent context. |
riskParameterUpdate | (uint256,bytes,string,bytes,string,uint256,address,bytes) | And RiskParameterUpdate. |
>>> AaveDiscountRateAgent.inject(agentId, agentContext, riskParameterUpdate)
TODOThe agent ignores agentId and agentContext for discount-rate execution. It resolves update.market through AAVE_ORACLE.getSourceOfAsset, then calls setDiscountRatePerYear on that adapter with the decoded newValue.
Only AGENT_HUB may call this function. Calling it directly from an EOA or the router reverts.
In normal operation, the router calls AgentHub.check and AgentHub.execute; the hub fetches the latest update from RiskOracle and calls inject only after all hub and agent validations pass.