Class: Devilicious::Market::Kraken

Inherits:
Base
  • Object
show all
Defined in:
lib/devilicious/markets/kraken.rb

Instance Attribute Summary

Attributes inherited from Base

#order_book

Instance Method Summary collapse

Methods inherited from Base

#to_s

Instance Method Details

#fiat_currencyObject



6
7
8
# File 'lib/devilicious/markets/kraken.rb', line 6

def fiat_currency
  "EUR"
end

#refresh_order_book!Object



14
15
16
17
18
19
20
21
22
# File 'lib/devilicious/markets/kraken.rb', line 14

def refresh_order_book!
  json = get_json("https://api.kraken.com/0/public/Depth?pair=XBT#{fiat_currency}") or return

  asks = format_asks_bids(json["result"]["XXBTZ#{fiat_currency}"]["asks"])
  bids = format_asks_bids(json["result"]["XXBTZ#{fiat_currency}"]["bids"])

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

#trade_feeObject



10
11
12
# File 'lib/devilicious/markets/kraken.rb', line 10

def trade_fee
  BigDecimal.new("0.0035").freeze # 0.35%
end