27 namespace graphene {
namespace protocol {
111 : base(_base),quote(_quote){}
116 static price max(asset_id_type base, asset_id_type quote );
117 static price min(asset_id_type base, asset_id_type quote );
119 static price call_price(
const asset& debt,
const asset& collateral, uint16_t collateral_ratio);
132 void validate(
bool check_upper_bound =
false )
const;
152 { p = p * r;
return p; }
154 { p = p / r;
return p; }
209 price max_short_squeeze_price()
const;
221 price max_short_squeeze_price_before_hf_1270()
const;
287 price maintenance_collateralization()
const;
295 return std::tie( settlement_price, maintenance_collateral_ratio, maximum_short_squeeze_ratio ) ==
300 void validate()
const;
301 bool is_for( asset_id_type
asset_id )
const;
313 (settlement_price)(maintenance_collateral_ratio)(maximum_short_squeeze_ratio)(core_exchange_rate) )
uint16_t maximum_short_squeeze_ratio
price & operator/=(price &p, const ratio_type &r)
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
price operator~(const price &p)
asset operator*(const asset &a, const price &b)
Multiply and round down.
boost::rational< int32_t > ratio_type
friend asset operator+(const asset &a, const asset &b)
price & operator*=(price &p, const ratio_type &r)
#define GRAPHENE_DEFAULT_MAINTENANCE_COLLATERAL_RATIO
Call when collateral only pays off 175% the debt.
price operator/(const asset &base, const asset "e)
asset & operator+=(const asset &o)
friend bool operator>(const asset &a, const asset &b)
asset multiply_and_round_up(const price &p) const
Multiply and round up.
friend bool operator<(const asset &a, const asset &b)
price(const asset &_base=asset(), const asset &_quote=asset())
static share_type scaled_precision(uint8_t precision)
uint16_t maintenance_collateral_ratio
#define GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION(type)
friend bool operator!=(const asset &a, const asset &b)
The price struct stores asset prices in the BitShares system.
friend bool operator>=(const asset &a, const asset &b)
friend bool operator<=(const asset &a, const asset &b)
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
friend bool operator==(const asset &a, const asset &b)
#define GRAPHENE_DEFAULT_MAX_SHORT_SQUEEZE_RATIO
Stop calling when collateral only pays off 150% of the debt.
asset(share_type a=0, asset_id_type id=asset_id_type())
defines market parameters for margin positions
static price unit_price(asset_id_type a=asset_id_type())
The unit price for an asset type A is defined to be a price such that for any asset m...
asset & operator-=(const asset &o)
bool margin_call_params_equal(const price_feed &b) const
price core_exchange_rate
Price at which automatically exchanging this asset for CORE from fee pool occurs (used for paying fee...