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

following error is prompted when start application #4

Open
crazybits opened this issue Jul 16, 2018 · 6 comments
Open

following error is prompted when start application #4

crazybits opened this issue Jul 16, 2018 · 6 comments

Comments

@crazybits
Copy link

crazybits commented Jul 16, 2018

following error is prompted when start application, any idea?

my config is as below link:
https://github.com/crazybits/bitshares-pricefeed-js/blob/master/config.yml

2018-07-16 06:07:46 GMT - [LOG] Starting pricefeed run                                                                                  
2018-07-16 06:07:46 GMT - [INFO] Config file loaded.                                                                                    
2018-07-16 06:07:50 GMT - [INFO] Pricefeed class initialised.                                                                           
2018-07-16 06:07:50 GMT - [INFO] Setting up pricefeed sources...                                                                        
2018-07-16 06:07:51 GMT - [VERBOSE] Source: CurrencyLayer - Cache file updated.                                                         
2018-07-16 06:07:51 GMT - [VERBOSE] Source: CurrencyLayer - Source loaded.                                                              
2018-07-16 06:07:51 GMT - [VERBOSE] Source: BitcoinAverage - Cache file updated.                                                        
2018-07-16 06:07:51 GMT - [VERBOSE] Source: BitcoinAverage - Source loaded.                                                             
2018-07-16 06:07:51 GMT - [VERBOSE] Source: Zb - Cache file updated.                                                                    
2018-07-16 06:07:51 GMT - [VERBOSE] Source: Zb - Source loaded.                                                                         
2018-07-16 06:07:52 GMT - [LOG] Connected to DEX: wss://bitshares.openledger.info/ws                                                    
2018-07-16 06:07:53 GMT - [LOG] Connected to DEX: wss://bitshares.openledger.info/ws                                                    
2018-07-16 06:07:53 GMT - [VERBOSE] Source: Graphene - Cache file updated.                                                              
2018-07-16 06:07:53 GMT - [VERBOSE] Source: Graphene - Source loaded.                                                                   
2018-07-16 06:07:53 GMT - [VERBOSE] Source: Coinmarketcap - Cache file updated.                                                         
2018-07-16 06:07:53 GMT - [VERBOSE] Source: Coinmarketcap - Source loaded.                                                              
2018-07-16 06:07:54 GMT - [VERBOSE] Source: Lbank - Cache file updated.                                                                 
2018-07-16 06:07:54 GMT - [VERBOSE] Source: Lbank - Source loaded.                                                                      
2018-07-16 06:07:54 GMT - [INFO] Pricefeed sources setup complete.                                                                      
2018-07-16 06:07:54 GMT - [INFO] Calculating prices...                                                                                  
2018-07-16 06:07:54 GMT - [VERBOSE] Calculating price for: BTC...                                                                       
2018-07-16 06:07:54 GMT - [INFO] Deriving BTC price feed.                                                                               
2018-07-16 06:07:55 GMT - [VERBOSE] Adding pricefeed data for BTC.                                                                      
2018-07-16 06:07:55 GMT - [VERBOSE] Price for: BTC calculated.                                                                          
2018-07-16 06:07:55 GMT - [VERBOSE] Calculating price for: USD...                                                                       
2018-07-16 06:07:55 GMT - [INFO] Deriving USD price feed.                                                                               
2018-07-16 06:07:55 GMT - [VERBOSE] Adding pricefeed data for USD.                                                                      
2018-07-16 06:07:55 GMT - [VERBOSE] Price for: USD calculated.                                                                          
2018-07-16 06:07:55 GMT - [VERBOSE] Calculating price for: CNY...                                                                       
2018-07-16 06:07:55 GMT - [INFO] Deriving CNY price feed.                                                                               
2018-07-16 06:07:56 GMT - [VERBOSE] Adding pricefeed data for CNY.                                                                      
2018-07-16 06:07:56 GMT - [VERBOSE] Price for: CNY calculated.                                                                          
2018-07-16 06:07:56 GMT - [VERBOSE] Calculating price for: TRY...                                                                       
2018-07-16 06:07:56 GMT - [INFO] Deriving TRY price feed.                                                                               
2018-07-16 06:07:56 GMT - [WARNING] backing symbol 'BTS' not in this.data['TRY']                                                        
2018-07-16 06:07:56 GMT - [VERBOSE] Price for: TRY calculated.                                                                          
2018-07-16 06:07:56 GMT - [VERBOSE] Calculating price for: RUBLE...                                                                     
2018-07-16 06:07:56 GMT - [INFO] Deriving RUBLE price feed.                                                                             
2018-07-16 06:07:57 GMT - [WARNING] backing symbol 'BTS' not in this.data['RUBLE']                                                      
2018-07-16 06:07:57 GMT - [VERBOSE] Price for: RUBLE calculated.                                                                        
2018-07-16 06:07:57 GMT - [VERBOSE] Calculating price for: EUR...                                                                       
2018-07-16 06:07:57 GMT - [INFO] Deriving EUR price feed.                                                                               
2018-07-16 06:07:57 GMT - [VERBOSE] Adding pricefeed data for EUR.                                                                      
2018-07-16 06:07:57 GMT - [VERBOSE] Price for: EUR calculated.                                                                          
2018-07-16 06:07:57 GMT - [VERBOSE] Calculating price for: AUD...                                                                       
2018-07-16 06:07:57 GMT - [INFO] Deriving AUD price feed.                                                                               
2018-07-16 06:07:58 GMT - [WARNING] backing symbol 'BTS' not in this.data['AUD']                                                        
2018-07-16 06:07:58 GMT - [VERBOSE] Price for: AUD calculated.                                                                          
2018-07-16 06:07:58 GMT - [VERBOSE] Calculating price for: JPY...                                                                       
2018-07-16 06:07:58 GMT - [INFO] Deriving JPY price feed.                                                                               
2018-07-16 06:07:58 GMT - [WARNING] backing symbol 'BTS' not in this.data['JPY']                                                        
2018-07-16 06:07:58 GMT - [VERBOSE] Price for: JPY calculated.                                                                          
2018-07-16 06:07:58 GMT - [VERBOSE] Calculating price for: CHF...                                                                       
2018-07-16 06:07:58 GMT - [INFO] Deriving CHF price feed.                                                                               
2018-07-16 06:07:59 GMT - [WARNING] backing symbol 'BTS' not in this.data['CHF']                                                        
2018-07-16 06:07:59 GMT - [VERBOSE] Price for: CHF calculated.                                                                          
2018-07-16 06:07:59 GMT - [VERBOSE] Calculating price for: MXN...                                                                       
2018-07-16 06:07:59 GMT - [INFO] Deriving MXN price feed.                                                                               
2018-07-16 06:07:59 GMT - [WARNING] backing symbol 'BTS' not in this.data['MXN']                                                        
2018-07-16 06:07:59 GMT - [VERBOSE] Price for: MXN calculated.                                                                          
2018-07-16 06:07:59 GMT - [VERBOSE] Calculating price for: GBP...                                                                       
2018-07-16 06:07:59 GMT - [INFO] Deriving GBP price feed.                                                                               
2018-07-16 06:08:00 GMT - [WARNING] backing symbol 'BTS' not in this.data['GBP']                                                        
2018-07-16 06:08:00 GMT - [VERBOSE] Price for: GBP calculated.                                                                          
2018-07-16 06:08:00 GMT - [VERBOSE] Calculating price for: CAD...                                                                       
2018-07-16 06:08:00 GMT - [INFO] Deriving CAD price feed.                                                                               
2018-07-16 06:08:00 GMT - [WARNING] backing symbol 'BTS' not in this.data['CAD']                                                        
2018-07-16 06:08:00 GMT - [VERBOSE] Price for: CAD calculated.                                                                          
2018-07-16 06:08:00 GMT - [VERBOSE] Calculating price for: ARS...                                                                       
2018-07-16 06:08:00 GMT - [INFO] Deriving ARS price feed.                                                                               
2018-07-16 06:08:01 GMT - [WARNING] backing symbol 'BTS' not in this.data['ARS']                                                        
2018-07-16 06:08:01 GMT - [VERBOSE] Price for: ARS calculated.                                                                          
2018-07-16 06:08:01 GMT - [VERBOSE] Calculating price for: HKD...                                                                       
2018-07-16 06:08:01 GMT - [INFO] Deriving HKD price feed.                                                                               
2018-07-16 06:08:01 GMT - [WARNING] backing symbol 'BTS' not in this.data['HKD']                                                        
2018-07-16 06:08:01 GMT - [VERBOSE] Price for: HKD calculated.                                                                          
2018-07-16 06:08:01 GMT - [VERBOSE] Calculating price for: SEK...                                                                       
2018-07-16 06:08:01 GMT - [INFO] Deriving SEK price feed.                                                                               
2018-07-16 06:08:02 GMT - [WARNING] backing symbol 'BTS' not in this.data['SEK']                                                        
2018-07-16 06:08:02 GMT - [VERBOSE] Price for: SEK calculated.                                                                          
2018-07-16 06:08:02 GMT - [VERBOSE] Calculating price for: SGD...                                                                       
2018-07-16 06:08:02 GMT - [INFO] Deriving SGD price feed.                                                                               
2018-07-16 06:08:03 GMT - [WARNING] backing symbol 'BTS' not in this.data['SGD']                                                        
2018-07-16 06:08:03 GMT - [VERBOSE] Price for: SGD calculated.                                                                          
2018-07-16 06:08:03 GMT - [VERBOSE] Calculating price for: NZD...                                                                       
2018-07-16 06:08:03 GMT - [INFO] Deriving NZD price feed.                                                                               
2018-07-16 06:08:04 GMT - [WARNING] backing symbol 'BTS' not in this.data['NZD']                                                        
2018-07-16 06:08:04 GMT - [VERBOSE] Price for: NZD calculated.                                                                          
2018-07-16 06:08:04 GMT - [VERBOSE] Calculating price for: KRW...                                                                       
2018-07-16 06:08:04 GMT - [INFO] Deriving KRW price feed.                                                                               
2018-07-16 06:08:05 GMT - [WARNING] backing symbol 'BTS' not in this.data['KRW']                                                        
2018-07-16 06:08:05 GMT - [VERBOSE] Price for: KRW calculated.                                                                          
2018-07-16 06:08:05 GMT - [VERBOSE] Calculating price for: RUB...                                                                       
2018-07-16 06:08:05 GMT - [INFO] Deriving RUB price feed.                                                                               
2018-07-16 06:08:05 GMT - [WARNING] backing symbol 'BTS' not in this.data['RUB']                                                        
2018-07-16 06:08:05 GMT - [VERBOSE] Price for: RUB calculated.                                                                          
2018-07-16 06:08:05 GMT - [VERBOSE] Calculating price for: GOLD...                                                                      
2018-07-16 06:08:05 GMT - [INFO] Deriving GOLD price feed.                                                                              
2018-07-16 06:08:06 GMT - [WARNING] backing symbol 'BTS' not in this.data['GOLD']                                                       
2018-07-16 06:08:06 GMT - [VERBOSE] Price for: GOLD calculated.                                                                         
2018-07-16 06:08:06 GMT - [VERBOSE] Calculating price for: SILVER...                                                                    
2018-07-16 06:08:06 GMT - [INFO] Deriving SILVER price feed.                                                                            
2018-07-16 06:08:07 GMT - [WARNING] backing symbol 'BTS' not in this.data['SILVER']                                                     
2018-07-16 06:08:07 GMT - [VERBOSE] Price for: SILVER calculated.                                                                       
2018-07-16 06:08:07 GMT - [VERBOSE] Calculating price change for: BTC...                                                                
2018-07-16 06:08:07 GMT - [VERBOSE] Price change for: BTC calculated.                                                                   
2018-07-16 06:08:07 GMT - [VERBOSE] Calculating price change for: USD...                                                                
2018-07-16 06:08:08 GMT - [VERBOSE] Price change for: USD calculated.                                                                   
2018-07-16 06:08:08 GMT - [VERBOSE] Calculating price change for: CNY...                                                                
2018-07-16 06:08:08 GMT - [VERBOSE] Price change for: CNY calculated.                                                                   
2018-07-16 06:08:08 GMT - [VERBOSE] Calculating price change for: TRY...                                                                
2018-07-16 06:08:09 GMT - [VERBOSE] Price change for: TRY calculated.                                                                   
2018-07-16 06:08:09 GMT - [VERBOSE] Calculating price change for: RUBLE...                                                              
2018-07-16 06:08:10 GMT - [VERBOSE] Price change for: RUBLE calculated.                                                                 
2018-07-16 06:08:10 GMT - [VERBOSE] Calculating price change for: EUR...                                                                
2018-07-16 06:08:11 GMT - [VERBOSE] Price change for: EUR calculated.                                                                   
2018-07-16 06:08:11 GMT - [VERBOSE] Calculating price change for: AUD...                                                                
2018-07-16 06:08:11 GMT - [VERBOSE] Price change for: AUD calculated.                                                                   
2018-07-16 06:08:11 GMT - [VERBOSE] Calculating price change for: JPY...                                                                
2018-07-16 06:08:11 GMT - [VERBOSE] Price change for: JPY calculated.                                                                   
2018-07-16 06:08:11 GMT - [VERBOSE] Calculating price change for: CHF...                                                                
2018-07-16 06:08:12 GMT - [VERBOSE] Price change for: CHF calculated.                                                                   
2018-07-16 06:08:12 GMT - [VERBOSE] Calculating price change for: MXN...                                                                
2018-07-16 06:08:13 GMT - [VERBOSE] Price change for: MXN calculated.                                                                   
2018-07-16 06:08:13 GMT - [VERBOSE] Calculating price change for: GBP...                                                                
2018-07-16 06:08:14 GMT - [VERBOSE] Price change for: GBP calculated.                                                                   
2018-07-16 06:08:14 GMT - [VERBOSE] Calculating price change for: CAD...                                                                
2018-07-16 06:08:14 GMT - [VERBOSE] Price change for: CAD calculated.                                                                   
2018-07-16 06:08:14 GMT - [VERBOSE] Calculating price change for: ARS...                                                                
2018-07-16 06:08:15 GMT - [VERBOSE] Price change for: ARS calculated.                                                                   
2018-07-16 06:08:15 GMT - [VERBOSE] Calculating price change for: HKD...                                                                
2018-07-16 06:08:15 GMT - [VERBOSE] Price change for: HKD calculated.                                                                   
2018-07-16 06:08:15 GMT - [VERBOSE] Calculating price change for: SEK...                                                                
2018-07-16 06:08:16 GMT - [VERBOSE] Price change for: SEK calculated.                                                                   
2018-07-16 06:08:16 GMT - [VERBOSE] Calculating price change for: SGD...                                                                
2018-07-16 06:08:17 GMT - [VERBOSE] Price change for: SGD calculated.                                                                   
2018-07-16 06:08:17 GMT - [VERBOSE] Calculating price change for: NZD...                                                                
2018-07-16 06:08:17 GMT - [VERBOSE] Price change for: NZD calculated.                                                                   
2018-07-16 06:08:17 GMT - [VERBOSE] Calculating price change for: KRW...                                                                
2018-07-16 06:08:18 GMT - [VERBOSE] Price change for: KRW calculated.                                                                   
2018-07-16 06:08:18 GMT - [VERBOSE] Calculating price change for: RUB...                                                                
2018-07-16 06:08:19 GMT - [VERBOSE] Price change for: RUB calculated.                                                                   
2018-07-16 06:08:19 GMT - [VERBOSE] Calculating price change for: GOLD...                                                               
2018-07-16 06:08:19 GMT - [VERBOSE] Price change for: GOLD calculated.                                                                  
2018-07-16 06:08:19 GMT - [VERBOSE] Calculating price change for: SILVER...                                                             
2018-07-16 06:08:20 GMT - [VERBOSE] Price change for: SILVER calculated.                                                                
2018-07-16 06:08:20 GMT - [INFO] Prices calculation complete.                                                                           
(node:5433) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'TRY' of undefined
    at printLog (/root/bitshares-pricefeed-js/index.js:142:19)
    at /root/bitshares-pricefeed-js/index.js:41:3
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:5433) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:5433) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

