Exchange v0.1.1 Exchange.Trade View Source

Placeholder to define trades

Link to this section Summary

Functions

Function that creates a trade given two matching orders

Link to this section Functions

Link to this function

generate_trade(order, matched_order, type)

View Source

Specs

generate_trade(
  order :: Exchange.Order.order(),
  matched_order :: Exchange.Order.order(),
  type :: atom()
) :: Exchange.Trade

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