9 #include "../PriceXchg.hpp"
12 namespace tvm {
namespace xchg {
30 [[maybe_unused]]
auto [idx, ord] = ord_idx;
33 if (!is_active_time(ord.order_finish_time)) {
56 void on_deal(uint128 deal_amount, uint128 costs, uint128 lend_spent) {
57 auto& ord_idx = cur();
58 [[maybe_unused]]
auto& [idx, ord] = ord_idx;
59 ord.amount -= deal_amount;
61 ord.lend_amount -= lend_spent;
Working version of orders_queue with cached head order.
Definition: orders_queue.hpp:40
void pop()
Pop front order.
Definition: orders_queue.hpp:59
bool empty() const
Is queue empty.
Definition: orders_queue.hpp:46
OrderInfoXchgWithIdx & front_with_idx()
Get queue head (front) with caching.
Definition: orders_queue.hpp:49
Processing orders queue state for PriceXchg.
Definition: process_queue_state.hpp:17
void on_expired(OrderInfoXchgWithIdx ord_idx, bool sell)
Definition: process_queue_state.hpp:45
bool overlimit() const
If we hit deals or messages limit.
Definition: process_queue_state.hpp:148
void on_order_done(OrderInfoXchgWithIdx ord_idx, bool sell)
When order is done.
Definition: process_queue_state.hpp:90
void on_out_of_evers(OrderInfoXchgWithIdx ord_idx, bool sell)
Definition: process_queue_state.hpp:65
bool is_order_done(OrderInfoXchg ord) const
Is the order done? Means the remaining amount is less than min_amount or minor_cost can't be calculat...
Definition: process_queue_state.hpp:143
Tip3/tip3 exchange orders iterator.
Definition: xchg_iterator.hpp:16
orders_queue_cached & orders_
Orders queue.
Definition: xchg_iterator.hpp:81
process_queue_state & state_
Processing orders queue state for PriceXchg.
Definition: xchg_iterator.hpp:80
bool sell_
Is it a sell order.
Definition: xchg_iterator.hpp:83
xchg_iterator(process_queue_state &state, orders_queue_cached &orders, uint128 deal_costs, bool sell)
Definition: xchg_iterator.hpp:18
void on_deal(uint128 deal_amount, uint128 costs, uint128 lend_spent)
When deal is completed.
Definition: xchg_iterator.hpp:56
bool first_active()
Move to the first active order in the queue.
Definition: xchg_iterator.hpp:27
uint128 deal_costs_
Deal processing costs.
Definition: xchg_iterator.hpp:82
void drop_with_ooc()
When order is out-of-evers.
Definition: xchg_iterator.hpp:75
Class for orders queue for PriceXchg.
tip3-tip3 exchange order info
Definition: PriceXchg.hpp:54