btw, this program only execute one time? need crontab if we need to keep in running in loop?

@clockworkgr
Copy link
Owner

I will look into it carefully later on but my first hunch is that this is related to the fact I haven't tested derivation across 3 markets yet (not required in my config) and thus have commented out...

Try re-adding the commented out line here:

https://github.com/clockworkgr/bitshares-pricefeed-js/blob/master/pricefeed.js#L430

and see how it performs.

@clockworkgr
Copy link
Owner

and yes....crontab is required for repeated running.

@crazybits
Copy link
Author

crazybits commented Jul 17, 2018

re-add the mentioned commented out line still not work

i add more logging , seems only can get the price of BTC, CNY,USD,and EUR
https://github.com/crazybits/bitshares-pricefeed-js/blob/master/pricefeed.js#L117

below is the printed result.

new price: CNY Price {
  base: { amount: 2729, asset_id: '1.3.113', precision: 4 },
  quote: { amount: 20000, asset_id: '1.3.0', precision: 5 },
  price: 1.3645 }
new price: TRY Price {
  base: { amount: NaN, asset_id: '1.3.107', precision: 4 },
  quote: { amount: NaN, asset_id: '1.3.0', precision: 5 },
  price: Infinity }
new price: RUBLE Price {
  base: { amount: NaN, asset_id: '1.3.1325', precision: 5 },
  quote: { amount: NaN, asset_id: '1.3.0', precision: 5 },
  price: Infinity }
