BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
Public Member Functions | 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, implementation_ids, impl_asset_bitasset_data_object_type > graphene::db::base_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 is_globally_settled () const
 
bool is_individually_settled_to_fund () 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, implementation_ids, impl_asset_bitasset_data_object_type >
 abstract_object ()
 
object_id< SpaceID, TypeID > get_id () const
 
- Public Member Functions inherited from graphene::db::base_abstract_object< asset_bitasset_data_object >
std::unique_ptr< objectclone () 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< objectclone () const =0
 
virtual fc::variant to_variant () const =0
 
virtual std::vector< char > pack () const =0
 

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 due to individual settlements. More...
 
- Public Attributes inherited from graphene::db::object
object_id_type id
 

Additional Inherited Members

- Static Public Attributes inherited from graphene::db::abstract_object< asset_bitasset_data_object, implementation_ids, impl_asset_bitasset_data_object_type >
static constexpr uint8_t space_id
 
static constexpr uint8_t type_id
 

Detailed Description

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

Definition at line 255 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 385 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 398 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 395 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 349 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 342 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 355 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 361 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 367 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 277 of file asset_object.hpp.

◆ is_globally_settled()

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

Definition at line 299 of file asset_object.hpp.

◆ is_individually_settled_to_fund()

bool graphene::chain::asset_bitasset_data_object::is_individually_settled_to_fund ( ) const
inline
Returns
true if the individual settlement pool is not empty and the bitasset's black swan response method (BSRM) is graphene::protocol::bitasset_options::black_swan_response_type::individual_settlement_to_fund, false otherwise

Definition at line 334 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 379 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 373 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 260 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 272 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 274 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 288 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 283 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 376 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 268 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 294 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 or to order), debt and collateral of the margin positions which got settled are moved here.

  • For individual settlement to fund, collateral assets in the pool can only be retrieved through forced settlements.
  • For individual settlement to order, collateral assets in the pool can only be retrieved through limit orders.

Amount of debt due to individual settlements

Definition at line 325 of file asset_object.hpp.

◆ individual_settlement_fund

share_type graphene::chain::asset_bitasset_data_object::individual_settlement_fund

Amount of collateral due to individual settlements.

Definition at line 327 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 291 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 270 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 263 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 313 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.

Note
After the core-2591 hardfork, forced settlements may be paid at the margin call order price (MCOP) when applicable, but are not limited to the settlement price stated here. Price at which force settlements of a globally settled asset will occur

Definition at line 311 of file asset_object.hpp.


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