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

contains properties that only apply to bitassets (market issued assets) More...

#include <asset_object.hpp>

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

Public Member Functions

bool is_current_feed_price_capped () const
 
share_type max_force_settlement_volume (share_type current_supply) const
 Calculate the maximum force settlement volume per maintenance interval, given the current share supply. More...
 
bool has_settlement () const
 
bool has_individual_settlement () const
 
price get_individual_settlement_price () const
 Get the price of the individual settlement pool. More...
 
bitasset_options::black_swan_response_type get_black_swan_response_method () const
 Get the effective black swan response method of this bitasset. More...
 
price get_margin_call_order_price () const
 Get margin call order price (MCOP) of this bitasset. More...
 
ratio_type get_margin_call_order_ratio () const
 Get margin call order ratio (MCOR) of this bitasset. More...
 
ratio_type get_margin_call_pays_ratio () const
 Get margin call pays ratio (MCPR) of this bitasset. More...
 
bool need_to_update_cer () const
 Whether need to update core_exchange_rate in asset_object. More...
 
time_point_sec feed_expiration_time () const
 The time when current_feed would expire. More...
 
bool feed_is_expired_before_hf_615 (time_point_sec current_time) const
 
bool feed_is_expired (time_point_sec current_time) const
 
void update_median_feeds (time_point_sec current_time, time_point_sec next_maintenance_time)
 
- Public Member Functions inherited from graphene::db::abstract_object< asset_bitasset_data_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

asset_id_type asset_id
 The asset this object belong to. More...
 
bitasset_options options
 The tunable options for BitAssets are stored in this field. More...
 
flat_map< account_id_type, pair< time_point_sec, price_feed_with_icr > > feeds
 
price_feed_with_icr median_feed
 This is the median of values from the currently active feeds. More...
 
price_feed_with_icr current_feed
 This is the currently active price feed, calculated from median_feed and other parameters. More...
 
time_point_sec current_feed_publication_time
 This is the publication time of the oldest feed which was factored into current_feed. More...
 
price current_maintenance_collateralization
 
price current_initial_collateralization
 
bool is_prediction_market = false
 True if this asset implements a Prediction Market. More...
 
share_type force_settled_volume
 This is the volume of this asset which has been force-settled this maintanence interval. More...
 
bool asset_cer_updated = false
 Track whether core_exchange_rate in corresponding asset_object has updated. More...
 
bool feed_cer_updated = false
 Track whether core exchange rate in current feed has updated. More...
 
price settlement_price
 
share_type settlement_fund
 Amount of collateral which is available for force settlement due to global settlement. More...
 
share_type individual_settlement_debt
 
share_type individual_settlement_fund
 Amount of collateral which is available for force settlement due to individual settlements. More...
 
- Public Attributes inherited from graphene::db::object
object_id_type id
 

Static Public Attributes

static constexpr uint8_t space_id = implementation_ids
 
static constexpr uint8_t type_id = impl_asset_bitasset_data_object_type
 

Detailed Description

contains properties that only apply to bitassets (market issued assets)

Definition at line 258 of file asset_object.hpp.

Member Function Documentation

◆ feed_expiration_time()

time_point_sec graphene::chain::asset_bitasset_data_object::feed_expiration_time ( ) const
inline

The time when current_feed would expire.

Definition at line 375 of file asset_object.hpp.

◆ feed_is_expired()

bool graphene::chain::asset_bitasset_data_object::feed_is_expired ( time_point_sec  current_time) const
inline
Returns
whether current_feed has expired

Definition at line 388 of file asset_object.hpp.

◆ feed_is_expired_before_hf_615()

bool graphene::chain::asset_bitasset_data_object::feed_is_expired_before_hf_615 ( time_point_sec  current_time) const
inline

The old and buggy implementation of feed_is_expired before the No. 615 hardfork. See https://github.com/cryptonomex/graphene/issues/615

Definition at line 385 of file asset_object.hpp.

◆ get_black_swan_response_method()

bitasset_options::black_swan_response_type graphene::chain::asset_bitasset_data_object::get_black_swan_response_method ( ) const
inline

Get the effective black swan response method of this bitasset.

Definition at line 339 of file asset_object.hpp.

◆ get_individual_settlement_price()

price graphene::chain::asset_bitasset_data_object::get_individual_settlement_price ( ) const
inline

Get the price of the individual settlement pool.

Definition at line 332 of file asset_object.hpp.

◆ get_margin_call_order_price()

price graphene::chain::asset_bitasset_data_object::get_margin_call_order_price ( ) const
inline

Get margin call order price (MCOP) of this bitasset.

Definition at line 345 of file asset_object.hpp.

◆ get_margin_call_order_ratio()

ratio_type graphene::chain::asset_bitasset_data_object::get_margin_call_order_ratio ( ) const
inline

Get margin call order ratio (MCOR) of this bitasset.

Definition at line 351 of file asset_object.hpp.

◆ get_margin_call_pays_ratio()

ratio_type graphene::chain::asset_bitasset_data_object::get_margin_call_pays_ratio ( ) const
inline

Get margin call pays ratio (MCPR) of this bitasset.

Definition at line 357 of file asset_object.hpp.

◆ has_individual_settlement()

bool graphene::chain::asset_bitasset_data_object::has_individual_settlement ( ) const
inline
Returns
true if the individual settlement pool is not empty, false otherwise

Definition at line 329 of file asset_object.hpp.

◆ has_settlement()

bool graphene::chain::asset_bitasset_data_object::has_settlement ( ) const
inline
Returns
true if the bitasset has been globally settled, false otherwise

Definition at line 304 of file asset_object.hpp.

◆ is_current_feed_price_capped()

bool graphene::chain::asset_bitasset_data_object::is_current_feed_price_capped ( ) const
inline
Returns
whether current_feed is different from median_feed

Definition at line 282 of file asset_object.hpp.

◆ max_force_settlement_volume()

share_type graphene::chain::asset_bitasset_data_object::max_force_settlement_volume ( share_type  current_supply) const

Calculate the maximum force settlement volume per maintenance interval, given the current share supply.

Definition at line 33 of file asset_object.cpp.

◆ need_to_update_cer()

bool graphene::chain::asset_bitasset_data_object::need_to_update_cer ( ) const
inline

Whether need to update core_exchange_rate in asset_object.

Definition at line 369 of file asset_object.hpp.

◆ update_median_feeds()

void graphene::chain::asset_bitasset_data_object::update_median_feeds ( time_point_sec  current_time,
time_point_sec  next_maintenance_time 
)

Definition at line 47 of file asset_object.cpp.

Member Data Documentation

◆ asset_cer_updated

bool graphene::chain::asset_bitasset_data_object::asset_cer_updated = false

Track whether core_exchange_rate in corresponding asset_object has updated.

Definition at line 363 of file asset_object.hpp.

◆ asset_id

asset_id_type graphene::chain::asset_bitasset_data_object::asset_id

The asset this object belong to.

Definition at line 265 of file asset_object.hpp.

◆ current_feed

price_feed_with_icr graphene::chain::asset_bitasset_data_object::current_feed

This is the currently active price feed, calculated from median_feed and other parameters.

Definition at line 277 of file asset_object.hpp.

◆ current_feed_publication_time

time_point_sec graphene::chain::asset_bitasset_data_object::current_feed_publication_time

This is the publication time of the oldest feed which was factored into current_feed.

Definition at line 279 of file asset_object.hpp.

◆ current_initial_collateralization

price graphene::chain::asset_bitasset_data_object::current_initial_collateralization

After BSIP77, when creating a new debt position or updating an existing position, the position will be checked against the initial_collateral_ratio (ICR) parameter in the bitasset options. This value is derived from current_feed (which includes ICR) for better performance and should be kept consistent.

Definition at line 293 of file asset_object.hpp.

◆ current_maintenance_collateralization

price graphene::chain::asset_bitasset_data_object::current_maintenance_collateralization

Call orders with collateralization (aka collateral/debt) not greater than this value are in margin call territory. This value is derived from current_feed for better performance and should be kept consistent.

Definition at line 288 of file asset_object.hpp.

◆ feed_cer_updated

bool graphene::chain::asset_bitasset_data_object::feed_cer_updated = false

Track whether core exchange rate in current feed has updated.

Definition at line 366 of file asset_object.hpp.

◆ feeds

flat_map<account_id_type, pair<time_point_sec,price_feed_with_icr> > graphene::chain::asset_bitasset_data_object::feeds

Feeds published for this asset. The keys in this map are the feed publishing accounts. The timestamp on each feed is the time it was published.

Definition at line 273 of file asset_object.hpp.

◆ force_settled_volume

share_type graphene::chain::asset_bitasset_data_object::force_settled_volume

This is the volume of this asset which has been force-settled this maintanence interval.

Definition at line 299 of file asset_object.hpp.

◆ individual_settlement_debt

share_type graphene::chain::asset_bitasset_data_object::individual_settlement_debt

The individual settlement pool. In the event of individual settlements to fund, debt and collateral of the margin positions which got settled are moved here.

Amount of debt due to individual settlements

Definition at line 323 of file asset_object.hpp.

◆ individual_settlement_fund

share_type graphene::chain::asset_bitasset_data_object::individual_settlement_fund

Amount of collateral which is available for force settlement due to individual settlements.

Definition at line 325 of file asset_object.hpp.

◆ is_prediction_market

bool graphene::chain::asset_bitasset_data_object::is_prediction_market = false

True if this asset implements a Prediction Market.

Definition at line 296 of file asset_object.hpp.

◆ median_feed

price_feed_with_icr graphene::chain::asset_bitasset_data_object::median_feed

This is the median of values from the currently active feeds.

Definition at line 275 of file asset_object.hpp.

◆ options

bitasset_options graphene::chain::asset_bitasset_data_object::options

The tunable options for BitAssets are stored in this field.

Definition at line 268 of file asset_object.hpp.

◆ settlement_fund

share_type graphene::chain::asset_bitasset_data_object::settlement_fund

Amount of collateral which is available for force settlement due to global settlement.

Definition at line 315 of file asset_object.hpp.

◆ settlement_price

price graphene::chain::asset_bitasset_data_object::settlement_price

In the event of global settlement, all margin positions are settled with the siezed collateral being moved into the settlement fund. From this point on forced settlement occurs immediately when requested, using the settlement price and fund. Price at which force settlements of a globally settled asset will occur

Definition at line 313 of file asset_object.hpp.

◆ space_id

constexpr uint8_t graphene::chain::asset_bitasset_data_object::space_id = implementation_ids
static

Definition at line 261 of file asset_object.hpp.

◆ type_id

constexpr uint8_t graphene::chain::asset_bitasset_data_object::type_id = impl_asset_bitasset_data_object_type
static

Definition at line 262 of file asset_object.hpp.


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