LlamaRisk

LlamaguardRiskOracleRouter

Function index31 functions

The router receives reports from the Chainlink CRE Forwarder, authenticates the workflow identity, and publishes the decoded payload to either the EMA LlamaGuardOracle or the RiskOracle. Routes for executable recommendations may then call AgentHub.check and AgentHub.execute in the same transaction.

PropertyValue
Access modelOwner, updater, guardian, and authenticated CRE Forwarder

Example outputs

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

ROUTER=<router-address>
EMA_WORKFLOW_ID=<ema-workflow-id>
DISCOUNT_WORKFLOW_ID=<discount-workflow-id>
RISK_WORKFLOW_ID=<risk-workflow-id>
MARKET=<pt-market-address>

Route schema

The public routes getter returns every fixed-size field. Use getAgentIds for the route's dynamic agent ID array.

FieldTypeMeaning
riskOracleaddressDownstream EMA oracle or recommendation oracle
publishSelectorbytes4Function called on the downstream oracle
agentHubaddressHub invoked after publication; zero disables execution
enabledboolWhether reports are accepted for the route
minDelaySecondsuint64Minimum interval for the same workflow, market, and update type
maxStepBpsuint64Maximum scalar change; MAX_STEP_OFF disables this check
maxReportAgeSecondsuint64Maximum signed report age; zero selects the unguarded wire format

Constants and interface support

MAX_STEP_OFF

LlamaguardRiskOracleRouter.MAX_STEP_OFF() → uint640x56d16f82

Returns sentinel that disables the scalar step check.

Example
>>> LlamaguardRiskOracleRouter.MAX_STEP_OFF()
TODO

MIN_REPORT_AGE_SECONDS

LlamaguardRiskOracleRouter.MIN_REPORT_AGE_SECONDS() → uint640xf1d6975c

Returns the current min report age seconds.

Example
>>> LlamaguardRiskOracleRouter.MIN_REPORT_AGE_SECONDS()
TODO

isReportWriteSecured

LlamaguardRiskOracleRouter.isReportWriteSecured() → bool0x5bb6ba46

Returns interface capability flag.

Example
>>> LlamaguardRiskOracleRouter.isReportWriteSecured()
TODO

supportsInterface

LlamaguardRiskOracleRouter.supportsInterface(bytes4) → bool0x01ffc9a7

Returns whether the contract implements an interface ID.

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

Routes and workflow state

routes

LlamaguardRiskOracleRouter.routes(bytes32) → Route0x066e9481

Returns the publication and execution route for a workflow.

InputTypeDescription
workflowIdbytes32Workflow ID.
Example
>>> LlamaguardRiskOracleRouter.routes(workflowId)
TODO

getAgentIds

LlamaguardRiskOracleRouter.getAgentIds(bytes32) → uint256[]0x3e9c116e

Returns the agent ids.

InputTypeDescription
workflowIdbytes32Workflow ID.
Example
>>> LlamaguardRiskOracleRouter.getAgentIds(workflowId)
TODO

getUpdateRecord

LlamaguardRiskOracleRouter.getUpdateRecord(bytes32,address,string) → (lastAt, hasBaseline, lastSignedAt, lastValue)0x3328d1bc

Returns the router throttle and replay state for an update key.

InputTypeDescription
workflowIdbytes32Workflow ID.
marketaddressMarket.
updateTypestringUpdate type.
Example
>>> LlamaguardRiskOracleRouter.getUpdateRecord(workflowId, market, updateType)
TODO

getWorkflowConfig

LlamaguardRiskOracleRouter.getWorkflowConfig(bytes32) → (expectedForwarder, expectedAuthor, expectedWorkflowName, isActive)0x84d26ae9

Returns the registered CRE identity for a workflow.

InputTypeDescription
workflowIdbytes32Workflow ID.
Example
>>> LlamaguardRiskOracleRouter.getWorkflowConfig(workflowId)
TODO

