# engine/producers/your_producer.py
from engine.core.db import EventStore
from engine.core.events import emit_event
class YourProducer:
"""Generates signals from [your source]."""
name = "your_producer"
domain = "technical" # or: onchain, social, tradfi, curator
def __init__(self, config: dict):
self.config = config
def run(self, db: EventStore) -> list[str]:
"""Run one cycle. Return list of emitted event IDs."""
event_ids = []
# Fetch data, compute signal
direction = "bullish" # or: bearish, neutral
conviction = 7.0
event_id = emit_event(
db=db,
event_type=f"signal.{self.domain}.your_signal.v1",
source=f"producer.{self.name}",
payload={
"symbol": "BTC",
"direction": direction,
"conviction": conviction,
"rationale": "...",
},
)
event_ids.append(event_id)
return event_ids