Exchange v0.2.1 Exchange.Trade View Source
Placeholder to define trades
Link to this section Summary
Functions
Decodes the payload to a Trade struct
Function that creates a trade given two matching orders
Link to this section Functions
Specs
decode_from_jason(map()) :: Exchange.Trade
Decodes the payload to a Trade struct
Parameters
- payload: map with necessary parameters to populate the struct
Specs
generate_trade( order :: Exchange.Order.order(), matched_order :: Exchange.Order.order(), type :: atom(), currency :: atom() ) :: %Exchange.Trade{ acknowledged_at: term(), buy_init_size: term(), buy_order_id: term(), buyer_id: term(), currency: term(), price: term(), sell_init_size: term(), sell_order_id: term(), seller_id: term(), size: term(), ticker: term(), trade_id: term(), type: term() }
Function that creates a trade given two matching orders
Parameters
- order: Newly placed order
- matched_order: Order that is in the
Exchange.OrderBook
that matches the newly placed order - type: Atom that can either be
:partial_fill
or:fulfill