BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
tracks debt and call price information More...
#include <market_object.hpp>
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, protocol_ids, call_order_object_type > | |
abstract_object () | |
object_id< SpaceID, TypeID > | get_id () const |
Public Member Functions inherited from graphene::db::base_abstract_object< call_order_object > | |
std::unique_ptr< object > | clone () const override |
void | move_from (object &obj) override |
fc::variant | to_variant () const override |
std::vector< char > | pack () const override |
object ()=default | |
object (uint8_t space_id, uint8_t type_id) | |
Public Member Functions inherited from graphene::db::object | |
object ()=default | |
object (uint8_t space_id, uint8_t type_id) | |
virtual | ~object ()=default |
virtual std::unique_ptr< object > | clone () const =0 |
virtual fc::variant | to_variant () const =0 |
virtual std::vector< char > | pack () const =0 |
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 |
Additional Inherited Members | |
Static Public Attributes inherited from graphene::db::abstract_object< call_order_object, protocol_ids, call_order_object_type > | |
static constexpr uint8_t | space_id |
static constexpr uint8_t | type_id |
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 140 of file market_object.hpp.
|
inline |
Definition at line 145 of file market_object.hpp.
|
inline |
Definition at line 147 of file market_object.hpp.
|
inline |
Definition at line 148 of file market_object.hpp.
|
inline |
Definition at line 146 of file market_object.hpp.
|
inline |
Definition at line 143 of file market_object.hpp.
|
inline |
Definition at line 144 of file market_object.hpp.
|
inline |
Definition at line 157 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_price | the matching price if this call order is margin called |
feed_price | median settlement price of debt asset |
maintenance_collateral_ratio | median maintenance collateral ratio of debt asset |
maintenance_collateralization | maintenance collateralization of debt asset, should only be valid after core-1270 hard fork |
Definition at line 61 of file market_object.cpp.
account_id_type graphene::chain::call_order_object::borrower |
Definition at line 150 of file market_object.hpp.
price graphene::chain::call_order_object::call_price |
Collateral / Debt.
Definition at line 153 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 151 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 152 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 155 of file market_object.hpp.