LlamaRisk

LlamaGuardOracle (EMA)

Function index37 functions

The EMA LlamaGuardOracle stores the smoothed implied rate produced by the market-state workflow and routed through LlamaguardRiskOracleRouter. The discount-rate and risk-parameter workflows read this shared state; no AgentHub agent executes EMA updates against Aave.

PropertyValue
Access modelOpenZeppelin roles; router holds WRITER_ROLE

Example outputs

Example outputs remain TODO until a production deployment is published and can be queried.

EMA_ORACLE=<ema-oracle-address>
ROUTER=<router-address>
MARKET=<pt-market-address>

Update schemas

updateLatestRiskRoundData accepts:

FieldTypeMeaning
referenceIdstringCalculation reference
newValuebytesABI-encoded int256 EMA implied rate
updateTypestringMust be an authorized update type
additionalDatabytesEncoded EMA context consumed by downstream workflows
deadlineuint256Unix timestamp after which the write reverts

Historical reads return (timestamp, newValue, referenceId, previousValue, updateType, updateId, market, additionalData). The contract also exposes Chainlink Aggregator V2/V3-compatible round reads, with newValue decoded as the round answer.

For the PT workflow, additionalData is not arbitrary metadata: its ABI layout is part of the EMA update schema and is decoded by the downstream workflows.

Update publication and history

getLatestUpdateByParameterAndMarket

LlamaGuardOracle.getLatestUpdateByParameterAndMarket(string,address) → RiskParameterUpdate0x5decfee4

Returns the latest update for an update type and market.

InputTypeDescription
updateTypestringUpdate type.
marketaddressAuthorized market.
Example
>>> LlamaGuardOracle.getLatestUpdateByParameterAndMarket(updateType, market)
TODO

getUpdateById

LlamaGuardOracle.getUpdateById(uint256) → RiskParameterUpdate0x37759b9a

Returns the update stored under an update ID.

InputTypeDescription
updateIduint256Update ID.
Example
>>> LlamaGuardOracle.getUpdateById(updateId)
TODO

updateHistory

LlamaGuardOracle.updateHistory(uint256) → RiskParameterUpdate0x73ed7a90

Returns the update stored under an update ID.

InputTypeDescription
updateIduint256Update ID.
Example
>>> LlamaGuardOracle.updateHistory(updateId)
TODO

updateLatestRiskRoundData

LlamaGuardOracle.updateLatestRiskRoundData((string,bytes,string,bytes,uint256)) → void0x55ea1585

Stores an authorized risk update as the latest oracle round.

InputTypeDescription
input(string,bytes,string,bytes,uint256)Complete update tuple.

Authorization: WRITER_ROLE

Example
>>> LlamaGuardOracle.updateLatestRiskRoundData(input)
TODO

Aggregator interface

getLatestRoundId

LlamaGuardOracle.getLatestRoundId() → uint800x8c3b990b

Returns the latest oracle round ID.

Example
>>> LlamaGuardOracle.getLatestRoundId()
TODO

latestRoundData

LlamaGuardOracle.latestRoundData() → (uint80,int256,uint256,uint256,uint80)0xfeaf968c

Returns the current latest round data.

Example
>>> LlamaGuardOracle.latestRoundData()
TODO

getRoundData

LlamaGuardOracle.getRoundData(uint80) → (uint80,int256,uint256,uint256,uint80)0x9a6fc8f5

Returns the answer and timestamps recorded for a round.

InputTypeDescription
roundIduint80Round ID.
Example
>>> LlamaGuardOracle.getRoundData(roundId)
TODO

latestAnswer

LlamaGuardOracle.latestAnswer() → int2560x50d25bcd

Returns the current latest answer.

Example
>>> LlamaGuardOracle.latestAnswer()
TODO

latestTimestamp

LlamaGuardOracle.latestTimestamp() → uint2560x8205bf6a

Returns the current latest timestamp.

Example
>>> LlamaGuardOracle.latestTimestamp()
TODO

latestRound

LlamaGuardOracle.latestRound() → uint2560x668a0f02

