Skip to content

Add insurance pool events to docs/events.md #404

Description

@Levi-Ojukwu

Description:

The docs/events.md file documents all events emitted by the ILN contracts, which off-chain indexers and frontends rely on to track protocol state changes. However, the insurance_pool contract emits three events that are completely undocumented:

  1. enrolled(lp) — Emitted when an LP enrolls in the insurance program (either via explicit enroll() call or automatically on first deposit_premium()). Topic: (symbol!("enrolled"), lp). Data: ().

  2. premium(lp, amount) — Emitted when an LP deposits a premium payment. The amount is the premium paid in stroops. Topic: (symbol!("premium"), lp). Data: amount: i128.

  3. claimed(invoice_id, payout) — Emitted when a claim is processed for a defaulted invoice. The payout is the compensation amount credited to the LP. Topic: (symbol!("claimed"), invoice_id). Data: payout: i128.

These events are defined in contracts/insurance_pool/src/lib.rs:131-211 and are critical for the indexer service to track insurance pool activity.

Why it matters: Without documented events, the indexer service cannot correctly parse insurance pool events, and frontend developers cannot build features that display insurance enrollment, premium payments, or claim history.

Acceptance Criteria:

  • Add a new section for Insurance Pool events in docs/events.md
  • Document each event with: event name, topic schema, data schema, description, and example
  • Follow the existing event documentation format used for invoice events
  • Include the contract address topic pattern (if applicable)

Relevant Files: docs/events.md, contracts/insurance_pool/src/lib.rs:131-211


Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions