Skip to content

feat: Gains trade history via REST API - #2091

Merged
Flotapponnier merged 1 commit into
devfrom
feat/gains-trade-history
Aug 26, 2026
Merged

feat: Gains trade history via REST API#2091
Flotapponnier merged 1 commit into
devfrom
feat/gains-trade-history

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Summary

  • Replace on-chain FeesProcessed event scanning with Gains REST API
  • fetchGainsTrades() paginates backend-global.gains.trade up to 1000 trades
  • Filter to collateralIndex=3 (USDC) for clean USD comparison
  • GainsWalletData now carries: tradingFees / fundingFees / borrowingFees / netCostUsdc / recentTrades
  • Gains wallet side shows full fee breakdown card (like HL: fees + funding + net)
  • New GainsTradeTable component with pair / action / notional / fee / pnl per row
  • Remove rpcCall / getLatestBlock / fetchGainsLogs (no more Arbitrum RPC dependency for Gains)

Test wallet

https://staging-openchainbench.vercel.app/fee-compare/gains/hyperliquid/0xf62042bb1455b9e8bddb5b66b1e30bd320050c66

- fetchGainsTrades() hits backend-global.gains.trade/api/personal-trading-history
- paginates up to 1000 trades, filters collateralIndex=3 (USDC)
- GainsWalletData now has tradingFees, fundingFees, borrowingFees, netCostUsdc, recentTrades
- Gains wallet side shows fee/funding/borrowing/net breakdown (like HL)
- GainsTradeTable component with per-trade pair/action/fee/pnl
- Remove rpcCall/getLatestBlock/fetchGainsLogs (on-chain FeesProcessed)
@Flotapponnier
Flotapponnier merged commit 3a28b49 into dev Aug 26, 2026
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