Skip to content

Events

DeFiRuntime emits strongly typed RuntimeEvents through TypedEmitter.

  • Runtime lifecycle: runtime:started, runtime:stopped, runtime:error
  • Policy + simulation: policy:decision, tx:simulation
  • Transaction flow: tx:sent, tx:confirmed, tx:approval:*
  • Yield + bridge: yield:*, bridge:*
  • Best execution: bestExecution:completed
  • Strategy engine: strategy:*
runtime.on('policy:decision', (decision, intent) => {
console.log('policy', decision.decision, intent.type);
});
runtime.on('tx:confirmed', (confirmation) => {
console.log('confirmed', confirmation.signature);
});
runtime.on('bridge:status', ({ bridgeId, status }) => {
console.log('bridge', bridgeId, status);
});
runtime.on('runtime:error', (error) => {
console.error(error.code, error.message);
});
  • Forward critical events to chatops using @stendar/notifications
  • Trigger remediation workflows on strategy:circuit_breaker
  • Build dashboards from tx:*, yield:*, and bridge:* streams

Next: Notifications setup.