Documentation ¶
Index ¶
- func AddOutstandingLimitOrdersToOrderbook(ctx sdk.Context, keeper *keeper.Keeper, limitBuys []*types.Order, ...)
- func CancelOrders(ctx sdk.Context, keeper *keeper.Keeper, contract types.ContractAddress, ...)
- func MatchByValueFOKMarketOrder(ctx sdk.Context, marketOrder *types.Order, ...) ([]*types.SettlementEntry, []*types.SettlementEntry)
- func MatchFOKMarketOrder(ctx sdk.Context, marketOrder *types.Order, ...) ([]*types.SettlementEntry, []*types.SettlementEntry)
- func MatchMarketOrder(ctx sdk.Context, marketOrder *types.Order, ...) ([]*types.SettlementEntry, []*types.SettlementEntry)
- func MergeByNominalTakerSettlements(settlements []*types.SettlementEntry) []*types.SettlementEntry
- func Settle(ctx sdk.Context, takerOrder *types.Order, quantityTaken sdk.Dec, ...) ([]*types.SettlementEntry, []*types.SettlementEntry)
- func SettleFromBook(ctx sdk.Context, orderbook *types.OrderBook, executedQuantity sdk.Dec, ...) []*types.SettlementEntry
- func UpdateOrderData(takerOrder *types.Order, quantityTaken sdk.Dec, blockOrders *cache.BlockOrders)
- type ExecutionOutcome
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CancelOrders ¶
func CancelOrders( ctx sdk.Context, keeper *keeper.Keeper, contract types.ContractAddress, pair types.Pair, cancels []*types.Cancellation, )
func MatchByValueFOKMarketOrder ¶
func MatchByValueFOKMarketOrder( ctx sdk.Context, marketOrder *types.Order, orderBookEntries *types.CachedSortedOrderBookEntries, direction types.PositionDirection, totalExecuted *sdk.Dec, totalPrice *sdk.Dec, minPrice *sdk.Dec, maxPrice *sdk.Dec, settlements []*types.SettlementEntry, allTakerSettlements []*types.SettlementEntry, blockOrders *cache.BlockOrders, ) ([]*types.SettlementEntry, []*types.SettlementEntry)
func MatchFOKMarketOrder ¶
func MatchFOKMarketOrder( ctx sdk.Context, marketOrder *types.Order, orderBookEntries *types.CachedSortedOrderBookEntries, direction types.PositionDirection, totalExecuted *sdk.Dec, totalPrice *sdk.Dec, minPrice *sdk.Dec, maxPrice *sdk.Dec, settlements []*types.SettlementEntry, allTakerSettlements []*types.SettlementEntry, blockOrders *cache.BlockOrders, ) ([]*types.SettlementEntry, []*types.SettlementEntry)
func MatchMarketOrder ¶
func MatchMarketOrder( ctx sdk.Context, marketOrder *types.Order, orderBookEntries *types.CachedSortedOrderBookEntries, direction types.PositionDirection, totalExecuted *sdk.Dec, totalPrice *sdk.Dec, minPrice *sdk.Dec, maxPrice *sdk.Dec, settlements []*types.SettlementEntry, allTakerSettlements []*types.SettlementEntry, blockOrders *cache.BlockOrders, ) ([]*types.SettlementEntry, []*types.SettlementEntry)
func MergeByNominalTakerSettlements ¶
func MergeByNominalTakerSettlements(settlements []*types.SettlementEntry) []*types.SettlementEntry
func Settle ¶
func Settle( ctx sdk.Context, takerOrder *types.Order, quantityTaken sdk.Dec, orderbook *types.CachedSortedOrderBookEntries, worstPrice sdk.Dec, makerPrice sdk.Dec, ) ([]*types.SettlementEntry, []*types.SettlementEntry)
this function helps to settle market orders
func SettleFromBook ¶
func UpdateOrderData ¶
func UpdateOrderData( takerOrder *types.Order, quantityTaken sdk.Dec, blockOrders *cache.BlockOrders, )
this function update the order data in the memState to be noted that the order status will only reflect for market orders that are settled
Types ¶
type ExecutionOutcome ¶
type ExecutionOutcome struct { TotalNotional sdk.Dec TotalQuantity sdk.Dec Settlements []*types.SettlementEntry MinPrice sdk.Dec MaxPrice sdk.Dec }
func MatchLimitOrders ¶
func MatchLimitOrders( ctx sdk.Context, orderbook *types.OrderBook, ) ExecutionOutcome
func MatchMarketOrders ¶
func MatchMarketOrders( ctx sdk.Context, marketOrders []*types.Order, orderBookEntries *types.CachedSortedOrderBookEntries, direction types.PositionDirection, blockOrders *cache.BlockOrders, ) ExecutionOutcome
func (*ExecutionOutcome) Merge ¶
func (o *ExecutionOutcome) Merge(other *ExecutionOutcome) ExecutionOutcome
Click to show internal directories.
Click to hide internal directories.