31 #include <boost/multi_index/composite_key.hpp>
33 namespace graphene {
namespace chain {
52 fc::uint128_t filled_amount = 0;
55 bool is_settled_debt =
false;
58 vector< limit_order_auto_action >
on_fill;
73 if( tmp.first > tmp.second ) std::swap( tmp.first, tmp.second );
86 struct by_account_price;
87 struct by_is_settled_debt;
88 typedef multi_index_container<
91 ordered_unique< tag<by_id>, member< object, object_id_type, &object::id > >,
92 ordered_unique< tag<by_expiration>,
94 member< limit_order_object, time_point_sec, &limit_order_object::expiration>,
95 member< object, object_id_type, &object::id>
98 ordered_unique< tag<by_price>,
100 member< limit_order_object, price, &limit_order_object::sell_price>,
101 member< object, object_id_type, &object::id>
103 composite_key_compare< std::greater<price>, std::less<object_id_type> >
105 ordered_unique< tag<by_is_settled_debt>,
107 member< limit_order_object, bool, &limit_order_object::is_settled_debt >,
108 const_mem_fun< limit_order_object, asset_id_type, &limit_order_object::receive_asset_id >,
109 member< object, object_id_type, &object::id>
113 ordered_unique< tag<by_account>,
115 member<limit_order_object, account_id_type, &limit_order_object::seller>,
116 member<object, object_id_type, &object::id>
120 ordered_unique< tag<by_account_price>,
122 member<limit_order_object, account_id_type, &limit_order_object::seller>,
123 member<limit_order_object, price, &limit_order_object::sell_price>,
124 member<object, object_id_type, &object::id>
126 composite_key_compare<std::less<account_id_type>, std::greater<price>, std::less<object_id_type>>
146 asset_id_type
debt_type()
const {
return call_price.quote.asset_id; }
160 if( tmp.first > tmp.second ) std::swap( tmp.first, tmp.second );
176 const uint16_t maintenance_collateral_ratio,
188 protocol_ids, force_settlement_object_type>
207 implementation_ids, impl_collateral_bid_object_type>
212 asset_id_type
debt_type()
const {
return inv_swan_price.quote.asset_id; }
218 struct by_collateral;
221 typedef multi_index_container<
224 ordered_unique< tag<by_id>,
225 member< object, object_id_type, &object::id > >,
226 ordered_unique< tag<by_price>,
228 member< call_order_object, price, &call_order_object::call_price>,
229 member< object, object_id_type, &object::id>
231 composite_key_compare< std::less<price>, std::less<object_id_type> >
233 ordered_unique< tag<by_account>,
235 member< call_order_object, account_id_type, &call_order_object::borrower >,
236 const_mem_fun< call_order_object, asset_id_type, &call_order_object::debt_type>
239 ordered_unique< tag<by_collateral>,
241 const_mem_fun< call_order_object, price, &call_order_object::collateralization >,
242 member< object, object_id_type, &object::id >
249 typedef multi_index_container<
252 ordered_unique< tag<by_id>, member< object, object_id_type, &object::id > >,
253 ordered_unique< tag<by_account>,
255 member<force_settlement_object, account_id_type, &force_settlement_object::owner>,
256 member< object, object_id_type, &object::id >
259 ordered_unique< tag<by_expiration>,
261 const_mem_fun<force_settlement_object, asset_id_type, &force_settlement_object::settlement_asset_id>,
262 member<force_settlement_object, time_point_sec, &force_settlement_object::settlement_date>,
263 member< object, object_id_type, &object::id >
269 typedef multi_index_container<
272 ordered_unique< tag<by_id>,
273 member< object, object_id_type, &object::id > >,
274 ordered_unique< tag<by_account>,
276 const_mem_fun< collateral_bid_object, asset_id_type, &collateral_bid_object::debt_type>,
277 member< collateral_bid_object, account_id_type, &collateral_bid_object::bidder>
280 ordered_unique< tag<by_price>,
282 const_mem_fun< collateral_bid_object, asset_id_type, &collateral_bid_object::debt_type>,
283 member< collateral_bid_object, price, &collateral_bid_object::inv_swan_price >,
284 member< object, object_id_type, &object::id >
286 composite_key_compare< std::less<asset_id_type>, std::greater<price>, std::less<object_id_type> >