33 #include <boost/multi_index/composite_key.hpp> 35 namespace graphene {
namespace market_history {
36 using namespace chain;
48 #ifndef MARKET_HISTORY_SPACE_ID 49 #define MARKET_HISTORY_SPACE_ID 5 67 :base(a),quote(b),
seconds(s),open(o){}
106 int64_t sequence = 0;
116 MARKET_HISTORY_SPACE_ID, order_history_object_type>
139 MARKET_HISTORY_SPACE_ID, market_ticker_object_type>
152 MARKET_HISTORY_SPACE_ID, market_ticker_meta_object_type>
155 bool skip_min_order_his_id =
false;
162 ordered_unique< tag<by_id>, member< object, object_id_type, &object::id > >,
163 ordered_unique< tag<by_key>, member< bucket_object, bucket_key, &bucket_object::key > >
167 struct by_market_time;
171 ordered_unique< tag<by_id>, member< object, object_id_type, &object::id > >,
172 ordered_unique< tag<by_key>, member< order_history_object, history_key, &order_history_object::key > >,
176 order_history_object,
179 member<order_history_object, time_point_sec, &order_history_object::time>,
182 composite_key_compare<
183 std::less< asset_id_type >,
184 std::less< asset_id_type >,
185 std::greater< time_point_sec >,
197 ordered_unique< tag<by_id>, member< object, object_id_type, &object::id > >,
198 ordered_non_unique< tag<by_volume>,
199 member< market_ticker_object, fc::uint128_t, &market_ticker_object::base_volume > >,
203 market_ticker_object,
204 member<market_ticker_object, asset_id_type, &market_ticker_object::base>,
205 member<market_ticker_object, asset_id_type, &market_ticker_object::quote>
218 MARKET_HISTORY_SPACE_ID, lp_history_object_type>
221 uint64_t sequence = 0;
229 struct by_pool_op_type_seq;
230 struct by_pool_op_type_time;
235 ordered_unique< tag<by_id>, member< object, object_id_type, &object::id > >,
236 ordered_unique< tag<by_pool_seq>,
237 composite_key< liquidity_pool_history_object,
238 member<liquidity_pool_history_object, liquidity_pool_id_type, &liquidity_pool_history_object::pool>,
239 member<liquidity_pool_history_object, uint64_t, &liquidity_pool_history_object::sequence>
241 composite_key_compare<
242 std::less< liquidity_pool_id_type >,
243 std::greater< uint64_t >
246 ordered_unique< tag<by_pool_time>,
247 composite_key< liquidity_pool_history_object,
248 member<liquidity_pool_history_object, liquidity_pool_id_type, &liquidity_pool_history_object::pool>,
249 member<liquidity_pool_history_object, time_point_sec, &liquidity_pool_history_object::time>,
250 member<liquidity_pool_history_object, uint64_t, &liquidity_pool_history_object::sequence>
252 composite_key_compare<
253 std::less< liquidity_pool_id_type >,
254 std::greater< time_point_sec >,
255 std::greater< uint64_t >
258 ordered_unique< tag<by_pool_op_type_seq>,
259 composite_key< liquidity_pool_history_object,
260 member<liquidity_pool_history_object, liquidity_pool_id_type, &liquidity_pool_history_object::pool>,
261 member<liquidity_pool_history_object, int64_t, &liquidity_pool_history_object::op_type>,
262 member<liquidity_pool_history_object, uint64_t, &liquidity_pool_history_object::sequence>
264 composite_key_compare<
265 std::less< liquidity_pool_id_type >,
266 std::less< int64_t >,
267 std::greater< uint64_t >
270 ordered_unique< tag<by_pool_op_type_time>,
271 composite_key< liquidity_pool_history_object,
272 member<liquidity_pool_history_object, liquidity_pool_id_type, &liquidity_pool_history_object::pool>,
273 member<liquidity_pool_history_object, int64_t, &liquidity_pool_history_object::op_type>,
274 member<liquidity_pool_history_object, time_point_sec, &liquidity_pool_history_object::time>,
275 member<liquidity_pool_history_object, uint64_t, &liquidity_pool_history_object::sequence>
277 composite_key_compare<
278 std::less< liquidity_pool_id_type >,
279 std::less< int64_t >,
280 std::greater< time_point_sec >,
281 std::greater< uint64_t >
292 MARKET_HISTORY_SPACE_ID, lp_ticker_meta_object_type>
295 bool skip_min_lp_his_id =
false;
302 MARKET_HISTORY_SPACE_ID, lp_ticker_object_type>
304 uint32_t _24h_deposit_count = 0;
305 fc::uint128_t _24h_deposit_amount_a = 0;
306 fc::uint128_t _24h_deposit_amount_b = 0;
307 fc::uint128_t _24h_deposit_share_amount = 0;
308 uint32_t _24h_withdrawal_count = 0;
309 fc::uint128_t _24h_withdrawal_amount_a = 0;
310 fc::uint128_t _24h_withdrawal_amount_b = 0;
311 fc::uint128_t _24h_withdrawal_share_amount = 0;
312 fc::uint128_t _24h_withdrawal_fee_a = 0;
313 fc::uint128_t _24h_withdrawal_fee_b = 0;
314 uint32_t _24h_exchange_a2b_count = 0;
315 fc::uint128_t _24h_exchange_a2b_amount_a = 0;
316 fc::uint128_t _24h_exchange_a2b_amount_b = 0;
317 uint32_t _24h_exchange_b2a_count = 0;
318 fc::uint128_t _24h_exchange_b2a_amount_a = 0;
319 fc::uint128_t _24h_exchange_b2a_amount_b = 0;
320 fc::uint128_t _24h_exchange_fee_a = 0;
321 fc::uint128_t _24h_exchange_fee_b = 0;
324 uint64_t total_deposit_count = 0;
325 fc::uint128_t total_deposit_amount_a = 0;
326 fc::uint128_t total_deposit_amount_b = 0;
327 fc::uint128_t total_deposit_share_amount = 0;
328 uint64_t total_withdrawal_count = 0;
329 fc::uint128_t total_withdrawal_amount_a = 0;
330 fc::uint128_t total_withdrawal_amount_b = 0;
331 fc::uint128_t total_withdrawal_share_amount = 0;
332 fc::uint128_t total_withdrawal_fee_a = 0;
333 fc::uint128_t total_withdrawal_fee_b = 0;
334 uint64_t total_exchange_a2b_count = 0;
335 fc::uint128_t total_exchange_a2b_amount_a = 0;
336 fc::uint128_t total_exchange_a2b_amount_b = 0;
337 uint64_t total_exchange_b2a_count = 0;
338 fc::uint128_t total_exchange_b2a_amount_a = 0;
339 fc::uint128_t total_exchange_b2a_amount_b = 0;
340 fc::uint128_t total_exchange_fee_a = 0;
341 fc::uint128_t total_exchange_fee_b = 0;
347 ordered_unique< tag<by_id>, member< object, object_id_type, &object::id > >
370 std::string plugin_name()
const override;
371 void plugin_set_program_options(
372 boost::program_options::options_description& cli,
373 boost::program_options::options_description& cfg)
override;
374 void plugin_initialize(
375 const boost::program_options::variables_map& options)
override;
376 void plugin_startup()
override;
378 uint32_t max_history()
const;
379 const flat_set<uint32_t>& tracked_buckets()
const;
380 uint32_t max_order_his_records_per_market()
const;
381 uint32_t max_order_his_seconds_per_market()
const;
384 std::unique_ptr<detail::market_history_plugin_impl> my;
397 (high_base)(high_quote)
398 (low_base)(low_quote)
399 (open_base)(open_quote)
400 (close_base)(close_quote)
401 (base_volume)(quote_volume) )
404 (last_day_base)(last_day_quote)
405 (latest_base)(latest_quote)
406 (base_volume)(quote_volume) )
408 (rolling_min_order_his_id)(skip_min_order_his_id) )
410 (pool)(sequence)(time)(op_type)(op) )
412 (rolling_min_lp_his_id)(skip_min_lp_his_id) )
415 (_24h_deposit_amount_a)
416 (_24h_deposit_amount_b)
417 (_24h_deposit_share_amount)
418 (_24h_withdrawal_count)
419 (_24h_withdrawal_amount_a)
420 (_24h_withdrawal_amount_b)
421 (_24h_withdrawal_share_amount)
422 (_24h_withdrawal_fee_a)
423 (_24h_withdrawal_fee_b)
424 (_24h_exchange_a2b_count)
425 (_24h_exchange_a2b_amount_a)
426 (_24h_exchange_a2b_amount_b)
427 (_24h_exchange_b2a_count)
428 (_24h_exchange_b2a_amount_a)
429 (_24h_exchange_b2a_amount_b)
430 (_24h_exchange_fee_a)
431 (_24h_exchange_fee_b)
432 (_24h_balance_delta_a)
433 (_24h_balance_delta_b)
434 (total_deposit_count)
435 (total_deposit_amount_a)
436 (total_deposit_amount_b)
437 (total_deposit_share_amount)
438 (total_withdrawal_count)
439 (total_withdrawal_amount_a)
440 (total_withdrawal_amount_b)
441 (total_withdrawal_share_amount)
442 (total_withdrawal_fee_a)
443 (total_withdrawal_fee_b)
444 (total_exchange_a2b_count)
445 (total_exchange_a2b_amount_a)
446 (total_exchange_a2b_amount_b)
447 (total_exchange_b2a_count)
448 (total_exchange_b2a_amount_a)
449 (total_exchange_b2a_amount_b)
450 (total_exchange_fee_a)
451 (total_exchange_fee_b)
object_id_type rolling_min_lp_his_id
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
share_type _24h_balance_delta_b
tracks the history of all logical operations on blockchain stateAll operations and virtual operations...
market_history_object_type
share_type last_day_quote
#define MAP_OBJECT_ID_TO_TYPE(OBJECT)
liquidity_pool_id_type pool
operation_history_object op
bool operator==(const optional< T > &left, const optional< T > &right)
The price struct stores asset prices in the BitShares system.
microseconds seconds(int64_t s)
multi_index_container< liquidity_pool_history_object, indexed_by< ordered_unique< tag< by_id >, member< object, object_id_type, &object::id > >, ordered_unique< tag< by_pool_seq >, composite_key< liquidity_pool_history_object, member< liquidity_pool_history_object, liquidity_pool_id_type, &liquidity_pool_history_object::pool >, member< liquidity_pool_history_object, uint64_t, &liquidity_pool_history_object::sequence > >, composite_key_compare< std::less< liquidity_pool_id_type >, std::greater< uint64_t > > >, ordered_unique< tag< by_pool_time >, composite_key< liquidity_pool_history_object, member< liquidity_pool_history_object, liquidity_pool_id_type, &liquidity_pool_history_object::pool >, member< liquidity_pool_history_object, time_point_sec, &liquidity_pool_history_object::time >, member< liquidity_pool_history_object, uint64_t, &liquidity_pool_history_object::sequence > >, composite_key_compare< std::less< liquidity_pool_id_type >, std::greater< time_point_sec >, std::greater< uint64_t > > >, ordered_unique< tag< by_pool_op_type_seq >, composite_key< liquidity_pool_history_object, member< liquidity_pool_history_object, liquidity_pool_id_type, &liquidity_pool_history_object::pool >, member< liquidity_pool_history_object, int64_t, &liquidity_pool_history_object::op_type >, member< liquidity_pool_history_object, uint64_t, &liquidity_pool_history_object::sequence > >, composite_key_compare< std::less< liquidity_pool_id_type >, std::less< int64_t >, std::greater< uint64_t > > >, ordered_unique< tag< by_pool_op_type_time >, composite_key< liquidity_pool_history_object, member< liquidity_pool_history_object, liquidity_pool_id_type, &liquidity_pool_history_object::pool >, member< liquidity_pool_history_object, int64_t, &liquidity_pool_history_object::op_type >, member< liquidity_pool_history_object, time_point_sec, &liquidity_pool_history_object::time >, member< liquidity_pool_history_object, uint64_t, &liquidity_pool_history_object::sequence > >, composite_key_compare< std::less< liquidity_pool_id_type >, std::less< int64_t >, std::greater< time_point_sec >, std::greater< uint64_t > > > > > lp_history_multi_index_type
multi_index_container< order_history_object, indexed_by< ordered_unique< tag< by_id >, member< object, object_id_type, &object::id > >, ordered_unique< tag< by_key >, member< order_history_object, history_key, &order_history_object::key > >, ordered_unique< tag< by_market_time >, composite_key< order_history_object, order_history_object_key_base_extractor, order_history_object_key_quote_extractor, member< order_history_object, time_point_sec, &order_history_object::time >, order_history_object_key_sequence_extractor >, composite_key_compare< std::less< asset_id_type >, std::less< asset_id_type >, std::greater< time_point_sec >, std::less< int64_t > > > > > order_history_multi_index_type
multi_index_container< market_ticker_object, indexed_by< ordered_unique< tag< by_id >, member< object, object_id_type, &object::id > >, ordered_non_unique< tag< by_volume >, member< market_ticker_object, fc::uint128_t, &market_ticker_object::base_volume > >, ordered_unique< tag< by_market >, composite_key< market_ticker_object, member< market_ticker_object, asset_id_type, &market_ticker_object::base >, member< market_ticker_object, asset_id_type, &market_ticker_object::quote > > > > > market_ticker_obj_mlti_idx_type
fc::uint128_t base_volume
fc::uint128_t quote_volume
safe< int64_t > share_type
Stores meta data for liquidity pool tickers.
#define FC_REFLECT_DERIVED(TYPE, INHERITS, MEMBERS)
Specializes fc::reflector for TYPE where type inherits other reflected classes.
bucket_key(asset_id_type a, asset_id_type b, uint32_t s, fc::time_point_sec o)
bool operator<(const variant &a, const variant &b)
share_type _24h_balance_delta_a
base for all database objects
object_id_type rolling_min_order_his_id
multi_index_container< bucket_object, indexed_by< ordered_unique< tag< by_id >, member< object, object_id_type, &object::id > >, ordered_unique< tag< by_key >, member< bucket_object, bucket_key, &bucket_object::key > > > > bucket_object_multi_index_type
Stores ticker data for liquidity pools.
multi_index_container< liquidity_pool_ticker_object, indexed_by< ordered_unique< tag< by_id >, member< object, object_id_type, &object::id > > > > lp_ticker_multi_index_type