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.
| Property | Value |
|---|---|
| Access model | Owner, 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.
| Field | Type | Meaning |
|---|---|---|
riskOracle | address | Downstream EMA oracle or recommendation oracle |
publishSelector | bytes4 | Function called on the downstream oracle |
agentHub | address | Hub invoked after publication; zero disables execution |
enabled | bool | Whether reports are accepted for the route |
minDelaySeconds | uint64 | Minimum interval for the same workflow, market, and update type |
maxStepBps | uint64 | Maximum scalar change; MAX_STEP_OFF disables this check |
maxReportAgeSeconds | uint64 | Maximum signed report age; zero selects the unguarded wire format |
Constants and interface support
MAX_STEP_OFF
LlamaguardRiskOracleRouter.MAX_STEP_OFF() → uint640x56d16f82Returns sentinel that disables the scalar step check.
>>> LlamaguardRiskOracleRouter.MAX_STEP_OFF()
TODOMIN_REPORT_AGE_SECONDS
LlamaguardRiskOracleRouter.MIN_REPORT_AGE_SECONDS() → uint640xf1d6975cReturns the current min report age seconds.
>>> LlamaguardRiskOracleRouter.MIN_REPORT_AGE_SECONDS()
TODOisReportWriteSecured
LlamaguardRiskOracleRouter.isReportWriteSecured() → bool0x5bb6ba46Returns interface capability flag.
>>> LlamaguardRiskOracleRouter.isReportWriteSecured()
TODOsupportsInterface
LlamaguardRiskOracleRouter.supportsInterface(bytes4) → bool0x01ffc9a7Returns whether the contract implements an interface ID.
| Input | Type | Description |
|---|---|---|
interfaceId | bytes4 | Interface ID. |
>>> LlamaguardRiskOracleRouter.supportsInterface(interfaceId)
TODORoutes and workflow state
routes
LlamaguardRiskOracleRouter.routes(bytes32) → Route0x066e9481Returns the publication and execution route for a workflow.
| Input | Type | Description |
|---|---|---|
workflowId | bytes32 | Workflow ID. |
>>> LlamaguardRiskOracleRouter.routes(workflowId)
TODOgetAgentIds
LlamaguardRiskOracleRouter.getAgentIds(bytes32) → uint256[]0x3e9c116eReturns the agent ids.
| Input | Type | Description |
|---|---|---|
workflowId | bytes32 | Workflow ID. |
>>> LlamaguardRiskOracleRouter.getAgentIds(workflowId)
TODOgetUpdateRecord
LlamaguardRiskOracleRouter.getUpdateRecord(bytes32,address,string) → (lastAt, hasBaseline, lastSignedAt, lastValue)0x3328d1bcReturns the router throttle and replay state for an update key.
| Input | Type | Description |
|---|---|---|
workflowId | bytes32 | Workflow ID. |
market | address | Market. |
updateType | string | Update type. |
>>> LlamaguardRiskOracleRouter.getUpdateRecord(workflowId, market, updateType)
TODOgetWorkflowConfig
LlamaguardRiskOracleRouter.getWorkflowConfig(bytes32) → (expectedForwarder, expectedAuthor, expectedWorkflowName, isActive)0x84d26ae9Returns the registered CRE identity for a workflow.
| Input | Type | Description |
|---|---|---|
workflowId | bytes32 | Workflow ID. |
>>> LlamaguardRiskOracleRouter.getWorkflowConfig(workflowId)
TODOworkflowConfigs
LlamaguardRiskOracleRouter.workflowConfigs(bytes32) → WorkflowConfig0x399dae78Returns the registered CRE identity for a workflow.
| Input | Type | Description |
|---|---|---|
workflowId | bytes32 | Workflow ID. |
>>> LlamaguardRiskOracleRouter.workflowConfigs(workflowId)
TODOisWorkflowActive
LlamaguardRiskOracleRouter.isWorkflowActive(bytes32) → bool0xe2d44dccReturns whether a CRE workflow is active.
| Input | Type | Description |
|---|---|---|
workflowId | bytes32 | Workflow ID. |
>>> LlamaguardRiskOracleRouter.isWorkflowActive(workflowId)
TODOReport handling
onReport
LlamaguardRiskOracleRouter.onReport(bytes,bytes) → void0x805f2132Receives an authenticated CRE report and routes its payload.
| Input | Type | Description |
|---|---|---|
creMetadata | bytes | Cre metadata. |
report | bytes | Report. |
>>> LlamaguardRiskOracleRouter.onReport(creMetadata, report)
TODOonReport 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) → void0x641068b5Registers a workflow identity and its publication and execution route.
| Input | Type | Description |
|---|---|---|
workflowId | bytes32 | Workflow ID. |
forwarder | address | Forwarder. |
author | address | Author. |
workflowName | bytes10 | Workflow name. |
riskOracle | address | Risk oracle. |
publishSelector | bytes4 | Publish selector. |
agentHub | address | Agent hub. |
agentIds | uint256[] | Agent IDs. |
maxReportAgeSeconds | uint64 | Maximum report age in seconds. |
>>> LlamaguardRiskOracleRouter.addRoute(workflowId, forwarder, author, workflowName, riskOracle, publishSelector, agentHub, agentIds, maxReportAgeSeconds)
TODOremoveRoute
LlamaguardRiskOracleRouter.removeRoute(bytes32) → void0x4d0fdcaeRemoves route.
| Input | Type | Description |
|---|---|---|
workflowId | bytes32 | Workflow ID. |
>>> LlamaguardRiskOracleRouter.removeRoute(workflowId)
TODOsetRiskOracle
LlamaguardRiskOracleRouter.setRiskOracle(bytes32,address,bytes4) → void0x7e787de3Sets risk oracle.
| Input | Type | Description |
|---|---|---|
workflowId | bytes32 | Workflow ID. |
oracle | address | Oracle. |
publishSelector | bytes4 | Publish selector. |
>>> LlamaguardRiskOracleRouter.setRiskOracle(workflowId, oracle, publishSelector)
TODOsetAgentHub
LlamaguardRiskOracleRouter.setAgentHub(bytes32,address) → void0x29396a0dSets agent hub.
| Input | Type | Description |
|---|---|---|
workflowId | bytes32 | Workflow ID. |
agentHub | address | Agent hub. |
>>> LlamaguardRiskOracleRouter.setAgentHub(workflowId, agentHub)
TODOsetAgentIds
LlamaguardRiskOracleRouter.setAgentIds(bytes32,uint256[]) → void0xdf2abb10Sets agent ids.
| Input | Type | Description |
|---|---|---|
workflowId | bytes32 | Workflow ID. |
agentIds | uint256[] | Agent IDs. |
>>> LlamaguardRiskOracleRouter.setAgentIds(workflowId, agentIds)
TODOsetRouteEnabled
LlamaguardRiskOracleRouter.setRouteEnabled(bytes32,bool) → void0xf15f48d4Sets route enabled.
| Input | Type | Description |
|---|---|---|
workflowId | bytes32 | Workflow ID. |
enable | bool | Enabled state. |
>>> LlamaguardRiskOracleRouter.setRouteEnabled(workflowId, enabledState)
TODOsetRouteThrottle
LlamaguardRiskOracleRouter.setRouteThrottle(bytes32,uint64,uint64) → void0x63011ee6Sets route throttle.
| Input | Type | Description |
|---|---|---|
workflowId | bytes32 | Workflow ID. |
minDelaySeconds | uint64 | Minimum delay. |
maxStepBps | uint64 | Maximum scalar step. |
>>> LlamaguardRiskOracleRouter.setRouteThrottle(workflowId, minDelaySeconds, maxStepBps)
TODOsetRouteMaxReportAge
LlamaguardRiskOracleRouter.setRouteMaxReportAge(bytes32,uint64) → void0xbfbe6e9eSets route max report age.
| Input | Type | Description |
|---|---|---|
workflowId | bytes32 | Workflow ID. |
maxReportAgeSeconds | uint64 | Age of at least MIN_REPORT_AGE_SECONDS. |
>>> LlamaguardRiskOracleRouter.setRouteMaxReportAge(workflowId, maxReportAgeSeconds)
TODOOperational controls
guardian
LlamaguardRiskOracleRouter.guardian() → address0x452a9320Returns the current guardian.
>>> LlamaguardRiskOracleRouter.guardian()
TODOupdater
LlamaguardRiskOracleRouter.updater() → address0xdf034cd0Returns the current updater.
>>> LlamaguardRiskOracleRouter.updater()
TODOpaused
LlamaguardRiskOracleRouter.paused() → bool0x5c975abbReturns whether report processing is paused.
>>> LlamaguardRiskOracleRouter.paused()
TODOsetUpdater
LlamaguardRiskOracleRouter.setUpdater(address) → void0x9d54f419Sets updater.
| Input | Type | Description |
|---|---|---|
updater | address | Non-zero updater. |
>>> LlamaguardRiskOracleRouter.setUpdater(updater)
TODOsetGuardian
LlamaguardRiskOracleRouter.setGuardian(address) → void0x8a0dac4aSets guardian.
| Input | Type | Description |
|---|---|---|
guardian | address | Guardian. |
>>> LlamaguardRiskOracleRouter.setGuardian(guardian)
TODOpause
LlamaguardRiskOracleRouter.pause() → void0x8456cb59Pauses report processing.
>>> LlamaguardRiskOracleRouter.pause()
TODOunpause
LlamaguardRiskOracleRouter.unpause() → void0x3f4ba83aResumes report processing.
>>> LlamaguardRiskOracleRouter.unpause()
TODOOwnership
owner
LlamaguardRiskOracleRouter.owner() → address0x8da5cb5bReturns the current owner.
>>> LlamaguardRiskOracleRouter.owner()
TODOpendingOwner
LlamaguardRiskOracleRouter.pendingOwner() → address0xe30c3978Returns the current pending owner.
>>> LlamaguardRiskOracleRouter.pendingOwner()
TODOtransferOwnership
LlamaguardRiskOracleRouter.transferOwnership(address) → void0xf2fde38bTransfers ownership.
| Input | Type | Description |
|---|---|---|
owner | address | New owner. |
>>> LlamaguardRiskOracleRouter.transferOwnership(owner)
TODOacceptOwnership
LlamaguardRiskOracleRouter.acceptOwnership() → void0x79ba5097Accepts ownership.
>>> LlamaguardRiskOracleRouter.acceptOwnership()
TODOrenounceOwnership
LlamaguardRiskOracleRouter.renounceOwnership() → void0x715018a6Renounces ownership.
>>> LlamaguardRiskOracleRouter.renounceOwnership()
TODO