Returns the current latest round.

Example
>>> LlamaGuardOracle.latestRound()
TODO

getAnswer

LlamaGuardOracle.getAnswer(uint256) → int2560xb5ab58dc

Returns the answer recorded for a round.

InputTypeDescription
roundIduint256Round ID.
Example
>>> LlamaGuardOracle.getAnswer(roundId)
TODO

getTimestamp

LlamaGuardOracle.getTimestamp(uint256) → uint2560xb633620c

Returns the timestamp recorded for a round.

InputTypeDescription
roundIduint256Round ID.
Example
>>> LlamaGuardOracle.getTimestamp(roundId)
TODO

decimals

LlamaGuardOracle.decimals() → uint80x313ce567

Returns the current decimals.

Example
>>> LlamaGuardOracle.decimals()
TODO

description

LlamaGuardOracle.description() → string0x7284e416

Returns the current description.

Example
>>> LlamaGuardOracle.description()
TODO

version

LlamaGuardOracle.version() → uint2560x54fd4d50

Returns the current version.

Example
>>> LlamaGuardOracle.version()
TODO

Update types and payloads

updateTypes

LlamaGuardOracle.updateTypes(uint256) → string0x023c8063

Returns the update type stored at an array index.

InputTypeDescription
indexuint256Array index.
Example
>>> LlamaGuardOracle.updateTypes(index)
TODO

isValidUpdateType

LlamaGuardOracle.isValidUpdateType(string) → bool0xd1a1f1bc

Returns whether an update type is registered.

InputTypeDescription
updateTypestringUpdate type.
Example
>>> LlamaGuardOracle.isValidUpdateType(updateType)
TODO

getExpectedAdditionalDataLength

LlamaGuardOracle.getExpectedAdditionalDataLength(string) → uint2560xfb8ca9f4

Returns the required additional-data length for an update type.

InputTypeDescription
updateTypestringUpdate type.
Example
>>> LlamaGuardOracle.getExpectedAdditionalDataLength(updateType)
TODO

ADDITIONAL_DATA_LENGTH_NOT_SET

LlamaGuardOracle.ADDITIONAL_DATA_LENGTH_NOT_SET() → uint2560x9fcf3aad

Returns the sentinel that disables additional-data length validation.

Example
>>> LlamaGuardOracle.ADDITIONAL_DATA_LENGTH_NOT_SET()
TODO

addUpdateType

LlamaGuardOracle.addUpdateType(string,uint256) → void0xe8a1f70e

Adds update type.

InputTypeDescription
updateTypestringUpdate type.
expectedAdditionalDataLengthuint256Expected additional-data length.

Authorization: DEFAULT_ADMIN_ROLE

Example
>>> LlamaGuardOracle.addUpdateType(updateType, expectedAdditionaldataLength)
TODO

removeUpdateType

LlamaGuardOracle.removeUpdateType(string) → void0xc325ddc6

Removes update type.

InputTypeDescription
updateTypestringUpdate type.

Authorization: DEFAULT_ADMIN_ROLE

Example
>>> LlamaGuardOracle.removeUpdateType(updateType)
TODO

setExpectedAdditionalDataLength

LlamaGuardOracle.setExpectedAdditionalDataLength(string,uint256) → void0xca3fa97c

Sets expected additional data length.

InputTypeDescription
updateTypestringUpdate type.
expectedLengthuint256Byte length or sentinel.

Authorization: DEFAULT_ADMIN_ROLE

Example
>>> LlamaGuardOracle.setExpectedAdditionalDataLength(updateType, expectedLength)
TODO

Market safeguards

isAuthorizedMarket

LlamaGuardOracle.isAuthorizedMarket(address) → bool0x99079671

Returns whether a market may receive updates.

InputTypeDescription
marketaddressMarket.
Example
>>> LlamaGuardOracle.isAuthorizedMarket(market)
TODO

maxPriceDeviation

LlamaGuardOracle.maxPriceDeviation() → uint2560x975b8662

