-
Notifications
You must be signed in to change notification settings - Fork 7
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
Pool: variable commission fee #393
Comments
we can use a simple formula that gives minimum swap fee based on the amount of staked tokens:
a few examples: we can calculate this on each swap. The actual change can happen in the pool contract let compute_swap: ComputeSwap = compute_swap(
&env,
pool_balance_sell,
pool_balance_buy,
offer_amount,
config.protocol_fee_rate(), // we change this input parameter to be calculated before this function call
referral_fee_bps,
); |
'C' should be configurable by admin at any time. Ideally, we should somehow automatically adjust the value based on the staked amount in the pool(s) |
another approach to this problem would be if we actually use the staking contract and keep the variable fee in its storage. We can update the calculation whenever user does stake/unstake and then in pool just check for the |
currently, the commission fee for the staking contract is set with as a hard % upon instantiating any pool. We should be using a variable percent for users that have staked (ideally, different tiers for the different staked amounts), so that way we incentivize our users.
The text was updated successfully, but these errors were encountered: