BitShares-Core  4.0.0
BitShares blockchain implementation and command-line interface software
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
graphene::chain::call_order_object Class Reference

tracks debt and call price information More...

#include <market_object.hpp>

Inheritance diagram for graphene::chain::call_order_object:
graphene::db::abstract_object< call_order_object > graphene::db::object

Public Member Functions

asset get_collateral () const
asset get_debt () const
asset amount_to_receive () const
asset_id_type debt_type () const
asset_id_type collateral_type () const
price collateralization () const
pair< asset_id_type, asset_id_type > get_market () const
share_type get_max_debt_to_cover (price match_price, price feed_price, const uint16_t maintenance_collateral_ratio, const optional< price > &maintenance_collateralization=optional< price >()) const
- Public Member Functions inherited from graphene::db::abstract_object< call_order_object >
virtual unique_ptr< objectclone () const
 these methods are implemented for derived classes by inheriting abstract_object<DerivedClass> More...
virtual void move_from (object &obj)
virtual variant to_variant () const
virtual vector< char > pack () const
- Public Member Functions inherited from graphene::db::object
 object ()
virtual ~object ()

Public Attributes

account_id_type borrower
share_type collateral
 call_price.base.asset_id, access via get_collateral More...
share_type debt
 call_price.quote.asset_id, access via get_debt More...
price call_price
 Collateral / Debt. More...
optional< uint16_t > target_collateral_ratio
 maximum CR to maintain when selling collateral on margin call More...
- Public Attributes inherited from graphene::db::object
object_id_type id

Static Public Attributes

static const uint8_t space_id = protocol_ids
static const uint8_t type_id = call_order_object_type
- Static Public Attributes inherited from graphene::db::object
static const uint8_t space_id = 0
static const uint8_t type_id = 0

Detailed Description

tracks debt and call price information

There should only be one call_order_object per asset pair per account and they will all have the same call price.

Definition at line 119 of file market_object.hpp.

Member Function Documentation

asset graphene::chain::call_order_object::amount_to_receive ( ) const

Definition at line 127 of file market_object.hpp.

asset_id_type graphene::chain::call_order_object::collateral_type ( ) const

Definition at line 129 of file market_object.hpp.

price graphene::chain::call_order_object::collateralization ( ) const

Definition at line 130 of file market_object.hpp.

asset_id_type graphene::chain::call_order_object::debt_type ( ) const

Definition at line 128 of file market_object.hpp.

asset graphene::chain::call_order_object::get_collateral ( ) const

Definition at line 125 of file market_object.hpp.

asset graphene::chain::call_order_object::get_debt ( ) const

Definition at line 126 of file market_object.hpp.

pair<asset_id_type,asset_id_type> graphene::chain::call_order_object::get_market ( ) const

Definition at line 139 of file market_object.hpp.

share_type call_order_object::get_max_debt_to_cover ( price  match_price,
price  feed_price,
const uint16_t  maintenance_collateral_ratio,
const optional< price > &  maintenance_collateralization = optional<price>() 
) const

Calculate maximum quantity of debt to cover to satisfy target_collateral_ratio.

match_pricethe matching price if this call order is margin called
feed_pricemedian settlement price of debt asset
maintenance_collateral_ratiomedian maintenance collateral ratio of debt asset
maintenance_collateralizationmaintenance collateralization of debt asset, should only be valid after core-1270 hard fork
maximum amount of debt that can be called

Definition at line 61 of file market_object.cpp.

Member Data Documentation

account_id_type graphene::chain::call_order_object::borrower

Definition at line 132 of file market_object.hpp.

price graphene::chain::call_order_object::call_price

Collateral / Debt.

Definition at line 135 of file market_object.hpp.

share_type graphene::chain::call_order_object::collateral

call_price.base.asset_id, access via get_collateral

Definition at line 133 of file market_object.hpp.

share_type graphene::chain::call_order_object::debt

call_price.quote.asset_id, access via get_debt

Definition at line 134 of file market_object.hpp.

const uint8_t graphene::chain::call_order_object::space_id = protocol_ids

Definition at line 122 of file market_object.hpp.

optional<uint16_t> graphene::chain::call_order_object::target_collateral_ratio

maximum CR to maintain when selling collateral on margin call

Definition at line 137 of file market_object.hpp.

const uint8_t graphene::chain::call_order_object::type_id = call_order_object_type

Definition at line 123 of file market_object.hpp.

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