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

Disallow integer truncation during fee assessment #329

Open
alnoki opened this issue Jul 10, 2023 · 0 comments
Open

Disallow integer truncation during fee assessment #329

alnoki opened this issue Jul 10, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@alnoki
Copy link
Member

alnoki commented Jul 10, 2023

General

Presently, Econia assesses fees using integer division: a global taker fee rate is defined in incentives::IncentiveParameters::taker_fee_divisor.

When taker fees are assessed via incentives::assess_taker_fees, integer division is used to calculate the assessed amount, and truncation is allowed.

To disallow truncation, the tick size for any given market would have to be checked during market registration to verify that it is an integer multiple of the global taker fee divisor.

Implications

In the present design, implementing such a check on tick size would require an additional check on any modifications to the taker fee divisor, which can be updated via incentives::update_incentives: truncation may be introduced in existing markets if a new taker fee divisor were to introduced such that the old taker fee divisor is not an integer multiple of the new taker fee divisor.

Since the taker fee divisor is hard-coded to 2000 as a genesis parameter (0.05%), this constraint in the present design, means that only possible future taker fee divisors could be 1000 (0.1%), 500 (0.2%), etc.

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