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::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

void refresh_cache ()
 
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 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_hardfork_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 current_feed
 
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. More...
 
- Public Attributes inherited from graphene::db::object
object_id_type id
 

Static Public Attributes

static const uint8_t space_id = implementation_ids
 
static const uint8_t type_id = impl_asset_bitasset_data_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

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

Definition at line 249 of file asset_object.hpp.

Member Function Documentation

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

The time when current_feed would expire.

Definition at line 322 of file asset_object.hpp.

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

Definition at line 332 of file asset_object.hpp.

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

Definition at line 330 of file asset_object.hpp.

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

return true if there has been a black swan, false otherwise

Definition at line 294 of file asset_object.hpp.

share_type 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.

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 316 of file asset_object.hpp.

void asset_bitasset_data_object::refresh_cache ( )

Derive current_maintenance_collateralization and current_initial_collateralization from other member variables.

Definition at line 134 of file asset_object.cpp.

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

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 310 of file asset_object.hpp.

asset_id_type graphene::chain::asset_bitasset_data_object::asset_id

The asset this object belong to.

Definition at line 256 of file asset_object.hpp.

price_feed_with_icr graphene::chain::asset_bitasset_data_object::current_feed

This is the currently active price feed, calculated as the median of values from the currently active feeds.

Definition at line 267 of file asset_object.hpp.

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 269 of file asset_object.hpp.

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 279 of file asset_object.hpp.

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 274 of file asset_object.hpp.

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

Track whether core exchange rate in current feed has updated.

Definition at line 313 of file asset_object.hpp.

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. If issuer is not committee, the keys in this map are the feed publishing accounts; otherwise, the feed publishers are the currently active committee_members and witnesses and this map should be treated as an implementation detail. The timestamp on each feed is the time it was published.

Definition at line 264 of file asset_object.hpp.

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 289 of file asset_object.hpp.

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

True if this asset implements a Prediction Market.

Definition at line 286 of file asset_object.hpp.

bitasset_options graphene::chain::asset_bitasset_data_object::options

The tunable options for BitAssets are stored in this field.

Definition at line 259 of file asset_object.hpp.

share_type graphene::chain::asset_bitasset_data_object::settlement_fund

Amount of collateral which is available for force settlement.

Definition at line 306 of file asset_object.hpp.

price graphene::chain::asset_bitasset_data_object::settlement_price

In the event of a black swan, the swan price is saved in the settlement price, and all margin positions are settled at the same price with the siezed collateral being moved into the settlement fund. From this point on no further updates to the asset are permitted (no feeds, etc) and forced settlement occurs immediately when requested, using the settlement price and fund. Price at which force settlements of a black swanned asset will occur

Definition at line 304 of file asset_object.hpp.

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

Definition at line 252 of file asset_object.hpp.

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

Definition at line 253 of file asset_object.hpp.


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