imrehg / lamassu-kraken

Lamassu Kraken ticker and trader.
The Unlicense
0 stars 2 forks source link

Handle asserting valid currencies for trading #2

Open imrehg opened 10 years ago

imrehg commented 10 years ago

Need to figure out how to handle exceptions when wrong currency is passed to the trading module (can do only EUR and USD). Lamassu-bitstamp does not have enough info there to know what is expected.

In the wider matter of things, this is an issue of Lamassu documentation (or rather lack of) for the modules.

Any ideas how to handle this?

CrypticaScriptura commented 10 years ago

We've been rehauling the lamassu-bitstamp module to accommodate the exchange rate for whichever currency the machine is set to, as well as focusing on its stability. I would keep a watch on the lamassu-bitstamp commits for more on this. There will be some changes to how lamassu-server handles trading, which will require slight modifications to any module, but we can make these after accepting a pull request.

CrypticaScriptura commented 10 years ago

Hi @imrehg, an update on this:

trader.js has been revamped and successfully tested on a live machine. The invalid nonce issue has been fixed, and FUDGE_FACTOR is now used to perform trades at market rates, which makes the BitStamp module cross-currency: https://github.com/lamassu/lamassu-bitstamp/commit/aaa8b9fa2203108a521261c42876f935fbe0947e

Given that change, restricting config.currency here shouldn't be needed.

The current BitStamp revision can be tested by installing lamassu-server@beta.

One of our projects is creating documentation for how modules interact with lamassu-server, and we'll be glad to provide this based on our recent changes.