Backend Global API Migration Guide
Overview
The trading history endpoints have been migrated frombackend-[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 |
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 |
- Old: No offset
- New: Cursor-based (
?cursor=123456)
chainId(required): Chain IDcursor(optional): Pagination cursor (omit for first page)limit(optional): Max trades per request (default: 50, max: 1000)startDate(optional): ISO 8601 date filterendDate(optional): ISO 8601 date filterpair(optional): Trading pair filteraction(optional): Action type filter
Statistics Endpoint (NEW) New endpoint for trader statistics:
Batch Statistics Endpoint (NEW) New endpoint for batched trader statistics:
Batch Trading History Endpoint (NEW) New endpoint for fetching multiple addresses:
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 |
/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.trade→backend-global.gains.trade - Add
/apiprefix to all endpoints - Rename
/personal-trading-history-table→/personal-trading-history - Add cursor pagination
- Update response parsing to handle
{ data, pagination }structure - Use
/statsendpoint if only statistics are needed
