Hi, I cannot find anything about what the “current” and “limit” parameters of the Get Loan Ongoing Orders API call mean, https://binance-docs.github.io/apidocs/spot/en/#borrow-get-loan-borrow-history-user_data does not give much. I have, e.g., 20 loan orders “ongoing”, and whatever I specify for “limit” I always get those 20 as return - I would expect 8 loans when I set . So, what do those parameter mean?
Could you please give the example of how the parameters were set and how much data is returned?
Yes, Dino. Here the API calls, first with kwargs ‘current’ and ‘limit’ commented out, then with them in the call:
intLoanQueryPage = int(1)
intReturnLimit = int(10)varResponse = refApi.loan_ongoing_orders(loanCoin=strSymbolPrincipal, collateralCoin=strSymbolCollateral) #, current=intLoanQueryPage, limit=intReturnLimit)
varResponse
{‘total’: 20, ‘rows’: [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, …]}varResponse = refApi.loan_ongoing_orders(loanCoin=strSymbolPrincipal, collateralCoin=strSymbolCollateral, current=intLoanQueryPage, limit=intReturnLimit)
varResponse
{‘total’: 20, ‘rows’: [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, …]}
Same outcome, both return me my 20 loans I am having. Btw, the goal is to get all loans in cases where I have more than 100 loans, I think that I have to increment the ‘current’ argument somehow…
Update: After one week the number of returned loans had been equal to the number of the “limit” parameter, ‘10’, hence, it seemed OK. But when I re-tested again with that parameter changed to ‘100’ the endpoint would still return ‘10’, but not the actual amount of loans present, which is ‘20’. I now do suspect a bug or a caching issue in Binance side that makes the endpoint
dict = api.loan_ongoing_orders(…)
not working properly. Anyone?
And then, I am still unable to figure out the intended functionality of the parameter ‘current’ - supposed to denote a “query page”. What is that? Binance, any enlightement from you would be highly appreciated!
W.
PS: After finishing this post I ran the test again, and the correct loan amount was returned (parameter ‘limit’). So, I do suspect a caching matter which is not problematic for my solution to work as I do not update that parameter in PROD.