2018-07-17 09:03:59 GMT+8 - [LOG] Skipping...
new price: AUD Price {
  base: { amount: NaN, asset_id: '1.3.117', precision: 4 },
  quote: { amount: NaN, asset_id: '1.3.0', precision: 5 },
  price: Infinity }
new price: JPY Price {
  base: { amount: NaN, asset_id: '1.3.119', precision: 2 },
  quote: { amount: NaN, asset_id: '1.3.0', precision: 5 },
  price: Infinity }
new price: CHF Price {
  base: { amount: NaN, asset_id: '1.3.116', precision: 4 },
  quote: { amount: NaN, asset_id: '1.3.0', precision: 5 },
  price: Infinity }
new price: MXN Price {
  base: { amount: NaN, asset_id: '1.3.114', precision: 4 },
  quote: { amount: NaN, asset_id: '1.3.0', precision: 5 },
  price: Infinity }
new price: GBP Price {
  base: { amount: NaN, asset_id: '1.3.118', precision: 4 },
  quote: { amount: NaN, asset_id: '1.3.0', precision: 5 },
  price: Infinity }
new price: CAD Price {
  base: { amount: NaN, asset_id: '1.3.115', precision: 4 },
  quote: { amount: NaN, asset_id: '1.3.0', precision: 5 },
  price: Infinity }
