Skip to content

feat(portfolio): add CSV export for trade history - #897

Open
Risktaker001 wants to merge 5 commits into
accesslayerorg:devfrom
Risktaker001:freebuff/857-add-a-trade-history-csv-export-b-ds8dgy6m
Open

feat(portfolio): add CSV export for trade history#897
Risktaker001 wants to merge 5 commits into
accesslayerorg:devfrom
Risktaker001:freebuff/857-add-a-trade-history-csv-export-b-ds8dgy6m

Conversation

@Risktaker001

Copy link
Copy Markdown

closes #857

Summary

Adds a CSV export feature to the portfolio page trade history tab, allowing authenticated users to download their complete trade history for off-platform analysis and tax reporting.

Changes

  • UI Integration: Added an Export CSV button with a loading state/spinner to the trade history tab header.

  • Data Fetching: Configured trade export to fetch all records via GET /users/:wallet/trades without pagination limits on click.

  • CSV Generation & Download:

  • Formatted output with required columns: Date, Key Name, Type, Quantity, Price per Key, Total, and Fee.

  • Triggered browser file download with the dynamic filename format: trades-[wallet-truncated]-[date].csv.

  • Access Control: Restricted button access to authenticated wallet sessions only.

Verification

  • Verified button appears only when a wallet is connected and authenticated.
  • Confirmed loading spinner displays during export data fetching.
  • Validated generated CSV structure, correct column mapping, and formatted output data against API response payload.
  • Verified downloaded filename matches expected trades-[wallet-truncated]-[date].csv convention.

@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@Risktaker001 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Risktaker001 and others added 3 commits September 1, 2026 12:39
Four source files had two versions of the same code concatenated
together (likely from a bad merge), producing parse errors in
eslint: KeySimulationTool.tsx, SlippageToleranceSelector.tsx,
slippageTolerance.utils.ts, and their test files. Kept the
newer (accesslayerorg#875/accesslayerorg#877) versions that match the test expectations.
Also fixed react-hooks/exhaustive-deps warning in BatchBuyModal
by copying debounceTimers.current to a local variable in the
cleanup effect.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
…r props

TradeDialog and LandingPage import DEFAULT_SLIPPAGE_TOLERANCE_PERCENT,
SlippageBounds, and computeSlippageBounds from the old (accesslayerorg#872) API, and
render SlippageToleranceSelector with value/onChange/disabled props.
Added those exports back alongside the new (accesslayerorg#877) ones and made the
selector component accept both prop interfaces via a discriminated union.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@Chucks1093

Copy link
Copy Markdown
Member

CI is green but this PR has a merge conflict with dev and cannot be auto-merged. Pull the latest dev into your branch with git fetch origin && git checkout your-branch && git merge origin/dev, resolve any conflicts, then run npm run build and npm run lint to confirm everything is clean before pushing.

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.

Add a trade history CSV export button on the portfolio page

2 participants