Skip to main content
NOTE: The old endpoints were fully removed on December 1, 2025. Use the new endpoints below.

Backend Global API Migration Guide

Overview

The trading history endpoints have been migrated from backend-[network] service to the new backend-global endpoints with improved caching, pagination, and new statistics endpoints. Base URL Change:
  • Old: https://backend-[network].gains.trade
  • New: https://backend-global.gains.trade

Endpoint Migration Map

24-Hour Trading History

Old EndpointNew EndpointChanges
GET /trading-history-24hGET /api/trading-history/24h?chainId={id}Path prefix added, chainId support
Migration:
Response Format: Unchanged (returns array of trades)

Personal Trading History

Main History Endpoint
Old EndpointNew EndpointChanges
GET /personal-trading-history-table/:addressGET /api/personal-trading-history/:address?chainId=XPath renamed, cursor-based pagination, limits
Migration:
Response Format:
Pagination:
  • Old: No offset
  • New: Cursor-based (?cursor=123456)
To fetch next page:
Query Parameters:
  • chainId (required): Chain ID
  • cursor (optional): Pagination cursor (omit for first page)
  • limit (optional): Max trades per request (default: 50, max: 1000)
  • startDate (optional): ISO 8601 date filter
  • endDate (optional): ISO 8601 date filter
  • pair (optional): Trading pair filter
  • action (optional): Action type filter

Statistics Endpoint (NEW) New endpoint for trader statistics:
Response:
Use case: Get all-time stats without fetching full trade history.
Batch Statistics Endpoint (NEW) New endpoint for batched trader statistics:
Response:
Use case: Get all-time stats without fetching full trade history.
Batch Trading History Endpoint (NEW) New endpoint for fetching multiple addresses:
Response:

Deprecated Endpoints

⚠️ DO NOT USE

Note: The old /personal-trading-history/:address (without -table) returned a flat array and is now deprecated. Use the new cursor-based endpoint instead.

Migration Checklist

  • Update base URL from backend.gains.tradebackend-global.gains.trade
  • Add /api prefix to all endpoints
  • Rename /personal-trading-history-table/personal-trading-history
  • Add cursor pagination
  • Update response parsing to handle { data, pagination } structure
  • Use /stats endpoint if only statistics are needed

Support

For questions or issues with migration, please contact the Gains Network development team.