BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
Go to the documentation of this file.
29 #include <boost/multi_index/composite_key.hpp>
41 namespace graphene {
namespace chain {
42 class asset_bitasset_data_object;
57 implementation_ids, impl_asset_dynamic_data_object_type>
169 "Asset ${a} (${id}) is not a market issued asset.",
170 (
"a",this->symbol)(
"id",this->id) );
203 if (fee.
amount == 0)
return;
212 "Asset ${a} (${id}) cannot accept fee of asset (${fid}).",
213 (
"a",this->symbol)(
"id",this->
id)(
"fid",fee.
asset_id) );
216 "Asset ${a} (${id}) cannot accept fee of asset (${fid}).",
217 (
"a",this->symbol)(
"id",this->id)(
"fid",fee.
asset_id) );
256 implementation_ids, impl_asset_bitasset_data_object_type>
268 flat_map<account_id_type, pair<time_point_sec,price_feed_with_icr>>
feeds;
419 void refresh_cache();
432 struct by_short_backing_asset;
433 struct by_feed_expiration;
434 struct by_cer_update;
437 asset_bitasset_data_object,
439 ordered_unique< tag<by_id>, member< object, object_id_type, &object::id > >,
440 ordered_non_unique< tag<by_short_backing_asset>, bitasset_backing_asst_extractor >,
441 ordered_unique< tag<by_feed_expiration>,
442 composite_key< asset_bitasset_data_object,
443 const_mem_fun< asset_bitasset_data_object, time_point_sec,
445 member< asset_bitasset_data_object, asset_id_type, &asset_bitasset_data_object::asset_id >
448 ordered_non_unique< tag<by_cer_update>,
449 const_mem_fun< asset_bitasset_data_object, bool,
462 ordered_unique< tag<by_id>, member< object, object_id_type, &object::id > >,
463 ordered_unique< tag<by_symbol>, member<asset_object, string, &asset_object::symbol> >,
464 ordered_unique< tag<by_type>,
466 const_mem_fun<asset_object, bool, &asset_object::is_market_issued>,
467 member< object, object_id_type, &object::id >
470 ordered_unique< tag<by_issuer>,
472 member< asset_object, account_id_type, &asset_object::issuer >,
473 member< object, object_id_type, &object::id >
487 (initial_collateral_ratio) )
495 (dynamic_asset_data_id)
uint16_t initial_collateral_ratio
time_point_sec feed_expiration_time() const
The time when current_feed would expire.
share_type fee_pool
in core asset
time_point_sec creation_time
The time when the asset object was created.
share_type settlement_fund
Amount of collateral which is available for force settlement due to global settlement.
string amount_to_string(const asset &amount) const
Convert an asset to a textual representation, i.e. "123.45".
@ disable_new_supply
unable to create new supply for the asset
bool allow_confidential() const
bool can_override() const
void update_median_feeds(time_point_sec current_time, time_point_sec next_maintenance_time)
optional< liquidity_pool_id_type > for_liquidity_pool
The ID of the liquidity pool if the asset is the share asset of a liquidity pool.
string amount_to_pretty_string(share_type amount) const
Convert an asset to a textual representation with symbol, i.e. "123.45 USD".
optional< asset_bitasset_data_id_type > bitasset_data_id
Extra data associated with BitAssets. This field is non-null if and only if is_market_issued() return...
price core_exchange_rate
Price at which automatically exchanging this asset for CORE from fee pool occurs (used for paying fee...
The price struct stores asset prices in the BitShares system.
bool is_prediction_market
True if this asset implements a Prediction Market.
black_swan_response_type
Defines how a BitAsset would respond to black swan events.
string amount_to_pretty_string(const asset &amount) const
Convert an asset to a textual representation with symbol, i.e. "123.45 USD".
const asset_bitasset_data_object & bitasset_data(const DB &db) const
FC_REFLECT_TYPENAME(fc::log_message)
share_type individual_settlement_fund
Amount of collateral due to individual settlements.
black_swan_response_type get_black_swan_response_method() const
Get the effective black swan response method.
price_feed_with_icr(const price_feed &pf, const optional< uint16_t > &icr={})
share_type current_supply
The number of shares currently in existence.
ratio_type get_margin_call_pays_ratio() const
Get margin call pays ratio (MCPR) of this bitasset.
bool is_liquidity_pool_share_asset() const
share_type force_settled_volume
This is the volume of this asset which has been force-settled this maintanence interval.
bool can_force_settle() const
string amount_to_string(share_type amount) const
Convert an asset to a textual representation, i.e. "123.45".
bool can_owner_update_mssr() const
tracks the parameters of an asset
uint32_t feed_lifetime_sec
Time before a price feed expires.
price current_maintenance_collateralization
#define MAP_OBJECT_ID_TO_TYPE(OBJECT)
bool is_transfer_restricted() const
string symbol
Ticker symbol for this asset, i.e. "USD".
multi_index_container< asset_object, indexed_by< ordered_unique< tag< by_id >, member< object, object_id_type, &object::id > >, ordered_unique< tag< by_symbol >, member< asset_object, string, &asset_object::symbol > >, ordered_unique< tag< by_type >, composite_key< asset_object, const_mem_fun< asset_object, bool, &asset_object::is_market_issued >, member< object, object_id_type, &object::id > > >, ordered_unique< tag< by_issuer >, composite_key< asset_object, member< asset_object, account_id_type, &asset_object::issuer >, member< object, object_id_type, &object::id > > > > > asset_object_multi_index_type
share_type confidential_supply
total asset held in confidential balances
static time_point_sec maximum()
asset_dynamic_data_id_type dynamic_asset_data_id
Current supply, fee pool, and collected fees are stored in a separate object as they change frequentl...
The asset_options struct contains options available on all assets in the network.
bool can_global_settle() const
asset amount_from_string(string amount_string) const
@ disable_mssr_update
the bitasset owner can not update MSSR, permission only
The bitasset_options struct contains configurable options available only to BitAssets.
@ lock_max_supply
the max supply of the asset can not be updated
@ charge_market_fee
market trades in this asset may be charged
share_type accumulated_fees
fees accumulate to be paid out over time
bool is_current_feed_price_capped() const
bool asset_cer_updated
Track whether core_exchange_rate in corresponding asset_object has updated.
share_type max_force_settlement_volume(share_type current_supply) const
Calculate the maximum force settlement volume per maintenance interval, given the current share suppl...
uint8_t precision
Maximum number of digits after the decimal point (must be <= 12)
@ disable_force_settle
disable force settling
tracks the asset information that changes frequently
#define FC_REFLECT_DERIVED(TYPE, INHERITS, MEMBERS)
Specializes fc::reflector for TYPE where type inherits other reflected classes.
#define GRAPHENE_DEFAULT_MAINTENANCE_COLLATERAL_RATIO
Call when collateral only pays off 175% the debt.
bool can_create_new_supply() const
uint16_t issuer_permissions
The flags which the issuer has permission to update. See asset_issuer_permission_flags.
bool feed_is_expired(time_point_sec current_time) const
defines market parameters for margin positions
#define GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION(type)
contains properties that only apply to bitassets (market issued assets)
@ disable_icr_update
the bitasset owner can not update ICR, permission only
void accumulate_fee(DB &db, const asset &fee) const
price_feed_with_icr current_feed
This is the currently active price feed, calculated from median_feed and other parameters.
bool feed_is_expired_before_hf_615(time_point_sec current_time) const
price_feed_with_icr median_feed
This is the median of values from the currently active feeds.
price get_individual_settlement_price() const
Get the price of the individual settlement pool.
price get_margin_call_order_price() const
Get margin call order price (MCOP) of this bitasset.
bool is_individually_settled_to_fund() const
bool can_bid_collateral() const
@ global_settle
allow the bitasset owner to force a global settlement, permission only
bool can_update_max_supply() const
@ disable_confidential
disallow the asset to be used with confidential transactions
uint16_t flags
The currently active flags on this permission. See asset_issuer_permission_flags.
const asset_dynamic_data_object & dynamic_data(const DB &db) const
price get_initial_collateralization() const
bool charges_market_fees() const
multi_index_container< asset_bitasset_data_object, indexed_by< ordered_unique< tag< by_id >, member< object, object_id_type, &object::id > >, ordered_non_unique< tag< by_short_backing_asset >, bitasset_backing_asst_extractor >, ordered_unique< tag< by_feed_expiration >, composite_key< asset_bitasset_data_object, const_mem_fun< asset_bitasset_data_object, time_point_sec, &asset_bitasset_data_object::feed_expiration_time >, member< asset_bitasset_data_object, asset_id_type, &asset_bitasset_data_object::asset_id > > >, ordered_non_unique< tag< by_cer_update >, const_mem_fun< asset_bitasset_data_object, bool, &asset_bitasset_data_object::need_to_update_cer > > > > bitasset_data_multi_index_type
share_type accumulated_collateral_fees
accumulated collateral-denominated fees (for bitassets)
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
account_id_type issuer
ID of the account which issued this asset.
bool can_owner_update_mcr() const
share_type reserved(const DB &db) const
uint16_t maintenance_collateral_ratio
time_point_sec current_feed_publication_time
This is the publication time of the oldest feed which was factored into current_feed.
asset amount(share_type a) const
Helper function to get an asset object with the given amount in this asset's type.
bitasset_options::black_swan_response_type get_black_swan_response_method() const
Get the effective black swan response method of this bitasset.
bool feed_cer_updated
Track whether core exchange rate in current feed has updated.
ratio_type margin_call_pays_ratio(const fc::optional< uint16_t > &margin_call_fee_ratio) const
object_id< SpaceID, TypeID > get_id() const
ratio_type get_margin_call_order_ratio() const
Get margin call order ratio (MCOR) of this bitasset.
provides stack-based nullable value similar to boost::optional
@ disable_collateral_bidding
Can not bid collateral after a global settlement.
@ transfer_restricted
require the issuer to be one party to every transfer
defines market parameters for margin positions, extended with an initial_collateral_ratio field
static bool is_valid_symbol(const string &symbol)
bool can_accumulate_fee(const DB &db, const asset &fee) const
bool is_market_issued() const
flat_map< account_id_type, pair< time_point_sec, price_feed_with_icr > > feeds
bool can_owner_update_bsrm() const
share_type individual_settlement_debt
@ override_authority
issuer may transfer asset back to himself
optional< account_id_type > buyback_account
price current_initial_collateralization
bool need_to_update_cer() const
Whether need to update core_exchange_rate in asset_object.
ratio_type margin_call_order_ratio(const fc::optional< uint16_t > &margin_call_fee_ratio) const
boost::rational< int32_t > ratio_type
bool can_owner_update_icr() const
asset_id_type short_backing_asset
@ disable_bsrm_update
the bitasset owner can not update BSRM, permission only
uint32_t creation_block_num
The block number when the asset object was created.
extension< ext > extensions
bitasset_options options
The tunable options for BitAssets are stored in this field.
@ disable_mcr_update
the bitasset owner can not update MCR, permission only
price margin_call_order_price(const fc::optional< uint16_t > &margin_call_fee_ratio) const
bool is_globally_settled() const
base for all database objects
asset_id_type asset_id
The asset this object belong to.