Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Fix volume cap for protocol fees for sell orders #67

Merged
merged 1 commit into from
Jan 25, 2024
Merged

Conversation

fhenneke
Copy link
Contributor

@fhenneke fhenneke commented Jan 25, 2024

The cap for volume fees in the current code is based on the assumption that the protocol fee on surplus for sell orders is a fraction of the amount received by the user, i.e., a fraction of the total buy amount. The implementation in the driver is based on the cap being a fraction of the amount sent by the user, i.e., a fraction of the total sell amount. This resulted in an issue due to fees in sell tokens being implicitly converted to buy tokens via the uniform clearing price and not using effective directional prices.

This PR changes the cap for SELL orders to be consistent with the current driver implementation.

This requires re-syncing data to dune.

The code should be changed back in combination with a fix to the driver for rank by surplus since the concept of observed fee has no meaning there.

@fhenneke fhenneke requested a review from harisang January 25, 2024 16:51
Copy link
Contributor

@harisang harisang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@harisang harisang merged commit 28956e6 into main Jan 25, 2024
4 of 6 checks passed
@harisang harisang deleted the fix_volume_cap branch January 25, 2024 23:22
@harisang harisang changed the title Fix volume cap for protocol fees Fix volume cap for protocol fees for sell orders Jan 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants