BitShares-Core  6.1.0
BitShares blockchain implementation and command-line interface software
market_evaluator.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
26 #include <graphene/chain/types.hpp>
27 
28 namespace graphene { namespace chain {
29 
30  class account_object;
31  class asset_object;
32  class asset_bitasset_data_object;
33  class call_order_object;
34  class limit_order_object;
35  class collateral_bid_object;
36 
37  class limit_order_create_evaluator : public evaluator<limit_order_create_evaluator>
38  {
39  public:
41 
44 
47  virtual void convert_fee() override;
48 
52  virtual void pay_fee() override;
53 
54  private:
55  share_type _deferred_fee = 0;
56  asset _deferred_paid_fee;
57  const account_object* _seller = nullptr;
58  const asset_object* _sell_asset = nullptr;
59  const asset_object* _receive_asset = nullptr;
60  };
61 
62  class limit_order_cancel_evaluator : public evaluator<limit_order_cancel_evaluator>
63  {
64  public:
66 
69 
70  private:
71  const limit_order_object* _order;
72  };
73 
74  class call_order_update_evaluator : public evaluator<call_order_update_evaluator>
75  {
76  public:
78 
81 
82  private:
83  bool _closing_order = false;
84  const asset_object* _debt_asset = nullptr;
85  const call_order_object* call_ptr = nullptr;
86  share_type new_debt;
87  share_type new_collateral;
88  const asset_bitasset_data_object* _bitasset_data = nullptr;
89  const asset_dynamic_data_object* _dynamic_data_obj = nullptr;
90  };
91 
92  class bid_collateral_evaluator : public evaluator<bid_collateral_evaluator>
93  {
94  public:
96 
99 
100  private:
101  const asset_object* _debt_asset = nullptr;
102  const asset_bitasset_data_object* _bitasset_data = nullptr;
103  const collateral_bid_object* _bid = nullptr;
104  };
105 
106 } } // graphene::chain
contains properties that only apply to bitassets (market issued assets)
This class represents an account on the object graphAccounts are the primary unit of authority on the...
Definition: api.cpp:48
tracks debt and call price information
void_result do_evaluate(const limit_order_create_operation &o)
instructs the blockchain to attempt to sell one asset for anotherThe blockchain will atempt to sell a...
Definition: market.hpp:48
tracks the asset information that changes frequentlyBecause the asset_object is very large it doesn&#39;t...
bids of collateral for debt after a black swan
tracks the parameters of an assetAll assets have a globally unique symbol name that controls how they...
object_id_type do_apply(const limit_order_create_operation &o) const
an offer to sell an amount of an asset at a specified exchange rate by a certain timeThe objects are ...