Class: Ubea::Exchange::AnxBtcBase

Inherits:
Base
  • Object
show all
Defined in:
lib/ubea/exchanges/anx_btc_base.rb

Direct Known Subclasses

AnxBtcChf

Instance Attribute Summary

Attributes inherited from Base

#last_rtt, #order_book, #updated_at

Instance Method Summary collapse

Methods inherited from Base

#balance, #id, #short_name

Instance Method Details

#nameObject



6
7
8
# File 'lib/ubea/exchanges/anx_btc_base.rb', line 6

def name
  "ANXBTC (#{fiat_currency})"
end

#refresh_order_book!Object



14
15
16
17
18
19
20
21
22
# File 'lib/ubea/exchanges/anx_btc_base.rb', line 14

def refresh_order_book!
  json = get_json("https://anxpro.com/api/2/BTC#{fiat_currency}/money/depth/full") or return

  asks = format_asks_bids(json["data"]["asks"])
  bids = format_asks_bids(json["data"]["bids"])

  mark_as_refreshed
  @order_book = OrderBook.new(asks: asks, bids: bids)
end

#trade_feeObject



10
11
12
# File 'lib/ubea/exchanges/anx_btc_base.rb', line 10

def trade_fee
  BigDecimal.new("0.005").freeze # 0.5%??? - see https://anxbtc.com/faq#tab1
end