workflowConfigs

LlamaguardRiskOracleRouter.workflowConfigs(bytes32) → WorkflowConfig0x399dae78

Returns the registered CRE identity for a workflow.

InputTypeDescription
workflowIdbytes32Workflow ID.
Example
>>> LlamaguardRiskOracleRouter.workflowConfigs(workflowId)
TODO

isWorkflowActive

LlamaguardRiskOracleRouter.isWorkflowActive(bytes32) → bool0xe2d44dcc

Returns whether a CRE workflow is active.

InputTypeDescription
workflowIdbytes32Workflow ID.
Example
>>> LlamaguardRiskOracleRouter.isWorkflowActive(workflowId)
TODO

Report handling

onReport

LlamaguardRiskOracleRouter.onReport(bytes,bytes) → void0x805f2132

Receives an authenticated CRE report and routes its payload.

InputTypeDescription
creMetadatabytesCre metadata.
reportbytesReport.

Authorization: Configured Forwarder; workflow metadata must match

Example
>>> LlamaguardRiskOracleRouter.onReport(creMetadata, report)
TODO

onReport is normally called by the CRE Forwarder, not manually. Publication failures revert the report transaction. AgentHub check or execute failures are caught and emitted, so the oracle record can still land even when protocol execution does not.

Route configuration

addRoute

LlamaguardRiskOracleRouter.addRoute(bytes32,address,address,bytes10,address,bytes4,address,uint256[],uint64) → void0x641068b5

Registers a workflow identity and its publication and execution route.

InputTypeDescription
workflowIdbytes32Workflow ID.
forwarderaddressForwarder.
authoraddressAuthor.
workflowNamebytes10Workflow name.
riskOracleaddressRisk oracle.
publishSelectorbytes4Publish selector.
agentHubaddressAgent hub.
agentIdsuint256[]Agent IDs.
maxReportAgeSecondsuint64Maximum report age in seconds.

Authorization: Owner

Example
>>> LlamaguardRiskOracleRouter.addRoute(workflowId, forwarder, author, workflowName, riskOracle, publishSelector, agentHub, agentIds, maxReportAgeSeconds)
TODO

removeRoute

LlamaguardRiskOracleRouter.removeRoute(bytes32) → void0x4d0fdcae

Removes route.

InputTypeDescription
workflowIdbytes32Workflow ID.

Authorization: Owner

Example
>>> LlamaguardRiskOracleRouter.removeRoute(workflowId)
TODO

setRiskOracle

LlamaguardRiskOracleRouter.setRiskOracle(bytes32,address,bytes4) → void0x7e787de3

Sets risk oracle.

InputTypeDescription
workflowIdbytes32Workflow ID.
oracleaddressOracle.
publishSelectorbytes4Publish selector.

Authorization: Owner

Example
>>> LlamaguardRiskOracleRouter.setRiskOracle(workflowId, oracle, publishSelector)
TODO

setAgentHub

LlamaguardRiskOracleRouter.setAgentHub(bytes32,address) → void0x29396a0d

Sets agent hub.

InputTypeDescription
workflowIdbytes32Workflow ID.
agentHubaddressAgent hub.

Authorization: Owner

Example
>>> LlamaguardRiskOracleRouter.setAgentHub(workflowId, agentHub)
TODO

setAgentIds

LlamaguardRiskOracleRouter.setAgentIds(bytes32,uint256[]) → void0xdf2abb10

Sets agent ids.

InputTypeDescription
workflowIdbytes32Workflow ID.
agentIdsuint256[]Agent IDs.

Authorization: Updater

Example
>>> LlamaguardRiskOracleRouter.setAgentIds(workflowId, agentIds)
TODO

setRouteEnabled

LlamaguardRiskOracleRouter.setRouteEnabled(bytes32,bool) → void0xf15f48d4

Sets route enabled.

InputTypeDescription
workflowIdbytes32Workflow ID.
enableboolEnabled state.

