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:
- Query
trade_history rows where user_address IS NULL
- For each, fetch the tx receipt, decode the Mint/Burn event, extract
user address
- 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
Backfill user_address on existing trade_history rows
Problem
PR #369 added
user_addresscolumn totrade_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
userfield from on-chain Mint/Burn event logs for existing rows. Alternatively, since there are few existing mainnet trades, a simple approach:trade_historyrows whereuser_address IS NULLuseraddressThis 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-addressLabels
agent/T3,infra