Flex
Flex exchange system
Classes | Public Member Functions | Public Attributes | List of all members
dealer Class Reference

Class for iterating queue and processing deals. More...

#include <dealer.hpp>

Collaboration diagram for dealer:
Collaboration graph
[legend]

Classes

struct  deal_result
 Result of make_deal. More...
 
struct  process_result
 Result of process() call. More...
 

Public Member Functions

 dealer (price_t price, address pair, Tip3Config major_tip3cfg, Tip3Config minor_tip3cfg, EversConfig ev_cfg, orders_queue sells, orders_queue buys, uint128 min_amount, unsigned deals_limit, unsigned msgs_limit, IFlexNotifyPtr notify_addr, address major_reserve_wallet, address minor_reserve_wallet)
 
process_result process (unsigned sell_idx, unsigned buy_idx)
 Process order queues and make deals.
 
deal_result make_deal (OrderInfoXchg sell, OrderInfoXchg buy)
 Make tip3/tip exchange deal.
 

Public Attributes

price_t price_
 Price (rational value)
 
address pair_
 Address of XchgPair contract.
 
Tip3Config major_tip3cfg_
 Major tip3 configuration.
 
Tip3Config minor_tip3cfg_
 Minor tip3 configuration.
 
EversConfig ev_cfg_
 Processing costs configuration (evers)
 
orders_queue sells_
 Sell orders queue.
 
orders_queue buys_
 Buy orders queue.
 
uint128 min_amount_
 Minimum amount of major tokens for a deal or an order.
 
unsigned deals_limit_
 Deals limit.
 
unsigned msgs_limit_
 Messages limit.
 
uint128 deal_costs_
 Deal costs in evers.
 
address tip3root_major_
 Address of RootTokenContract for major tip3 token.
 
address tip3root_minor_
 Address of RootTokenContract for minor tip3 token.
 
IFlexNotifyPtr notify_addr_
 Notification address for AMM.
 
address major_reserve_wallet_
 Major reserve wallet.
 
address minor_reserve_wallet_
 Minor reserve wallet.
 

Detailed Description

Class for iterating queue and processing deals.


Class Documentation

◆ tvm::xchg::dealer::deal_result

struct tvm::xchg::dealer::deal_result

Result of make_deal.

Class Members
bool buy_out_of_evers Is the buy order out of evers.
uint128 buyer_costs Buyer evers costs to be taken.
uint128 buyer_lend_spent Buyer lend tokens spent (minor tokens for buyer)
uint128 deal_amount Amount of major tokens for the deal (without fees)
bool sell_out_of_evers Is the sell order out of evers.
uint128 seller_costs Seller evers costs to be taken.
uint128 seller_lend_spent Seller lend tokens spent (major tokens for seller)
bool seller_taker Seller is a taker in deal.

◆ tvm::xchg::dealer::process_result

struct tvm::xchg::dealer::process_result

Result of process() call.

Collaboration diagram for dealer::process_result:
Class Members
orders_queue buys Buy orders queue.
opt< OrderRet > ret Return value for the called function.
orders_queue sells Sell orders queue.

Constructor & Destructor Documentation

◆ dealer()

dealer ( price_t  price,
address  pair,
Tip3Config  major_tip3cfg,
Tip3Config  minor_tip3cfg,
EversConfig  ev_cfg,
orders_queue  sells,
orders_queue  buys,
uint128  min_amount,
unsigned  deals_limit,
unsigned  msgs_limit,
IFlexNotifyPtr  notify_addr,
address  major_reserve_wallet,
address  minor_reserve_wallet 
)
inline
Parameters
pricePrice (rational value)
pairAddress of XchgPair contract
major_tip3cfgMajor tip3 configuration
minor_tip3cfgMinor tip3 configuration
ev_cfgProcessing costs configuration (evers)
sellsSell orders queue
buysBuy orders queue
min_amountMinimum amount of major tokens for a deal or an order
deals_limitDeals limit
msgs_limitMessages limit
notify_addrNotification address for AMM
major_reserve_walletMajor reserve wallet
minor_reserve_walletMinor reserve wallet

The documentation for this class was generated from the following file: