title: Node.js API wrapper for altcoin exchange
body: <p>I'm trying to make a simple market maker bot and i need to use the variables bid, ask and spread in other functions to calculate what kind of buy/sell orders to create. How would i pass these variables along? Also how come i'm able to subtract (ask - bid) and not add like (bid + 0.001)</p>
  
  <p>NPM <a href="https://www.npmjs.com/package/poloniex.js" rel="nofollow">poloniex.js</a></p>
  
  <pre><code>    function getSpread() {
  
      poloniex.getTicker(function(err, data){
      if (err){
          console.log('ERROR', err);
          return;
      }
  
      var ask = data.BTC_LTC.lowestAsk;
      var bid = data.BTC_LTC.highestBid;
      var spread = ((ask - bid) / ask);
  
      console.log('Ask:', ask,'Bid:', bid,'Spread:', spread); 
  
      });
  }
  </code></pre>