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

Consider execution-time fee specification schema with centralized IntegratorFeeStores #640

Open
alnoki opened this issue Nov 28, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@alnoki
Copy link
Member

alnoki commented Nov 28, 2023

Related: #336

Consider allowing fee rate to be specified at execution time, that is, during the function call in which a trade is processed

For example, rather than passing only integrator address, pass integrator and fee_rate_bps, so that integrators can specify the fees.

This schema will allow, for example:

  • Sophisticated traders who trade using SDKs to pay no taker fees
  • Granular control for frontend partners to specify fees based on business logic like perks, giveaways, etc.
  • Aggregators to invoke Econia trades with 0 taker fees, rather than, for example, trying to rebate fees back to users through a FeeStore

If the specified integrator address doesn't have a IntegratorFeeStore, or if the fee rate is specified as 0, then no fees will be charged

@alnoki alnoki added the enhancement New feature or request label Nov 28, 2023
@alnoki alnoki changed the title Consider execution-time fee specification schema Consider execution-time fee specification schema with centralized IntegratorFeeStores Nov 29, 2023
@alnoki
Copy link
Member Author

alnoki commented Nov 29, 2023

  • Have integrator fee stores be a unit of account in a global registry, like a table for each market
  • Then when fees get deposited to an integrator, their table entry just needs to be updated
    • The fee amount for each integrator accrued could be an aggregator, to further enable parallelism
  • At the user level, emit events or otherwise track a list of all the markets that an integrator has registered under (index by user and by market)
  • Coins could go into a global vault, rather than moved between counterparties and integrator in each trade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant