Skip to main content
This page outlines caching durations for various GM Backend API endpoints, establishing performance parameters while balancing freshness requirements.

Markets

Endpoints: Get Market Data for All Supported Assets | Get Market Data for an Asset
  • Cache Duration: 1 minute
  • Market data is relatively static. A 1-minute cache strikes a balance between performance and freshness.

OHLC

Endpoint: Get OHLC Data for an Asset
  • Cache Duration: 1 second
  • Data Delay: Underlying OHLC data may itself be delayed by up to 5-10 seconds
  • Effective Lag: Up to 11 seconds
  • This design reduces load while ensuring users have access to consistent, batched candlestick data.
For real-time OHLC updates, see OHLC Streaming Endpoint.

Latest Prices

Endpoints: Get Current Prices for All Supported Assets | Get Current Price for an Asset | Get Enhanced Prices for All Supported Assets
  • Cache Duration: 1 second
  • Price queries are the most latency-sensitive. The cache is kept minimal to support near-real-time pricing while still providing performance benefits.
For real-time price streaming updates, see Price Streaming Endpoint.

Trading Limits

Endpoint: Get Trading Limits
  • Cache Duration: None
  • These values are critical for risk management and must always reflect the latest state.

Session Limits

Endpoint: Get Session Limits
  • Cache Duration: 1 minute
  • Session limits are relatively static, so a 1-minute cache strikes a balance between performance and freshness.

All Metadata

Endpoint: Get Metadata for All Supported Assets
  • Cache Duration: 5 minutes
  • Metadata is relatively static, so a 5-minute cache strikes a balance between performance and freshness.

Shares Multiplier

Endpoint: Get Shares Multiplier History for an Asset
  • Cache Duration: 1 second
  • Shares multipliers change infrequently, but a 1-second cache supports near-real-time discovery of the shares multiplier change while still providing performance benefits.

Portfolios

Endpoints: Get All Portfolios | Get a Portfolio
  • Cache Duration: None
  • The API refreshes portfolio data in the background approximately every minute. The timestamp field of each portfolio shows the time of its last refresh.

Default Behavior

Unless otherwise specified, all GET endpoints default to:
  • Cache Duration: 1 minute
  • This ensures consistency across the API and reduces the need for endpoint-specific caching rules.