Skip to content

fix: Standardized the events emitted by backend tools#247

Open
samjay8 wants to merge 1 commit intoStellarFlow-Network:mainfrom
samjay8:feat/contracts-event-emission
Open

fix: Standardized the events emitted by backend tools#247
samjay8 wants to merge 1 commit intoStellarFlow-Network:mainfrom
samjay8:feat/contracts-event-emission

Conversation

@samjay8
Copy link
Copy Markdown

@samjay8 samjay8 commented Apr 28, 2026

Closes #196

📡 Feat: Standardized Event Emission for Off-Chain Indexing

Standardizes oracle price events so backend indexing tools (Mercury, Horizon) can perfectly mirror on-chain price history.

Changes

PriceUpdatedEvent Schema

  • Added timestamp and relayer (Address) fields to match the required { asset, price, timestamp, relayer } schema

Enhanced Indexing

  • Switched from publish_event to env.events().publish() with multiple topics: ("price_updated", asset_symbol)
  • Enables backend tools to query price history per asset without scanning all oracle events

Data Integrity

  • Event now reports median_price — the exact value committed to storage — ensuring off-chain indexes are a perfect mirror of on-chain state

Relayer Attribution

  • relayer field explicitly tracks the update source: specific relayer address for update_price calls, contract address for admin set_price calls

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 28, 2026

@samjay8 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Contracts | Event Emission for Off-Chain Indexing

1 participant