Skip to content
This repository was archived by the owner on Feb 15, 2022. It is now read-only.

Why are products loaded outside of zenbot? #1354

Open
station384 opened this issue Feb 16, 2018 · 1 comment
Open

Why are products loaded outside of zenbot? #1354

station384 opened this issue Feb 16, 2018 · 1 comment

Comments

@station384
Copy link
Contributor

I've been working on a couple of exchanges, and coding on them, and I keep coming up with the same question. Why is products of each exchange not created dynamically, and then cached in memory and then update the products.json cache.

I can see the idea of having them in a file, so external apps can read them without loading the exchange.js and querying it, but shouldn't there be a way either in the engine (making a call to a new function updateProducts?), or in the exchange code that says update products?

The reason this comes up is in the exchanges I've worked with, the min buy / sell and increment changes dynamically with the current price of the product, so there is times where it miscalculates, and the only way to resolve it is to exit zen, regenerate the products and reload zen.

Doing this would also eliminate the pulls that contain just update products on an exchange.

Is there another reason that I am unaware of for having the external products.json?

@station384
Copy link
Contributor Author

To answer my own question. Its a catch-22 problem. the engine isn't loaded to the point where it can call the client and then get a result asynchronously, it needs it synchronous. The whole engine would need to be reworked to support promises from the exchanges and await a results for this to be implemented.

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

No branches or pull requests

2 participants