From 37a740b75701efcd7ac58606f3dce82c9a44b0b0 Mon Sep 17 00:00:00 2001 From: Felix Henneke Date: Mon, 5 Feb 2024 12:05:23 +0100 Subject: [PATCH] make volume fee code identical to code in solver-rewards repo 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. --- src/sql/orderbook/batch_rewards.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sql/orderbook/batch_rewards.sql b/src/sql/orderbook/batch_rewards.sql index d2e1f3e9..3a0cd904 100644 --- a/src/sql/orderbook/batch_rewards.sql +++ b/src/sql/orderbook/batch_rewards.sql @@ -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'