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

Commit

Permalink
make volume fee code identical to code in solver-rewards repo
Browse files Browse the repository at this point in the history
This code change makes the code to compute volume based protocol fees
identical to the code in the solver-rewards repo.

Potentially the implementation is not consistent to what will be done in
the driver. Since volume based fees are not used in production yet this is
not much of an issue for now.

I am also not super sure if we might need different cases for sell and buy orders.
In any case, since we only test those queries in the solver rewards repo
we should make the code consitsant with said repo.
  • Loading branch information
fhenneke committed Feb 5, 2024
1 parent 3441bcc commit 37a740b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sql/orderbook/batch_rewards.sql
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ order_surplus AS (
)
END
WHEN fp.kind = 'volume'
THEN fp.volume_factor / (1 - fp.volume_factor) * os.sell_amount
THEN fp.volume_factor / (1 + fp.volume_factor) * os.sell_amount
END AS protocol_fee,
CASE
WHEN fp.kind = 'surplus'
Expand Down

0 comments on commit 37a740b

Please sign in to comment.