Returns the maximum price deviation in basis points; zero disables the check.

Example
>>> LlamaGuardOracle.maxPriceDeviation()
TODO

setMaxPriceDeviation

LlamaGuardOracle.setMaxPriceDeviation(uint256) → void0x9ee4c057

Sets max price deviation.

InputTypeDescription
newMaxDeviationuint256New max deviation.

Authorization: DEFAULT_ADMIN_ROLE

Example
>>> LlamaGuardOracle.setMaxPriceDeviation(newMaxDeviation)
TODO

addAuthorizedMarket

LlamaGuardOracle.addAuthorizedMarket(address) → void0x81941eb0

Adds authorized market.

InputTypeDescription
marketaddressNon-zero market.

Authorization: DEFAULT_ADMIN_ROLE

Example
>>> LlamaGuardOracle.addAuthorizedMarket(market)
TODO

removeAuthorizedMarket

LlamaGuardOracle.removeAuthorizedMarket(address) → void0x335f6333

Removes authorized market.

InputTypeDescription
marketaddressAuthorized market.

Authorization: DEFAULT_ADMIN_ROLE

Example
>>> LlamaGuardOracle.removeAuthorizedMarket(market)
TODO

Roles and interface support

DEFAULT_ADMIN_ROLE

LlamaGuardOracle.DEFAULT_ADMIN_ROLE() → bytes320xa217fddf

Returns the current default admin role.

Example
>>> LlamaGuardOracle.DEFAULT_ADMIN_ROLE()
TODO

READER_ROLE

LlamaGuardOracle.READER_ROLE() → bytes320x458c4458

Returns the current reader role.

Example
>>> LlamaGuardOracle.READER_ROLE()
TODO

WRITER_ROLE

LlamaGuardOracle.WRITER_ROLE() → bytes320x9beaab7b

Returns the current writer role.

Example
>>> LlamaGuardOracle.WRITER_ROLE()
TODO

hasRole

LlamaGuardOracle.hasRole(bytes32,address) → bool0x91d14854

Returns whether an account holds a role.

InputTypeDescription
rolebytes32Role ID.
accountaddressAccount.
Example
>>> LlamaGuardOracle.hasRole(role, account)
TODO

hasWriteAccess

LlamaGuardOracle.hasWriteAccess(address) → bool0xf7c1ec9f

Returns whether an account may publish updates.

InputTypeDescription
accountaddressAccount.
Example
>>> LlamaGuardOracle.hasWriteAccess(account)
TODO

getRoleAdmin

LlamaGuardOracle.getRoleAdmin(bytes32) → bytes320x248a9ca3

Returns the administrator role for a role ID.

InputTypeDescription
rolebytes32Role ID.
Example
>>> LlamaGuardOracle.getRoleAdmin(role)
TODO

supportsInterface

LlamaGuardOracle.supportsInterface(bytes4) → bool0x01ffc9a7

Returns whether the contract implements an interface ID.

InputTypeDescription
interfaceIdbytes4Interface ID.
Example
>>> LlamaGuardOracle.supportsInterface(interfaceId)
TODO

grantRole

LlamaGuardOracle.grantRole(bytes32,address) → void0x2f2ff15d

Grants a role to an account.

InputTypeDescription
rolebytes32Role ID.
accountaddressAccount.

Authorization: Admin of role

Example
>>> LlamaGuardOracle.grantRole(role, account)
TODO

revokeRole

LlamaGuardOracle.revokeRole(bytes32,address) → void0xd547741f

Revokes a role from an account.

InputTypeDescription
rolebytes32Role ID.
accountaddressAccount.

Authorization: Admin of role

Example
>>> LlamaGuardOracle.revokeRole(role, account)
TODO

renounceRole

LlamaGuardOracle.renounceRole(bytes32,address) → void0x36568abe

Renounces role.

InputTypeDescription
rolebytes32Role ID.
callerConfirmationaddressCaller's address.

Authorization: Role holder

Example
>>> LlamaGuardOracle.renounceRole(role, callerConfirmation)
TODO

On this page