Skip to main content

Trader payouts

modules/dashboard/pages/{traderPayout, traderPayoutAll, traderPayoutDayOne, traderPayoutPending, payoutOperations} — real-money reconciliation, the highest-stakes workflow in the app.

Trader Payouts — shared engine — Live​

Powers: /dashboard/trader-payout/all, /active-payouts, /pending

One headless engine (useTraderPayout) + component kit rendering the 13-stage review pipeline: new_request → trading_review → security_review → pre_approved/pre_denied → ready_to_process → awaiting_rise_kyc/rise_kyc_failed → sent_to_rise → processing_batch → processed/denied, plus a cross-stage failed_checks pseudo-tab. 3s polling while any row's check state is pending/running.

Sub-modules (17 files)
  • PayoutStatsCards — 10 clickable KPI cards that double as stage-tab navigation
  • PayoutFilters / PayoutFilterChips / PayoutFilterModal — Search, payout-window dropdown + custom range, advanced filter modal (plan/account type/funded/account status/payout status), removable chips
  • PayoutBreachTabs — Breach-reason sub-tabs, shown only on Pre-Denied/Denied stages
  • PayoutTable — Sortable grid: bulk checkboxes, side-effect status icons, running/failed check-state badges, row click → detail panel, eye icon → quick actions
  • PayoutDetailPanel — 6 sub-tabs: Overview, Account, Rules, Risk Analysis, History, Notes; stage-advance button; Deny dialog w/ email preview
  • PayoutBulkActionBar — Deny Selected, Re-invite to Rise, Retry Deductions/All/Email/Certificate/Payment, Advance (stage-specific)
  • PayoutQuickActions — Drill-down drawer: Achievement, Security Flags, Hedging/Exposure/Copy-Trading detail, Microscalping report, EOD reports
  • PayoutRuleDetailModal / PayoutRiskReportModal — Deep rule-specific detail; full risk report grouped by section
  • PayoutSummaryCard / PayoutFlowDiagram / PayoutWindowCountdown — Read-only summary, pipeline visualization, live countdown to 2 PM PST cutoff

Actions available (20)

ActionEffectHookStage(s)
Stat card / stage tab clickFilters listing by review_stage (or checks_state=failed)usePayoutStageCounts, TraderPayoutHistoryall
Search, payout-window, filters, sortStandard list filteringTraderPayoutHistoryall
Row select / bulk selectShows PayoutBulkActionBar—all
Export CSVDownloads current lane/viewGET payout_listing?export=csvActive Payouts only
Advance — Move to Review / Run Security CheckDispatches worker task, flips check state to pending/runninguseRunTradingReviewMutation/useRunSecurityCheckMutationnew_request, trading_review
Advance — Approve/Move stageSimple stage transition (server auto-branches Rise sub-lane)useTransitionPayoutMutationsecurity_review→ready_to_process, pre_approved→ready_to_process, etc.
Deny PayoutDialog: reason, note, extra IP sessions, email mode, evidence upload, live preview → ConfirmuseTransitionPayoutMutation("denied"), useUploadDenialEvidenceany non-terminal
Rules tab: Refresh / click a ruleRe-runs evaluator / opens rule detailuseReEvaluatePayoutMutationany
Risk Analysis: View Full Risk ReportAll checks by sectionusePayoutRiskSummaryany
Notes: SavePersists reviewer noteuseUpdatePayoutNotesMutationany
Quick Actions drawerAchievement/Security/Hedging/Exposure/Copy-Trading/Microscalping/EOD drill-downmultiple query hooksany
Bulk: Deny SelectedPer-payout compose drawer → fan-out (allSettled)useTransitionPayoutMutation ×Nnon-denied/processed
Bulk: AdvanceFans out review-task calls or bulk-transitions depending on stageuseRunTradingReviewMutation/useBulkTransitionPayoutsMutationmatches per-row map
Bulk: Re-invite to RiseRe-sends Rise KYC inviteuseBulkRiseReinviteMutationrise_kyc_failed
Bulk: Retry Deductions/All/Email/Certificate/PaymentRetries specific side effect(s)useBulkRetryDeductionMutation, useRetrySideEffectsMutationfailed_checks
Bulk approve drawer: Confirm ApprovePreviews approval email + open flags, then bulk-transitionsuseBulkTransitionPayoutsMutationpre_approved → ready_to_process

All Payouts — Live​

Route: /dashboard/trader-payout/all

Shared engine with showAllStages: true — unscoped by default (every review_stage); no window scoping, breach tabs, Export, or quick-actions drawer.

Active Payouts — Live​

Route: /dashboard/trader-payout/active-payouts

Scoped to the currently-accumulating window (currentWindow: true, default stage new_request) — the only trader-payout page with Export, breach sub-tabs, and the PayoutQuickActions drawer.

ControlEffect
Export → pick lane / current viewCSV download scoped to window + filters
Breach tabsFilters within the window by breach_reason (Pre-Denied/Denied only)
Eye icon → Quick ActionsOpens drawer at root
Rules tab → click rule → drawerOpens the same drawer pre-drilled into that rule

Pending — Live​

Route: /dashboard/trader-payout/pending

Flat cross-lane list of every payout with legacy payout_status=pending, regardless of review_stage. No Export, breach tabs, or quick-actions drawer; payoutStatus filter always wins over the modal's own Payout Status selector.

Payout Operations — Live, read/verify-only​

Route: /dashboard/payout-operations

Separate, simplified operator view collapsed into 3 statuses (awaiting_onboarding/ready_for_payment/paid), scoped to rolling 24h windows (2 PM PT cutoff) or a custom range, with a live read-only "Verify with Rise" check. No transition/deny/re-invite/retry mutations exist on this page — it's reconciliation tooling, not a review workflow. If the backend feature is off, shows a disabled-state message instead of the table.

Sub-modules
  • WindowHeader — Window selector: OPEN/CLOSED badge, live cutoff countdown, prev/next arrows, rolling dropdown, custom-range toggle
  • WindowSummaryCards — 7 read-only KPIs: Total Requests/Requested, Paid, Remaining, Awaiting Onboarding
  • OperatorSearchFilters — Exact-username match, free text, status, safeguard-flag multi-select, amount min/max
  • OperatorPayoutTable / SafeguardFlags / StatusHistory — Sticky-column grid; per-flag warning badges; expandable status-change timeline
  • VerifyRiseButton — Read-only live check against Rise for the whole window

Actions available (14)

ActionEffectHook
Window mode toggle / prev-next / rolling dropdown / custom rangeSteps or jumps the reconciliation windowusePayoutOperationsWindow
Exact-username / free-text searchFilters (exact match avoids paying the wrong trader)TraderPayoutHistory
Status / safeguard-flag / amount filtersStandard filtering; flag filter matches live-corrected flags once verifiedTraderPayoutHistory
Row checkbox / select all visibleDrives Selection Totals bar (count, $, paid/unpaid split)local state
Copy-usernameClipboard copy, no network call—
History iconExpands full transition log for a rowusePayoutActivityLog
Verify window with RiseRead-only live check against Rise for every relevant payout in the window; toasts confirmed/unconfirmed/no-record counts; overlays per-row verdicts (recomputed safeguard flags incl. paid_without_confirmation, amount_mismatch, wrong_payout_window, payee_mismatch) client-side, persisted to localStorage (last 10 windows). Nothing is written server-side — no cache invalidation. Disabled for multi-day custom ranges.useVerifyRiseStatusMutation