LlamaRisk

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.

PropertyValue
AgentHub ID0
Execution accessinject 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:

FieldTypeDiscount-rate interpretation
timestampuint256Publication time checked by AgentHub
newValuebytesEncoded unsigned annual discount rate; at most 32 bytes
referenceIdstringCalculation reference
previousValuebytesPrevious oracle value
updateTypestringMust equal getUpdateType()
updateIduint256Replay-protected by AgentHub
marketaddressPT asset whose Aave price source is updated
additionalDatabytesAudit context; not decoded by the agent

Dependencies and identity

AAVE_ORACLE

AaveDiscountRateAgent.AAVE_ORACLE() → address0x13f8bf67

Returns the current aave oracle.

Example
>>> AaveDiscountRateAgent.AAVE_ORACLE()
TODO

AGENT_HUB

AaveDiscountRateAgent.AGENT_HUB() → address0x625cbff2

Returns the current agent hub.

Example
>>> AaveDiscountRateAgent.AGENT_HUB()
TODO

POOL

AaveDiscountRateAgent.POOL() → address0x7535d246

Returns the current pool.

Example
>>> AaveDiscountRateAgent.POOL()
TODO

RANGE_VALIDATION_MODULE

AaveDiscountRateAgent.RANGE_VALIDATION_MODULE() → address0xaea8e856

Returns the current range validation module.

Example
>>> AaveDiscountRateAgent.RANGE_VALIDATION_MODULE()
TODO

UPDATE_TYPE

AaveDiscountRateAgent.UPDATE_TYPE() → bytes320x8111ad51

Returns the current update type.

Example
>>> AaveDiscountRateAgent.UPDATE_TYPE()
TODO

getUpdateType

AaveDiscountRateAgent.getUpdateType() → string0x2161bc0b

Returns the update type handled by the agent.

Example
>>> AaveDiscountRateAgent.getUpdateType()
TODO

getMarkets

AaveDiscountRateAgent.getMarkets(uint256) → address[]0x333c8403

Returns the markets supplied by the agent.

InputTypeDescription
agentIduint256Agent id.
Example
>>> AaveDiscountRateAgent.getMarkets(agentId)
TODO

Validation

validate

AaveDiscountRateAgent.validate(uint256,bytes,(uint256,bytes,string,bytes,string,uint256,address,bytes)) → bool0x041b01b3

Returns whether the proposed update satisfies the agent constraints.

InputTypeDescription
agentIduint256Agent ID.
contextbytesContext.
riskOracleUpdate(uint256,bytes,string,bytes,string,uint256,address,bytes)RiskOracle update.
Example
>>> AaveDiscountRateAgent.validate(agentId, context, riskOracleUpdate)
TODO

validate 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)) → void0x96e17302

Applies an eligible risk update to the configured protocol target.

InputTypeDescription
agentIduint256Agent ID.
agentContextbytesAgent context.
riskParameterUpdate(uint256,bytes,string,bytes,string,uint256,address,bytes)And RiskParameterUpdate.

Authorization: Immutable AGENT_HUB only

Example
>>> AaveDiscountRateAgent.inject(agentId, agentContext, riskParameterUpdate)
TODO

The 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.

On this page