BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
market_history_plugin.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Cryptonomex, Inc., and contributors.
3  *
4  * The MIT License
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  */
24 #pragma once
25 
26 #include <graphene/app/plugin.hpp>
29 
30 #include <fc/thread/future.hpp>
31 #include <fc/uint128.hpp>
32 
33 #include <boost/multi_index/composite_key.hpp>
34 
35 namespace graphene { namespace market_history {
36 using namespace chain;
37 
38 //
39 // Plugins should #define their SPACE_ID's so plugins with
40 // conflicting SPACE_ID assignments can be compiled into the
41 // same binary (by simply re-assigning some of the conflicting #defined
42 // SPACE_ID's in a build script).
43 //
44 // Assignment of SPACE_ID's cannot be done at run-time because
45 // various template automagic depends on them being known at compile
46 // time.
47 //
48 #ifndef MARKET_HISTORY_SPACE_ID
49 #define MARKET_HISTORY_SPACE_ID 5
50 #endif
51 
53 {
58  // LP = liquidity pool
62 };
63 
64 struct bucket_key
65 {
66  bucket_key( asset_id_type a, asset_id_type b, uint32_t s, fc::time_point_sec o )
67  :base(a),quote(b),seconds(s),open(o){}
69 
70  asset_id_type base;
71  asset_id_type quote;
72  uint32_t seconds = 0;
74 
75  friend bool operator < ( const bucket_key& a, const bucket_key& b )
76  {
77  return std::tie( a.base, a.quote, a.seconds, a.open ) < std::tie( b.base, b.quote, b.seconds, b.open );
78  }
79  friend bool operator == ( const bucket_key& a, const bucket_key& b )
80  {
81  return std::tie( a.base, a.quote, b.seconds, a.open ) == std::tie( b.base, b.quote, b.seconds, b.open );
82  }
83 };
84 
85 struct bucket_object : public abstract_object<bucket_object, MARKET_HISTORY_SPACE_ID, bucket_object_type>
86 {
87  price high()const { return asset( high_base, key.base ) / asset( high_quote, key.quote ); }
88  price low()const { return asset( low_base, key.base ) / asset( low_quote, key.quote ); }
89 
101 };
102 
103 struct history_key {
104  asset_id_type base;
105  asset_id_type quote;
106  int64_t sequence = 0;
107 
108  friend bool operator < ( const history_key& a, const history_key& b ) {
109  return std::tie( a.base, a.quote, a.sequence ) < std::tie( b.base, b.quote, b.sequence );
110  }
111  friend bool operator == ( const history_key& a, const history_key& b ) {
112  return std::tie( a.base, a.quote, a.sequence ) == std::tie( b.base, b.quote, b.sequence );
113  }
114 };
115 struct order_history_object : public abstract_object<order_history_object,
116  MARKET_HISTORY_SPACE_ID, order_history_object_type>
117 {
121 };
123 {
124  using result_type = asset_id_type;
125  result_type operator()(const order_history_object& o)const { return o.key.base; }
126 };
128 {
129  using result_type = asset_id_type;
130  result_type operator()(const order_history_object& o)const { return o.key.quote; }
131 };
133 {
134  using result_type = int64_t;
136 };
137 
138 struct market_ticker_object : public abstract_object<market_ticker_object,
139  MARKET_HISTORY_SPACE_ID, market_ticker_object_type>
140 {
141  asset_id_type base;
142  asset_id_type quote;
147  fc::uint128_t base_volume;
148  fc::uint128_t quote_volume;
149 };
150 
151 struct market_ticker_meta_object : public abstract_object<market_ticker_meta_object,
152  MARKET_HISTORY_SPACE_ID, market_ticker_meta_object_type>
153 {
155  bool skip_min_order_his_id = false;
156 };
157 
158 struct by_key;
159 using bucket_object_multi_index_type = multi_index_container<
161  indexed_by<
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 > >
164  >
165 >;
166 
167 struct by_market_time;
168 using order_history_multi_index_type = multi_index_container<
170  indexed_by<
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 > >,
173  ordered_unique<
174  tag<by_market_time>,
175  composite_key<
179  member<order_history_object, time_point_sec, &order_history_object::time>,
181  >,
182  composite_key_compare<
183  std::less< asset_id_type >,
184  std::less< asset_id_type >,
185  std::greater< time_point_sec >,
186  std::less< int64_t >
187  >
188  >
189  >
190 >;
191 
192 struct by_market;
193 struct by_volume;
194 using market_ticker_obj_mlti_idx_type = multi_index_container<
196  indexed_by<
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 > >,
200  ordered_unique<
201  tag<by_market>,
202  composite_key<
204  member<market_ticker_object, asset_id_type, &market_ticker_object::base>,
205  member<market_ticker_object, asset_id_type, &market_ticker_object::quote>
206  >
207  >
208  >
209 >;
210 
214 
215 
217 struct liquidity_pool_history_object : public abstract_object<liquidity_pool_history_object,
218  MARKET_HISTORY_SPACE_ID, lp_history_object_type>
219 {
220  liquidity_pool_id_type pool;
221  uint64_t sequence = 0;
223  int64_t op_type;
225 };
226 
227 struct by_pool_seq;
228 struct by_pool_time;
229 struct by_pool_op_type_seq;
230 struct by_pool_op_type_time;
231 
232 using lp_history_multi_index_type = multi_index_container<
234  indexed_by<
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>
240  >,
241  composite_key_compare<
242  std::less< liquidity_pool_id_type >,
243  std::greater< uint64_t >
244  >
245  >,
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>
251  >,
252  composite_key_compare<
253  std::less< liquidity_pool_id_type >,
254  std::greater< time_point_sec >,
255  std::greater< uint64_t >
256  >
257  >,
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>
263  >,
264  composite_key_compare<
265  std::less< liquidity_pool_id_type >,
266  std::less< int64_t >,
267  std::greater< uint64_t >
268  >
269  >,
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>
276  >,
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 >
282  >
283  >
284  >
285 >;
286 
288 
289 
291 struct lp_ticker_meta_object : public abstract_object<lp_ticker_meta_object,
292  MARKET_HISTORY_SPACE_ID, lp_ticker_meta_object_type>
293 {
295  bool skip_min_lp_his_id = false;
296 };
297 
299 
301 struct liquidity_pool_ticker_object : public abstract_object<liquidity_pool_ticker_object,
302  MARKET_HISTORY_SPACE_ID, lp_ticker_object_type>
303 {
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;
342 };
343 
344 using lp_ticker_multi_index_type = multi_index_container<
346  indexed_by<
347  ordered_unique< tag<by_id>, member< object, object_id_type, &object::id > >
348  >
349 >;
350 
352 
353 
354 namespace detail
355 {
357 }
358 
365 {
366  public:
368  ~market_history_plugin() override;
369 
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;
377 
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;
382 
383  private:
384  std::unique_ptr<detail::market_history_plugin_impl> my;
385 };
386 
387 } } //graphene::market_history
388 
389 // Other objects aren't mapped here because they are not used
391 
392 FC_REFLECT( graphene::market_history::history_key, (base)(quote)(sequence) )
396  (key)
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) )
403  (base)(quote)
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) )
414  (_24h_deposit_count)
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)
452  )
graphene::market_history::lp_ticker_meta_object_type
@ lp_ticker_meta_object_type
Definition: market_history_plugin.hpp:60
graphene::market_history::liquidity_pool_ticker_object
Stores ticker data for liquidity pools.
Definition: market_history_plugin.hpp:301
graphene::market_history::market_ticker_object::last_day_quote
share_type last_day_quote
Definition: market_history_plugin.hpp:144
uint128.hpp
graphene::market_history::order_history_object_key_sequence_extractor
Definition: market_history_plugin.hpp:132
graphene::market_history::order_history_object_key_quote_extractor::operator()
result_type operator()(const order_history_object &o) const
Definition: market_history_plugin.hpp:130
graphene::market_history::market_ticker_object::latest_quote
share_type latest_quote
Definition: market_history_plugin.hpp:146
graphene::protocol::fill_order_operation
Definition: market.hpp:206
graphene::market_history::liquidity_pool_history_object::time
fc::time_point_sec time
Definition: market_history_plugin.hpp:222
graphene::market_history::liquidity_pool_ticker_object::_24h_balance_delta_a
share_type _24h_balance_delta_a
Definition: market_history_plugin.hpp:322
graphene::market_history::bucket_object::low_quote
share_type low_quote
Definition: market_history_plugin.hpp:94
graphene::market_history::bucket_object::open_base
share_type open_base
Definition: market_history_plugin.hpp:95
graphene::market_history::order_history_object::time
fc::time_point_sec time
Definition: market_history_plugin.hpp:119
graphene::market_history::order_history_object_key_quote_extractor::result_type
asset_id_type result_type
Definition: market_history_plugin.hpp:129
graphene::protocol::price
The price struct stores asset prices in the BitShares system.
Definition: asset.hpp:108
database.hpp
graphene::market_history::order_history_object::op
fill_order_operation op
Definition: market_history_plugin.hpp:120
graphene::market_history::market_ticker_object::quote
asset_id_type quote
Definition: market_history_plugin.hpp:142
graphene::market_history::order_history_object_key_quote_extractor
Definition: market_history_plugin.hpp:127
graphene::market_history::bucket_object::close_quote
share_type close_quote
Definition: market_history_plugin.hpp:98
graphene::market_history::order_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
Definition: market_history_plugin.hpp:190
graphene::market_history::bucket_object
Definition: market_history_plugin.hpp:85
MAP_OBJECT_ID_TO_TYPE
#define MAP_OBJECT_ID_TO_TYPE(OBJECT)
Definition: object_id.hpp:93
graphene::market_history::bucket_object::high_quote
share_type high_quote
Definition: market_history_plugin.hpp:92
graphene::market_history::bucket_object::high
price high() const
Definition: market_history_plugin.hpp:87
fc::operator<
bool operator<(const variant &a, const variant &b)
Definition: variant.cpp:734
plugin.hpp
graphene::market_history::history_key
Definition: market_history_plugin.hpp:103
graphene::market_history::bucket_key::bucket_key
bucket_key(asset_id_type a, asset_id_type b, uint32_t s, fc::time_point_sec o)
Definition: market_history_plugin.hpp:66
graphene::market_history::bucket_key::base
asset_id_type base
Definition: market_history_plugin.hpp:70
graphene::market_history::bucket_key::open
fc::time_point_sec open
Definition: market_history_plugin.hpp:73
graphene::market_history::lp_ticker_meta_object::rolling_min_lp_his_id
object_id_type rolling_min_lp_his_id
Definition: market_history_plugin.hpp:294
fc::seconds
microseconds seconds(int64_t s)
Definition: time.hpp:34
graphene::market_history::bucket_object::low_base
share_type low_base
Definition: market_history_plugin.hpp:93
graphene::db::abstract_object
Definition: object.hpp:107
graphene::market_history::bucket_object::key
bucket_key key
Definition: market_history_plugin.hpp:90
graphene::app::application
Definition: application.hpp:91
graphene::market_history::market_history_object_type
market_history_object_type
Definition: market_history_plugin.hpp:52
graphene::market_history::order_history_object
Definition: market_history_plugin.hpp:115
graphene::market_history::bucket_key::seconds
uint32_t seconds
Definition: market_history_plugin.hpp:72
graphene::market_history::lp_ticker_object_type
@ lp_ticker_object_type
Definition: market_history_plugin.hpp:61
graphene::market_history::market_history_plugin
Definition: market_history_plugin.hpp:364
graphene::market_history::market_ticker_object::base_volume
fc::uint128_t base_volume
Definition: market_history_plugin.hpp:147
graphene::market_history::market_ticker_meta_object::rolling_min_order_his_id
object_id_type rolling_min_order_his_id
Definition: market_history_plugin.hpp:154
graphene::market_history::history_key::base
asset_id_type base
Definition: market_history_plugin.hpp:104
graphene::market_history::market_ticker_meta_object_type
@ market_ticker_meta_object_type
Definition: market_history_plugin.hpp:57
graphene::market_history::bucket_key::quote
asset_id_type quote
Definition: market_history_plugin.hpp:71
graphene::market_history::lp_history_multi_index_type
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
Definition: market_history_plugin.hpp:285
graphene::market_history::bucket_object::high_base
share_type high_base
Definition: market_history_plugin.hpp:91
graphene::app::plugin
Definition: plugin.hpp:100
FC_REFLECT_DERIVED
#define FC_REFLECT_DERIVED(TYPE, INHERITS, MEMBERS)
Specializes fc::reflector for TYPE where type inherits other reflected classes.
Definition: reflect.hpp:305
graphene::market_history::market_ticker_object::latest_base
share_type latest_base
Definition: market_history_plugin.hpp:145
graphene::market_history::order_history_object_key_base_extractor::result_type
asset_id_type result_type
Definition: market_history_plugin.hpp:124
graphene::market_history::market_ticker_object_type
@ market_ticker_object_type
Definition: market_history_plugin.hpp:56
graphene::market_history::liquidity_pool_history_object::op
operation_history_object op
Definition: market_history_plugin.hpp:224
fc::time_point_sec
Definition: time.hpp:74
graphene::market_history::market_ticker_obj_mlti_idx_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
Definition: market_history_plugin.hpp:209
graphene::market_history::bucket_key::bucket_key
bucket_key()
Definition: market_history_plugin.hpp:68
graphene::market_history::bucket_object::open_quote
share_type open_quote
Definition: market_history_plugin.hpp:96
graphene::market_history::lp_ticker_multi_index_type
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
Definition: market_history_plugin.hpp:349
graphene::market_history::bucket_object_multi_index_type
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
Definition: market_history_plugin.hpp:165
graphene::market_history::bucket_object::base_volume
share_type base_volume
Definition: market_history_plugin.hpp:99
graphene::market_history::order_history_object_key_sequence_extractor::result_type
int64_t result_type
Definition: market_history_plugin.hpp:134
graphene::market_history::bucket_object::close_base
share_type close_base
Definition: market_history_plugin.hpp:97
graphene::protocol::share_type
safe< int64_t > share_type
Definition: types.hpp:309
graphene::market_history::market_ticker_object::last_day_base
share_type last_day_base
Definition: market_history_plugin.hpp:143
graphene::market_history::bucket_object_type
@ bucket_object_type
Definition: market_history_plugin.hpp:55
graphene::market_history::history_key::quote
asset_id_type quote
Definition: market_history_plugin.hpp:105
graphene::market_history::order_history_object_key_base_extractor::operator()
result_type operator()(const order_history_object &o) const
Definition: market_history_plugin.hpp:125
future.hpp
graphene::market_history::liquidity_pool_history_object::op_type
int64_t op_type
Definition: market_history_plugin.hpp:223
graphene::market_history::bucket_key
Definition: market_history_plugin.hpp:64
graphene::db::object_id_type
Definition: object_id.hpp:30
operation_history_object.hpp
graphene::db::object_id
Definition: object_id.hpp:103
graphene::market_history::bucket_object::low
price low() const
Definition: market_history_plugin.hpp:88
graphene::market_history::lp_ticker_meta_object
Stores meta data for liquidity pool tickers.
Definition: market_history_plugin.hpp:291
FC_REFLECT
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition: reflect.hpp:388
graphene::db::generic_index
Definition: generic_index.hpp:43
graphene::market_history::liquidity_pool_history_object
Definition: market_history_plugin.hpp:217
graphene::market_history::market_ticker_object::base
asset_id_type base
Definition: market_history_plugin.hpp:141
graphene::market_history::order_history_object_key_sequence_extractor::operator()
result_type operator()(const order_history_object &o) const
Definition: market_history_plugin.hpp:135
graphene::protocol::asset
Definition: asset.hpp:31
graphene::market_history::detail::market_history_plugin_impl
Definition: market_history_plugin.cpp:43
graphene::market_history::liquidity_pool_history_object::pool
liquidity_pool_id_type pool
Definition: market_history_plugin.hpp:220
graphene::market_history::bucket_object::quote_volume
share_type quote_volume
Definition: market_history_plugin.hpp:100
graphene::market_history::market_ticker_object::quote_volume
fc::uint128_t quote_volume
Definition: market_history_plugin.hpp:148
fc::operator==
bool operator==(const optional< T > &left, const optional< T > &right)
Definition: optional.hpp:249
graphene::market_history::order_history_object_type
@ order_history_object_type
Definition: market_history_plugin.hpp:54
graphene::market_history::order_history_object_key_base_extractor
Definition: market_history_plugin.hpp:122
graphene
Definition: api.cpp:48
graphene::market_history::history_key::sequence
int64_t sequence
Definition: market_history_plugin.hpp:106
graphene::market_history::market_ticker_object
Definition: market_history_plugin.hpp:138
graphene::market_history::market_ticker_meta_object
Definition: market_history_plugin.hpp:151
graphene::market_history::lp_history_object_type
@ lp_history_object_type
Definition: market_history_plugin.hpp:59
graphene::chain::operation_history_object
tracks the history of all logical operations on blockchain state
Definition: operation_history_object.hpp:48
graphene::market_history::liquidity_pool_ticker_object::_24h_balance_delta_b
share_type _24h_balance_delta_b
Definition: market_history_plugin.hpp:323
graphene::db::object
base for all database objects
Definition: object.hpp:61
fc::safe
Definition: safe.hpp:26
graphene::market_history::order_history_object::key
history_key key
Definition: market_history_plugin.hpp:118