You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The get_perpetual_market_candles method of the IndexerClient (Python v2 SDK) does not always return the last 100 candles of the given resolution. Its behavior is as follows:
Default behavior: If no limit is specified, the function returns up to 100 candles by default.
Customizable limit: You can adjust the number of candles returned by specifying a value for the limit parameter. For example:
fromdydx_v4_client.indexer.rest.indexer_clientimportIndexerClientclient=IndexerClient(TESTNET.rest_indexer)
response=awaitclient.markets.get_perpetual_market_candles(
market=MARKET_BTC_USD,
resolution=CandlesResolution.ONE_MINUTE,
limit=50# This will return up to 50 candles
)
Note that the maximum limit depends on the REST endpoint provider for the IndexerClient - some providers will limit the response size. In any case, you can further refine the data retrieval by using the from_iso and to_iso parameters to specify a specific time range and run a loop.
Hello,
I can't find precise information on that function : does it always return the last 100 candles of the given resolution ?
Thanks !
Edit : I also wonder if there is a plan to add mainnet api urls as there are only the testnet ones in the Netwokr constants.
The text was updated successfully, but these errors were encountered: