NOTE: Old endpoints will be fully removed Mon Dec 1. Please migrate to new endpoints.
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 Endpoint
New Endpoint
Changes
GET /trading-history-24h
GET /api/trading-history/24h?chainId={id}
Path prefix added, chainId support
Migration:
- GET https://backend-arbitrum.gains.trade/trading-history-24h+ GET https://backend-global.gains.trade/api/trading-history/24h?chainId=42161
Response Format: Unchanged (returns array of trades)
Personal Trading History
Main History Endpoint
Old Endpoint
New Endpoint
Changes
GET /personal-trading-history-table/:address
GET /api/personal-trading-history/:address?chainId=X
Path 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
Endpoint
Status
Replacement
GET /personal-trading-history/:address
DEPRECATED
Use /api/personal-trading-history/:address
GET /personal-trading-history-table/:address
DEPRECATED
Use /api/personal-trading-history/:address
GET /trading-history-24h
DEPRECATED
Use /api/trading-history/24h
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
Support
For questions or issues with migration, please contact the Gains Network development team.
- GET https://backend.gains.trade/personal-trading-history-table/0x123...
+ GET https://backend-global.gains.trade/api/personal-trading-history/0x123...?chainId=42161&limit=50
{
"data": [...], // Array of trades (same as before)
"pagination": {
"hasMore": true, // Whether more data available
"nextCursor": 123456, // Cursor for next page (null if no more)
"limit": 50 // Limit used for this request, no higher than 200
}
}