new price: ARS Price {
  base: { amount: NaN, asset_id: '1.3.1017', precision: 4 },
  quote: { amount: NaN, asset_id: '1.3.0', precision: 5 },
  price: Infinity }
new price: HKD Price {
  base: { amount: NaN, asset_id: '1.3.109', precision: 4 },
  quote: { amount: NaN, asset_id: '1.3.0', precision: 5 },
  price: Infinity }
new price: SEK Price {
  base: { amount: NaN, asset_id: '1.3.111', precision: 4 },
  quote: { amount: NaN, asset_id: '1.3.0', precision: 5 },
  price: Infinity }
new price: SGD Price {
  base: { amount: NaN, asset_id: '1.3.108', precision: 4 },
  quote: { amount: NaN, asset_id: '1.3.0', precision: 5 },
  price: Infinity }
new price: NZD Price {
  base: { amount: NaN, asset_id: '1.3.112', precision: 4 },
  quote: { amount: NaN, asset_id: '1.3.0', precision: 5 },
  price: Infinity }
new price: KRW Price {
  base: { amount: NaN, asset_id: '1.3.102', precision: 4 },
  quote: { amount: NaN, asset_id: '1.3.0', precision: 5 },
  price: Infinity }
new price: RUB Price {
  base: { amount: NaN, asset_id: '1.3.110', precision: 4 },
  quote: { amount: NaN, asset_id: '1.3.0', precision: 5 },
  price: Infinity }
new price: GOLD Price {
  base: { amount: NaN, asset_id: '1.3.106', precision: 6 },
  quote: { amount: NaN, asset_id: '1.3.0', precision: 5 },
  price: Infinity }
new price: SILVER Price {
  base: { amount: NaN, asset_id: '1.3.105', precision: 4 },
  quote: { amount: NaN, asset_id: '1.3.0', precision: 5 },
  price: Infinity }

@clockworkgr
Copy link
Owner

Ok , so def a 3 market derivation problem.

As I said...hadn't tested it yet, thats why it was commented out..I'll get round to it and sort it out soon , then push a new version

@crazybits
Copy link
Author

@clockworkgr any good news?

@clockworkgr
Copy link
Owner

working on it..

for a start: config.yml , change base: to bases: in currencylayer config cause it's not picking it up.

But tehre's more...still debugging

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

2 participants