Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

query methods #244

Open
lastmjs opened this issue Nov 8, 2023 · 2 comments
Open

query methods #244

lastmjs opened this issue Nov 8, 2023 · 2 comments

Comments

@lastmjs
Copy link

lastmjs commented Nov 8, 2023

Can we add some query methods to this? Seems like payment should only be required to get the latest response...but couldn't old responses be cached and available once the current response has been received?

I'm sure this has been discussed, just wondering if I can bring this up.

@THLO
Copy link
Contributor

THLO commented Nov 9, 2023

Yes, this has been discussed. There is a small LRU cache of previously requested rates.
Since the cache is small, you won't be able to retrieve many old responses. On the contrary, you may only get recent rates, obviously just for pairs that were previously requested.

However, it doesn't cost much to increase the cache size and making a quick query call to check if there is a rate doesn't cost much, either. It may even be possible to increase the probability of success by asking for a rate in a certain time window (in the past).

Would it be useful to have a query endpoint that won't give you the most recent rate (as you said, payment should probably be required for this rate) and will only give you old rates in the recent past (that can be retrieved from the cache)?
If yes, do you think the cached rates should be certified?

@liucanhui-eng
Copy link

No matter what time I give, it returns (# ForexInvalidTimestamp)
What should I do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants