Class: Devilicious::Market::Bitstamp

Inherits:
Base
  • Object
show all
Defined in:
lib/devilicious/markets/bitstamp.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



8
9
10
# File 'lib/devilicious/markets/bitstamp.rb', line 8

def fiat_currency
  "USD"
end

#refresh_order_book!Object



16
17
18
19
20
21
22
23
24
# File 'lib/devilicious/markets/bitstamp.rb', line 16

def refresh_order_book!
  json = get_json("https://www.bitstamp.net/api/order_book/") or return

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

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

#trade_feeObject



12
13
14
# File 'lib/devilicious/markets/bitstamp.rb', line 12

def trade_fee
  BigDecimal.new("0.005").freeze # 0.5% - see https://www.bitstamp.net/fee_schedule/
end