Open xiangxn opened 2 years ago
These new data fields were added to assets in bitshares-core version 4.0
- 6.0
. Some of them have been added to UI, but some not yet.
struct additional_asset_options
{
// ...
// After BSIP81 activation, taker_fee_percent is the taker fee
fc::optional<uint16_t> taker_fee_percent;
};
struct ext
{
/// After BSIP77, when creating a new debt position or updating an existing position,
/// the position will be checked against this parameter.
/// Unused for prediction markets, although we allow it to be set for simpler implementation
fc::optional<uint16_t> initial_collateral_ratio; // BSIP-77
/// After BSIP75, the asset owner can update MCR directly
fc::optional<uint16_t> maintenance_collateral_ratio; // BSIP-75
/// After BSIP75, the asset owner can update MSSR directly
fc::optional<uint16_t> maximum_short_squeeze_ratio; // BSIP-75
fc::optional<uint16_t> margin_call_fee_ratio; // BSIP 74
fc::optional<uint16_t> force_settle_fee_percent; // BSIP-87
// https://github.com/bitshares/bitshares-core/issues/2467
fc::optional<uint8_t> black_swan_response_method;
};
enum asset_issuer_permission_flags {
// ...
/// @note If one of these bits is set in asset issuer permissions,
/// it means the asset issuer (or owner for bitassets) does NOT have the permission to update
/// the corresponding flag, parameters or perform certain actions.
/// This is to be compatible with old client software.
///@{
lock_max_supply = 0x200, ///< the max supply of the asset can not be updated
disable_new_supply = 0x400, ///< unable to create new supply for the asset
/// @note These parameters are for issuer permission only.
/// For each parameter, if it is set in issuer permission,
/// it means the bitasset owner can not update the corresponding parameter.
///@{
/// @note For each one of these parameters, if it is set in issuer permission, and
/// * if the value of the parameter was set by the bitasset owner, it can not be updated,
/// * if no value was set by the owner, the value can still be updated by the feed producers.
///@{
disable_mcr_update = 0x800, ///< the bitasset owner can not update MCR, permission only
disable_icr_update = 0x1000, ///< the bitasset owner can not update ICR, permission only
disable_mssr_update = 0x2000, ///< the bitasset owner can not update MSSR, permission only
///@}
disable_bsrm_update = 0x4000, ///< the bitasset owner can not update BSRM, permission only
///@}
disable_collateral_bidding = 0x8000 ///< Can not bid collateral after a global settlement
///@}
};
class asset_dynamic_data_object : public abstract_object<asset_dynamic_data_object>
{
// ...
share_type accumulated_collateral_fees; ///< accumulated collateral-denominated fees (for bitassets)
// ...
};
class asset_object : public graphene::db::abstract_object<asset_object>
{
// ...
/// The ID of the liquidity pool if the asset is the share asset of a liquidity pool
optional<liquidity_pool_id_type> for_liquidity_pool;
// ...
};
class asset_bitasset_data_object : public abstract_object<asset_bitasset_data_object>
{
// ...
/// This is the median of values from the currently active feeds.
price_feed_with_icr median_feed;
// ...
/// 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
share_type individual_settlement_debt;
/// Amount of collateral which is available for force settlement due to individual settlements
share_type individual_settlement_fund;
///@}
// ...
};
@xiangxn is the list above clear to you? I can also help clarify if desired
@xiangxn is the list above clear to you? I can also help clarify if desired
Yes, I would appreciate help sorting out the information that needs to be displayed, if you have time.
taker_fee_percent
: Already visible in secion A, but help text is not goodinitial_collateral_ratio
: Show in D above "Maintenance collateral ratio" in a new row, add a "?" to include help textmaintenance_collateral_ratio
set by asset owner: Show in section D below "Maintenance collateral ratio" in a new row with text "Maintenance collateral ratio (set by asset owner)"maximum_short_squeeze_ratio
set by asset owner: Show in section D below "Maximum short squeeze ratio" in a new row with text "Maximum short squeeze ratio (set by asset owner)"margin_call_fee_ratio
: Show below "Maximum short squeeze ratio (MSSR)" in section D as new row with text "Margin Call Fee Ratio (MCFR)force_settle_fee_percent
: Show below "Force Settlement" "Price (2% offset included)" in section E as a new row with text "Fee"black_swan_response_method
: Show below "Global settlement Price will be" in section E as new row with text "Global Settlement Response Method". The text of this and also how and what we represent needs discussion, present only the actual flag value for nowasset_issuer_permission_flags
: Add all permissions and flags that are currently not covered in the same way as the existing ones in section A and Bindividual_settlement_debt
and individual_settlement_fund
: If the black_swan_response_method
is set to the value representing individual settlement, include a new section in section E that shows both values.@abitmore can you clarify please what accumulated_collateral_fees
is used for?
@xiangxn I can help with arranging and adding explanation once you have included the raw data, if that is useful?
maintenance_collateral_ratio
set by asset owner: Show in section D below "Maintenance collateral ratio" in a new row with text "Maintenance collateral ratio (set by asset owner)"maximum_short_squeeze_ratio
set by asset owner: Show in section D below "Maximum short squeeze ratio" in a new row with text "Maximum short squeeze ratio (set by asset owner)"
Each of these parameters, as well as initial_collateral_ratio
(ICR), is either set by asset owner or set by price producers, so it is not needed to show both. We can check if each parameter is present in extensions
and is equal to the one in current_feed
, if yes, show "set by asset owner", otherwise show nothing. An exception exists when there is no sufficient price feeds, in this case the values in current_feed
are the default values but not the ones set by asset owner nor by price feed producers.
By the way, in the "price feed data" list (below all the areas), ideally we should add a new column "ICR", although I guess nobody is feeding it right now.
@abitmore can you clarify please what
accumulated_collateral_fees
is used for?
It is for BSIP 74 (margin call fee) and BSIP 87 (force settlement fee). We can show it in area C.
median_feed
: only need to show the settlement_price
field inside, in area D, with text "Median of price feeds". In addition, remove the text "median of witness feeds" from "Feed price" (current_feed
), or change it to "derived from price feeds and other parameters" or something clearer.@abitmore @sschiessl-bcp Thanks a lot, this is a lot clearer, I'll submit a PR soon and see if it needs tweaking.
it would be helpful to have a link to the json formatted raw response for all relevant asset data (formatted like raw data when confirming a tx)
get_object(asset_id)
get_object(dynamic_asset_data_id)
get_object(bitasset_data_id)
also displaying those ids maybe as the link to the json, sample UX:
(...)
Asset Owner committee-account
Precision 4
Asset Id 1.3.x (hyperlinked to get_object json)
Dynamic Id 2.3.x (hyperlinked to get_object json)
Bitasset Id 2.4.x (hyperlinked to get_object json)
(...)
having the raw data in the UI would keep it bleeding edge forward compatible upon core updates as well as help those new to the protocol learn how to navigate asset data
it would be helpful to have a link to the json formatted raw response for all relevant asset data (formatted like raw data when confirming a tx)
get_object(asset_id) get_object(dynamic_asset_data_id) get_object(bitasset_data_id)
also displaying those ids maybe as the link to the json, sample UX:
(...) Asset Owner committee-account Precision 4 Asset Id 1.3.x (hyperlinked to get_object json) Dynamic Id 2.3.x (hyperlinked to get_object json) Bitasset Id 2.4.x (hyperlinked to get_object json) (...)
having the raw data in the UI would keep it bleeding edge forward compatible upon core updates as well as help those new to the protocol learn how to navigate asset data
A simple toggle would be possible. I ll see if how it feels when xiang submits PR
If you have time, please review, if there is anything wrong, I can correct it. @sschiessl-bcp @abitmore
Can it be that the description in the BSIP does not match the actual usage of the field? https://github.com/bitshares/bitshares-core/blob/e52b9ffa3cb5c0a0dcdd3d3610486ce08925deba/libraries/protocol/include/graphene/protocol/asset.hpp#L234
From the description the assumption would be that both MSSR and MCFR are a ratio, i.e. a value of something like 1.05 (on chain value 1050). But the MCFR, or rather the value that is put in extension margin_call_fee_ratio
is a percent value of something like 3% (on chain value 30).
@abitmore can you elaborate please?
@sschiessl-bcp from the code / doc you linked:
MCOP = settlement_price / (MSSR - MCFR)
For example, you can have MSSR = 2.5 and MCFR = 1.2, then the result MSSR - MCFR
is 1.3 (note: the result need to be above 1). So MCFR is not a percentage.
What new properties of assets do we need to display in the UI?
The current properties show: https://develop.bitshares.org/#/asset/USD