Skip to content

feat: Add average order completion time and completion rate metrics to public order listings #798

@Matobi98

Description

@Matobi98

Summary

Add two per-user metrics: the average time to complete an order (from taken to SUCCESS) and the completion rate (percentage of taken orders that reached SUCCESS). Both are stored on the User model and displayed in the public channel alongside the order.

Motivation

When two sellers (or buyers) offer identical terms, there is no way to distinguish them by reliability or speed. A visible completion time and completion rate give users meaningful signals to pick the better counterparty, improving overall trade quality and velocity on the platform.

Proposed UX

Order listing in the channel would include two new lines:

⚡ Sell 100,000 sats
💵 1,000 USD — Bank transfer
👤 @alice  ⏱ avg. completion: 12 min  ✅ 89% completion rate

If the user has fewer than 5 completed orders:

👤 @bob  ⏱ new trader

Data Model Changes

New fields added to the User model:

  • avg_completion_time — average time in seconds from order taken to SUCCESS
  • total_taken_orders — total number of orders the user has taken, used as the completion rate denominator

The existing trades_completed field is reused as the completion rate numerator.

Calculation Logic

Completion rate — recalculated on every SUCCESS transition:

completionRate = (trades_completed / total_taken_orders) * 100

Average completion time — updated on every SUCCESS transition using a running average, where elapsed time is measured from order.taken_at to the moment the order completes.

Display Logic

  • trades_completed >= 5 → show both metrics alongside the order in the channel
  • trades_completed < 5 → show new trader or omit both metrics entirely

Localization

New keys needed in all locales/ files:

  • avg_completion_time — e.g. "⏱ avg. completion: {{time}} min"
  • completion_rate — e.g. "✅ {{rate}}% completion rate"
  • new_trader — e.g. "⏱ new trader"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions