Skip to content

feat(webapp): show trade result on signal detail page#122

Draft
itamarreif wants to merge 1 commit intomainfrom
itamarreif/feat/signal-trade-result
Draft

feat(webapp): show trade result on signal detail page#122
itamarreif wants to merge 1 commit intomainfrom
itamarreif/feat/signal-trade-result

Conversation

@itamarreif
Copy link
Copy Markdown
Contributor

Summary

  • Adds a Trade Result card to the signal detail page (/signals/:id) showing the outcome of trade execution for that signal
  • New GET /trades/by-signal/:signal_id endpoint returns a slim response (no embedded signal) with trade_type tag + tx hashes + realized profit
  • Three new DB queries (get_{successful,failed_on_slow,failed_on_fast}_by_signal_id) on TradeRepository
  • Coloured badge per outcome: green Successful / red Failed on Slow / yellow Stuck on Fast
  • ExplorerLinks for tx hashes; realized profit displayed via TokenAmount (USDC)

Test plan

  • Start backend + frontend locally
  • Navigate to a signal that has a successful trade — confirm green badge, both tx links, and USDC profit amount appear
  • Navigate to a signal with no trade — confirm "No trade recorded" placeholder
  • Navigate to a failed-on-slow signal — confirm red badge, optional slow tx link, fast tx shows —
  • Navigate to a failed-on-fast signal — confirm yellow badge, slow tx link, optional fast tx link

🤖 Generated with Claude Code

Add a Trade Result card to the signal detail page showing whether the
signal led to a successful, failed-on-slow, or failed-on-fast trade.

- DB: add get_{successful,failed_on_slow,failed_on_fast}_by_signal_id
  to TradeRepository (queries by signal FK rather than pair symbols)
- Backend: new GET /trades/by-signal/:signal_id route returning a slim
  SignalTradeResultResponse enum (trade_type tag + tx hashes + realized
  profit) — omits the embedded signal since the page already has it
- Frontend: add SignalTradeResult type, useTradesBySignal hook, and
  TradeResultsCard component with coloured badge + ExplorerLinks

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant