Background:
Determination of fees in the FIO protocol is inherently complex.
Determination of block producer fee votes, and the selection of fees used within the FIO protocol is a complex process that is multi faceted and layered. It is multi faceted because it involves complex analysis of market factors, token price, protocol governance considerations, cost of BP resources, and resource consumption to determine the fee vote of a given block producer. It is layered because once fee votes are placed by block producers, the vote of each BP is derived from the fee multiplier, and fee ratios which they input during the voting process. It is further layered because following the computation of the BP vote, a final fee determination is then made by the FIO protocol based on the median of the votes present as long as there are over 15 votes from the active BPs for a given fee. Additionally, It is in the protocols best interest to provide a tenable set of fees to the FIO protocol user community. Block producers are faced with the barrier of understanding these many facets and layers as they participate in the fee voting process of the FIO protocol.
Motivation:
The fee multiplier must be updated by block producers as the value of the FIO token changes or we risk the value of the token influencing the fees to make them un-tenable for FIO users. If fee multipliers are too quickly or too slowly modified in response to token fluctuations the result can also become un-tenable fees for FIO users. We consider to provide tooling that will facilitate the setting of the multiplier fee vote for block producers. This can be used immediately by BPs once the FIO token is listed on its' first exchanges.
Security Considerations:
Any tool we create needs to be resistant to tampering and hacking and bad data from exchanges. We want to encourage diversity in the block producer community regarding both the process and data sources used during the selection of fee votes.
Scope of project:
Deliver a reference implementation, guidelines, and alternate implementations for use by block producers.
Important Considerations:
Deliver a reference implementation that can be used immediately as the FIO token value fluctuates after its' initial listing.
Provide a reference implementation that meets the BP community needs.
– Technology choice should be BP selected.
– Involve the BP community as early as this document is agreed.
Provide guidance to BPs regarding how often to perform the voting for the multiplier.
Provide alternate implementations that may be considered for use by the BPs
Deliverables:
A description of the motivations for this effort.
A working tool/reference implementation that enables a BP to set the fee multiplier based on the present exchange rates of the FIO token.
Guidelines for BPs to help in their fee voting participation.
References to other tools that can be used by block producers to establish the value of their fee vote.
Functional Considerations of reference implementation:
The tool will be implemented in javascript (npm).
The tool will permit a user to configure the FIO private and public keys to be used in updating the fee multiplier.
The tool will provide a set of pluggable data providers, each providing token pricing.
The tool will highlight any prices that are outliers in the token pricing.
The tool will provide the ability to select multiple data sources for use in price determination.
The tool will determine price using the median of the selected data sources.
The tool will update the fee multiplier on the FIO protocol for the specified public key by deriving the actor when the update blockchain setting is enabled.
The tool will provide a setting to enable/disable the update of the multiplier vote on the FIO chain.
The tool will provide a setting to enable/disable the output of information relating to pricing and the multiplier used. (this will be in json format)
Guidelines for use:
Price Increases for FIO Token:
When the FIO Token goes up in value, the consequences to the chain are that users may choose to abandon interacting with the chain because its too expensive, this can have the effect of reducing (or eliminating) community interest in the FIO protocol.
Price decreases for FIO Token:
When the price decreases for the FIO Token, the consequences are that users may choose to exploit these changes and perform many operations on the FIO protocol at a reduced cost.
It is recommended that block producers run this tool periodically and check if the variance of the FIO Token value deviates by some threshold. For Example : run this tool once every hour. take immediate action whenever a price change occurs that exceeds 5% of the token value. Each BP should come up with the periodicity, and threshold they are comfortable with.
Notes on exchange APIs
https://api.binance.com/api/v3/avgPrice?symbol=BTCUSDT
{
"mins": 5,
"price": "9785.67139226"
}
https://aws.okex.com/api/spot/v3/instruments/BTC-USDT/ticker
{
"best_ask": "9775.6",
"best_bid": "9775.5",
"instrument_id": "BTC-USDT",
"product_id": "BTC-USDT",
"last": "9777.6",
"last_qty": "0.005091",
"ask": "9775.6",
"best_ask_size": "4.04186337",
"bid": "9775.5",
"best_bid_size": "7.68796495",
"open_24h": "9631",
"high_24h": "9840.1",
"low_24h": "9591.4",
"base_volume_24h": "72333.14938632",
"timestamp": "2020-05-20T13:45:02.704Z",
"quote_volume_24h": "704151900.9"
}
https://api.huobi.pro/market/detail/merged?symbol=btcusdt
{
"status": "ok",
"ch": "market.btcusdt.detail.merged",
"ts": 1589982375689,
"tick": {
"amount": 30354.12683700983,
"open": 9617.02,
"close": 9781.73,
"high": 9840.0,
"id": 215095134870,
"count": 394450,
"low": 9591.83,
"version": 215095134870,
"ask": [
9781.73,
0.044205
],
"vol": 2.9560206460750693E8,
"bid": [
9780.23,
0.20223
]
}
}
Considered References:
Someguy123/steemfeed-js.
We recommend using this as a starting point for our tool, it is pluggable, it will still need extensive modification to make into what we want to provide
this is a javascript implementation,
it uses an adapter model to permit plugin access to various exchanges, it already support Binance, and Huobi and others.
it interfaces to steem accounts, and does not perform any kind of median, or other checks to filter out abhorrent data.
coingecko/steemprice-feed
this is typescript, interfaces to coin gecko for pricing, does not perform any kind of median or other checks to filter out abhorrent data.
Netherdrake/conductor
this is a python implementation that is implemented to manage steem witnesses, heavily integrated with steem.