Skip to content

[Infra] Backfill user_address on existing trade_history rows #370

@realproject7

Description

@realproject7

Backfill user_address on existing trade_history rows

Problem

PR #369 added user_address column to trade_history, but existing rows have NULL. These trades won't appear in the reader dashboard Trading History.

Fix

Run a one-time backfill by reading the user field from on-chain Mint/Burn event logs for existing rows. Alternatively, since there are few existing mainnet trades, a simple approach:

  1. Query trade_history rows where user_address IS NULL
  2. For each, fetch the tx receipt, decode the Mint/Burn event, extract user address
  3. Update the row

This could be a one-off script or a small API endpoint. Given the small number of rows, even a manual SQL update with known addresses works.

Branch

task/370-backfill-user-address

Labels

agent/T3, infra

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions