-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BSIP67: Dynamic Market Fees #133
base: master
Are you sure you want to change the base?
BSIP67: Dynamic Market Fees #133
Conversation
Please squash this PR and use a sensible commit message. |
One of the ways to increase the trade volume can be Dynamic Market Fees that will provide additional discounts for active traders. | ||
For example, to set lower fees for trading larger volumes. | ||
|
||
So, instead of market fee, an asset owner can optionally set up dynamic_market_fee_percent property that may look like a following example table. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please elaborate. Since the given table is only meant as an example, how is that property to be set up and evaluated, and which degrees of freedom does this allow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A table is an example. UIA owner can edit this table, set up a percent and trading volume.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That still doesnt define what the degrees of freedom are
This proposal introduces a significant cost in terms of CPU and RAM for all node operators. IMO this needs to be balanced against the potential benefits. |
That's a good point! We have thought about it. We are planning to check and monitor performance KPIs at the beginning of implementation. It will allow us to make sure CPU and RAM are tracked. If we face some issues and we don't have any turnaround, it will be indicated ASAP. |
@sschiessl-bcp has suggested elsewhere that we add a Risks section to the BSIP Template. @pmconrad may I request your craft your comment above into a paragraph highlighting the potential risk(s) you foresee? My desire is the identified risks will be added to the PR by @OpenLedgerApp |
Suggestion: RisksCPU OverheadThe proposed fee calculations will have to be performed on every trade. This adds significant burden on top of the already quite heavyweight market engine. While this is probably not a big problem with today's transaction volume, it will further limit how far our chain scales in terms of tx/s. RAM OverheadThe proposed calculations require logging the trade volume of all traders over a period of time, separately for each traded asset. With both the number of users and the number of assets growing over time, the required amount of RAM will grow squarely over time. This does not scale well. |
Thank you @pmconrad for adding the Risks section. May I request @OpenLedgerApp update the PR to include the Risks just prior to the Summary for Shareholders? |
My thoughts on calculation impacts/mitigation:
|
We must update the trade volume per user and asset for every trade.
This is already described in the section "30-day volume method". It requires two values per user and asset. |
I would very much like this BSIP in two steps. First, introduce maker-taker, then maybe dynamic fees like indicated above. Limit order would have fixed fee plus market fee, both for maker and taker. But, when filled
Thoughts? |
This! |
We have made a prototype in order to measure performance As you can see in the picture attached, our worker has no significant influence on BitShares performance: For more details please refer the prototype. Here is the link - https://github.com/openledger/bitshares-core/commits/issue-dmf |
@OpenLedgerApp try test with 1M users? and around 1K trading pairs (although there can be more)? |
The sources are located - https://github.com/openledger/bitshares-core/commits/issue-dmf |
Sorry, I'm not understanding the graph. What is the X-axis representing? It seems like there are both red and blue plots for about 2/3 of the data, but only blue when the value jump. What accounts for the jump? Are there red values as well? |
AFAICS your test creates 1 M users but only 1000 traders, and it trades only 1 asset pair. |
We have made test with 100 asset pair. As you can see in the picture attached, our worker has no significant influence on BitShares performance: sources are located - https://github.com/openledger/bitshares-core/commits/issue-dmf |
Now you have 100 assets and 1000 traders, but each trader is using only 1 or 2 assets. Like abit said, please repeat your test with 1M traders and 1k trading pairs where each trader trades in a significant portion of these pairs. Also, please explain your graphics, as Ryan has requested. I don't understand them either. |
We will update our test in the near future. |
We have modified the tests. There are 100 traders and 100 assets where each trader trades 100 assets. We have got the following results: Origin bitshares takes 2095465 milliseconds, and with DMF logic 2099182 milliseconds. New sources are located openledger/bitshares-core@e4f9f44
Red line shows how much time origin bitshares take and an other line shows how much time the same test takes with DMF logic. |
@ryanRfox please assign BSIP number. |
We would like to put our BSIP on voting. What should we do to put this BSIP on voting? @ryanRfox please let us know. Thanks in advance! |
account_id_type owner; | ||
asset_id_type asset; | ||
timestamp first_trade_date; //first trade date for this asset | ||
share_type total_volume; //total bought asset volume |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't use share_type
for this data due to the high possibility of overflow. I guess a 128-bit data type would be sufficient, and in the implementation still need to deal with overflows.
@OpenLedgerApp please update the document and rename the file with the assigned BSIP number. |
Please address all comments, and update your document. Also I am still wondering if only maker/taker differentiation should be an option as well when voting as the simple version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For more realistic data I have slightly modified your existing implementation to compute the trade statistics for all trades since the beginning of time while still applying the old market fee calculation rules.
As of block 35M there are roundabout 800,000 trade statistics objects generated which is about 32MB raw, plus index overhead. Replay time is slightly worse but acceptable IMO (1-2%). Both are acceptable IMO. Also, there is some room for improvement in the implementation, e. g. trade statistics should be removed if there were no trades within the last 30 days.
IMO this BSIP is not ready for voting, because the specification is virtually non-existent. Please see #170 for an example what the "Specification" section should contain.
It is also confusing because it presents several different options without making it clear which option is the one that will be implemented. Please focus on one option only. Considered alternatives should be mentioned briefly in the "Discussion" section, together with a reason why they were dismissed.
Dear BitShares Community,
We would like to introduce the Dynamic Market Fees BSIP.
The purpose is to support high-volume trading and market makers. Thus making it more profitable for them. We believe it will bring more people to BitShares.
As per BitShares Core Team request we have spent some time drafting this BSIP.
And here's the resulting BSIP:
https://github.com/openledger/bsips/blob/bsip-dynamicmarketfees/bsip-00XX%20Dynamic%20market%20fees.md
The pull request is here:
#133
Forum thread is here:
https://bitsharestalk.org/index.php?topic=27589.0
Please share your opinion.
If you think it might help BitShares, please voice your opinion and vote for it, when the worker is created.
Sincerely,
Denis Sokolov
OpenLedger