small changes to aid upcoming performance optimization #409

Closed
scionaltera wants to merge 2 commits from perf-prep into master
scionaltera commented 2021-05-13 16:19:08 -07:00 (Migrated from github.com)
  • timers for order execution and decision making to help us improve performance
  • changed computeVolumeScale() and computePriceScale() to use a provided default value for added flexibility
  • changed computeVolumeScale() and computePriceScale() to avoid unnecessary object creation
  • changed computeVolumeScale() and computePriceScale() to log when metadata is not available
  • some additional logging
* timers for order execution and decision making to help us improve performance * changed `computeVolumeScale()` and `computePriceScale()` to use a provided default value for added flexibility * changed `computeVolumeScale()` and `computePriceScale()` to avoid unnecessary object creation * changed `computeVolumeScale()` and `computePriceScale()` to log when metadata is not available * some additional logging
lilianchiassai (Migrated from github.com) reviewed 2021-05-13 16:19:08 -07:00
dazito (Migrated from github.com) reviewed 2021-05-15 04:51:48 -07:00
@ -420,2 +409,3 @@
final int shortVolumeScale = computeVolumeScale(spread.getShortExchange(), currencyPairShortExchange);
final int longVolumeScale = computeVolumeScale(spread.getLongExchange(), currencyPairLongExchange, SAFE_SCALE);
final int shortVolumeScale = computeVolumeScale(spread.getShortExchange(), currencyPairShortExchange, SAFE_SCALE);
dazito (Migrated from github.com) commented 2021-05-15 04:50:04 -07:00

What is the advantage of changing the scale from 8 (BTC_SCALE) to 1 (the defaultScale we pass in now)?

Are you aware this scale value will be used in TradeVolume and it's subclasses?

What is the advantage of changing the scale from 8 (BTC_SCALE) to 1 (the defaultScale we pass in now)? Are you aware this scale value will be used in `TradeVolume` and it's subclasses?
dazito (Migrated from github.com) commented 2021-05-15 04:50:20 -07:00

Same question as above:
What is the advantage of changing the scale from 8 (BTC_SCALE) to 1 (the defaultScale we pass in now)?

Same question as above: What is the advantage of changing the scale from 8 (BTC_SCALE) to 1 (the defaultScale we pass in now)?
scionaltera (Migrated from github.com) reviewed 2021-05-18 13:14:13 -07:00
@ -420,2 +409,3 @@
final int shortVolumeScale = computeVolumeScale(spread.getShortExchange(), currencyPairShortExchange);
final int longVolumeScale = computeVolumeScale(spread.getLongExchange(), currencyPairLongExchange, SAFE_SCALE);
final int shortVolumeScale = computeVolumeScale(spread.getShortExchange(), currencyPairShortExchange, SAFE_SCALE);
scionaltera (Migrated from github.com) commented 2021-05-18 13:14:13 -07:00

Not all coins accept 8 decimal places when placing orders, but almost all of them should accept 1 decimal place. The idea was to find a default that is the most compatible across all exchanges and all coins, and sacrificing some precision for compatibility seems worthwhile.

In a future PR I'm going to add configuration that you can use if your coin is defaulting because XChange doesn't have metadata for it but you want something other than 1.

Not all coins accept 8 decimal places when placing orders, but almost all of them should accept 1 decimal place. The idea was to find a default that is the most compatible across all exchanges and all coins, and sacrificing some precision for compatibility seems worthwhile. In a future PR I'm going to add configuration that you can use if your coin is defaulting because XChange doesn't have metadata for it but you want something other than 1.
scionaltera commented 2021-05-21 11:00:40 -07:00 (Migrated from github.com)

I have several changes I’ve been working on and I think it’s best to break them up into several smaller PRs.

I have several changes I’ve been working on and I think it’s best to break them up into several smaller PRs.
Commenting is not possible because the repository is archived.
No description provided.