Skip to content
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

BSIP-0043: Market fee sharing #102

Closed
OpenLedgerApp opened this issue Aug 24, 2018 · 17 comments
Closed

BSIP-0043: Market fee sharing #102

OpenLedgerApp opened this issue Aug 24, 2018 · 17 comments

Comments

@OpenLedgerApp
Copy link
Contributor

OpenLedgerApp commented Aug 24, 2018

BSIP:
Title: Market fee sharing
Authors: OpenLedger
Status:
Type:
Created: 2018-08-23
Discussion: https://github.com/bitshares/bsips/issues/102
Worker:

Abstract

When creating a new asset, the asset issuer is the only beneficiary of the market fees in the current implementation. And the only way to affect the asset community growth is the market fee percentage. For example, one can decrease the market fee and it will result in somewhat larger number of trades with this asset. In this way the asset issuer might get a bigger profit during to increasing the trade volume with this asset.

However, there might be another opportunity to promote the asset and stimulate the trading - use native Bitshares referral program. At this time unfortunately an assets owner is not able to share market fees with registrars and referrers to stimulate them to market the asset trading, so we suggest to add this possibility. Furthermore, enabling this feature for MPAs (e.g. bitCNY or bitUSD) can provide additional bounty for Bitshares registrars and referrals which can lead to more traders joining to the ecosystem.
The workflow may be as following:

An asset issuer defines the market_fee_reward_percent - what percentage of the market fee he wants to share with the registrar in asset options. Registrar defines reward_percent for the referrer for each user(using the already existing BitShares mechanism).
Market fee reward is accumulated on the user account. The user decides when they want to claim the market fee reward and move it to their active balance. There is another operation created asset_claim_reward_operation. Each user pays network fee to call this operation.

Motivation

To make promoting BitShares and bringing new users much more attractive to registrars and referrers by sharing UIAs and MPAs market fees with them.

Rationale

When 'fill_order_operation' executing at the moment of market fee calculation there will be calculate the reward for the registrar used the parameter market_fee_reward_percent. Then this market_fee_reward_percent of the market fee is split between the registrar and referrer according to the referrer_rewards_percentage, which is set up during the new account registration by registrar (please see the parameters for register_account).

Specifications

market_fee_reward_percent asset option

Percent of market fee that will be paid to buyer's registrar. Set by UIA issuer.

market_sharing_whitelist asset option

An optional list of accounts (configurable by the UIA Issuer) could provide increased control over who is eligible to get market rewards.

New database and wallet api methods

get_account_reward(account, asset_symbol) - Returns information about the reward amount for specific asset.
list_account_rewards(account) - Returns information about the reward amount in various assets
claim_reward(account, asset_symbol, amount) - Claim account's reward for the given asset.

account_reward_object

A new BitShares object type in implementation space impl_account_reward_object_type = 2.18.X that tracks the rewards of a single account/asset pair

account_reward_object {
    owner_account,
    asset_type,
    reward_amount
}

account_reward_index

A new index that stores objects of account_reward_object-type in graphene::database and allow random fast access to objects by given criteria

account_reward_index multi-index of account_reward_objects
indexed_by
    [id]
    [owner_account, asset_type]
    [asset_type, reward_amount desc, owner_account]

asset_claim_reward_operation

A new operation used to transfer reward to the account's balance.

asset_claim_reward_operation {
    fee
    claiming_account
    amount_to_claim
}

graphene::chain::database new methods

get_reward(owner_account, asset_id) - Retrieve a particular account's reward in a given asset
adjust_reward(account, delta) - Adjust a particular account's reward in a given asset by a delta

graphene::chain::database modifications

pay_market_fees(seller, recv_asset_object, receives_amount) - Split pay to asset issuer fee, registrar fee and referrer fee. If the registrar is not in the market_sharing_whitelist, split_pay will not happen and the entire fee goes to Asset issuer.
calculate_market_fee(trade_asset, trade_amount) - Calculate value for previous function.
fill_limit_order(order, pays, receives, cull_if_small, fill_price, is_maker) - Append hardfork (HARDFORK_REWARD_TIME) check. Use old or new version of pay_market_fees() function.

asset_create_evaluator, asset_update_evaluator modifications

Append hardfork (HARDFORK_REWARD_TIME) check. Validate additional asset options. Apply additional asset options (market_fee_reward_percent, market_sharing_whitelist)

Unit tests

Add: reward_tests.cpp (asset_rewards_test, asset_claim_reward_test)

Modified: fee_tests.cpp, uia_tests.cpp

Description

Summary for Shareholders

The new modification - market fee sharing - will allow to bring in new clients for BitShares by making it financially lucrative for registrars and referrers. This modification is interesting mostly so asset issuers and registrars/referrers.

Copyright

This document is placed in the public domain.

See Also

bitshares/bitshares-core#1268

@grctest
Copy link
Contributor

grctest commented Aug 24, 2018

What about extending the distribution of market fees to the reserve pool & the asset's holders? Not just the referrers (who already get like 80% of fees since the switch to BTS2.0 from BTSX). Related: bsip 19 and bsip 20.

@OpenLedgerApp
Copy link
Contributor Author

OpenLedgerApp commented Aug 24, 2018

What about extending the distribution of market fees to the reserve pool & the asset's holders? Not just the referrers (who already get like 80% of fees since the switch to BTS2.0 from BTSX). Related: bsip 19 and bsip 20.

The goal is to bring in more people to BitShares. Hence, this BSIP is supposed to make financially appealing for registrars and referrers to register and retain people.
For example, OpenLedger would like to share up to 50% of the market fees with registrars and referrers if they bring extra people.
We will all benefit from BitShares being more popular.

@OpenLedgerApp
Copy link
Contributor Author

Also, if we include the reserve pool, it will become convoluted with a lot of strange assets quickly.
And concerning asset holders - we would like to propose another change that will actually be a superset of bsip 19 and probably bsip 20 as well and that will be related to Fee-backed assets.

@abitmore
Copy link
Member

Please create a pull request so people can review. Thanks.

@ryanRfox
Copy link
Contributor

Point of information question @abitmore : Is the time the repo owner should assign the BSIP number to the author (prior to the PR)? This way the author knows what to name their file(s) in the PR.

Sorry, I have some confusion with the intended process but will get it documented for us all going forward.

Currently we have an open PR for Escrow Services from @TheTaconator using BSIP40, but that has since been assigned to Custom Active Permissions. There is an open PR for BSIP41, BSIP42 is merged. So, what number should @OpenLedgerApp use in their PR? Thanks

@abitmore
Copy link
Member

@ryanRfox sorry, actually I think we don't have a rule so far. Currently you're the only admin of this repository, so please set some rules if have time.

@sschiessl-bcp
Copy link
Collaborator

sschiessl-bcp commented Aug 28, 2018

Please create a pull request so people can review. Thanks.

This!

Anyways, here goes nothing:

  • What is the reasoning to have a seperate "asset_claim_reward_operation", and not funnel it through existing referral reward mechnism?
  • The market_sharing_whitelist allows discrimination. Is there a viable use-case for this?
  • Agreed to the points above, making this a general dividend for holding the asset would be misleading the intent

@ryanRfox
Copy link
Contributor

Did not realize I was an admin on this repo. I will post a contribution guide in the near future to better guide us going forward.

@OpenLedgerApp please use BSIP43, name you file bsip-0043.md and also update the README.md file to add your BSIP to the table. Please make your PR to master. All future discussions should take place therein.

Please note @sschiessl-bcp made a comment just above that may be best taken up within the to-be-created PR. @OpenLedgerApp should add the reference to the PR once created. Thanks

@bitcrab
Copy link
Contributor

bitcrab commented Sep 18, 2018

very interesting idea and I believe it can help Bitshares to expand.

@froooze
Copy link

froooze commented Sep 28, 2018

The referral/reserve pool ratio with 4:1 and lifetime membership is the best tool for further adoption we can have, but needs more attention from different parties.

Integrating a part of the trading fees will allow bigger/better projects and more meberships/refferals, which will benefit all parties on Bitshares in the future and far less worker proposals for community integration are needed.

@OpenLedgerApp
Copy link
Contributor Author

Thanks for your support guys! we can discuss technical details here if you want to participate #107

@froooze
Copy link

froooze commented Oct 25, 2018

Any integration of a gateway fee sharing?

@OpenLedgerApp
Copy link
Contributor Author

Any integration of a gateway fee sharing?
Sorry, can you rephrase please?

@charyury
Copy link

Any integration of a gateway fee sharing?

No, because gateway fees are processed off-chain, this can't be integrated into the core.

@OpenLedgerApp OpenLedgerApp changed the title New BSIP: Market fee sharing BSIP-0043: Market fee sharing Nov 27, 2018
@abitmore
Copy link
Member

Closing since PR #107 has been merged.

@bitphage
Copy link

Current implementation always rewards buyer of the asset (referrer and registrar) no matter was he is_maker: True or False. Instead, it would be more reasonable to always reward Maker.

Example (current): maker keeps sell order of 1000 CNY. When order fills, reward will go to buyer.
Proposed: when order fills, the reward goes to maker.

@sschiessl-bcp
Copy link
Collaborator

Current implementation always rewards buyer of the asset (referrer and registrar) no matter was he is_maker: True or False. Instead, it would be more reasonable to always reward Maker.

Example (current): maker keeps sell order of 1000 CNY. When order fills, reward will go to buyer.
Proposed: when order fills, the reward goes to maker.

This BSIP is closed, already voted in and implemented in the current protocol release. Please open a new issue for discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants