Class: Bitex::Bid

Inherits:
BaseOrder show all
Defined in:
lib/bitex/bid.rb

Overview

A Bid is an order to buy a given order book.

See Also:

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from BaseOrder

active, all, #cancel!, find

Instance Attribute Details

#amountBigDecimal



16
17
18
# File 'lib/bitex/bid.rb', line 16

def amount
  @amount
end

#created_atTime



# File 'lib/bitex/bid.rb', line 8

#idInteger



# File 'lib/bitex/bid.rb', line 5

#issuerString



# File 'lib/bitex/bid.rb', line 45

#order_bookSymbol



# File 'lib/bitex/bid.rb', line 11

#priceBigDecimal



# File 'lib/bitex/bid.rb', line 22

#produced_quantityBigDecimal

TODO: rever esta documentacion



43
44
45
# File 'lib/bitex/bid.rb', line 43

def produced_quantity
  @produced_quantity
end

#reasonObject

The cancellation reason for this Bid, if any.

  • :not_cancelled Has not been cancelled.

  • :not_enough_funds Not enough funds to place this order.

  • :user_cancelled Cancelled per user’s request

  • :system_cancelled Bitex cancelled this order, for a good reason.



# File 'lib/bitex/bid.rb', line 33

#remaining_amountBigDecimal



20
21
22
# File 'lib/bitex/bid.rb', line 20

def remaining_amount
  @remaining_amount
end

#statusObject

The status of this Bid in its lifecycle.

  • :received queued to check if you have enough funds.

  • :executing available in our ourderbook waiting to be matched.

  • :cancelling To be cancelled as soon as our trading engine unlocks it.

  • :cancelled no further executed. May have some Remaining Amount.

  • :completed Fully executed, Remaining Amount should be 0.



# File 'lib/bitex/bid.rb', line 25

Class Method Details

.create!(order_book, amount, price, wait = false) ⇒ Object

Create a new Bid for spending Amount USD paying no more than price per unit.



59
60
61
# File 'lib/bitex/bid.rb', line 59

def self.create!(order_book, amount, price, wait = false)
  super
end