Authorization: Updater

Example
>>> LlamaguardRiskOracleRouter.setRouteEnabled(workflowId, enabledState)
TODO

setRouteThrottle

LlamaguardRiskOracleRouter.setRouteThrottle(bytes32,uint64,uint64) → void0x63011ee6

Sets route throttle.

InputTypeDescription
workflowIdbytes32Workflow ID.
minDelaySecondsuint64Minimum delay.
maxStepBpsuint64Maximum scalar step.

Authorization: Updater

Example
>>> LlamaguardRiskOracleRouter.setRouteThrottle(workflowId, minDelaySeconds, maxStepBps)
TODO

setRouteMaxReportAge

LlamaguardRiskOracleRouter.setRouteMaxReportAge(bytes32,uint64) → void0xbfbe6e9e

Sets route max report age.

InputTypeDescription
workflowIdbytes32Workflow ID.
maxReportAgeSecondsuint64Age of at least MIN_REPORT_AGE_SECONDS.

Authorization: Updater

Example
>>> LlamaguardRiskOracleRouter.setRouteMaxReportAge(workflowId, maxReportAgeSeconds)
TODO

Operational controls

guardian

LlamaguardRiskOracleRouter.guardian() → address0x452a9320

Returns the current guardian.

Example
>>> LlamaguardRiskOracleRouter.guardian()
TODO

updater

LlamaguardRiskOracleRouter.updater() → address0xdf034cd0

Returns the current updater.

Example
>>> LlamaguardRiskOracleRouter.updater()
TODO

paused

LlamaguardRiskOracleRouter.paused() → bool0x5c975abb

Returns whether report processing is paused.

Example
>>> LlamaguardRiskOracleRouter.paused()
TODO

setUpdater

LlamaguardRiskOracleRouter.setUpdater(address) → void0x9d54f419

Sets updater.

InputTypeDescription
updateraddressNon-zero updater.

Authorization: Owner

Example
>>> LlamaguardRiskOracleRouter.setUpdater(updater)
TODO

setGuardian

LlamaguardRiskOracleRouter.setGuardian(address) → void0x8a0dac4a

Sets guardian.

InputTypeDescription
guardianaddressGuardian.

Authorization: Owner

Example
>>> LlamaguardRiskOracleRouter.setGuardian(guardian)
TODO

pause

LlamaguardRiskOracleRouter.pause() → void0x8456cb59

Pauses report processing.

Authorization: Owner or guardian

Example
>>> LlamaguardRiskOracleRouter.pause()
TODO

unpause

LlamaguardRiskOracleRouter.unpause() → void0x3f4ba83a

Resumes report processing.

Authorization: Owner

Example
>>> LlamaguardRiskOracleRouter.unpause()
TODO

Ownership

owner

LlamaguardRiskOracleRouter.owner() → address0x8da5cb5b

Returns the current owner.

Example
>>> LlamaguardRiskOracleRouter.owner()
TODO

pendingOwner

LlamaguardRiskOracleRouter.pendingOwner() → address0xe30c3978

Returns the current pending owner.

Example
>>> LlamaguardRiskOracleRouter.pendingOwner()
TODO

transferOwnership

LlamaguardRiskOracleRouter.transferOwnership(address) → void0xf2fde38b

Transfers ownership.

InputTypeDescription
owneraddressNew owner.

Authorization: Owner

Example
>>> LlamaguardRiskOracleRouter.transferOwnership(owner)
TODO

acceptOwnership

LlamaguardRiskOracleRouter.acceptOwnership() → void0x79ba5097

Accepts ownership.

Authorization: Pending owner

Example
>>> LlamaguardRiskOracleRouter.acceptOwnership()
TODO

renounceOwnership

LlamaguardRiskOracleRouter.renounceOwnership() → void0x715018a6

Renounces ownership.

Authorization: Owner

Example
>>> LlamaguardRiskOracleRouter.renounceOwnership()
TODO

On this page