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

Enable slippage on all chains #454

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
4 changes: 1 addition & 3 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,8 @@ class BufferAccountingConfig:
def from_network(network: Network) -> BufferAccountingConfig:
"""Initialize buffer accounting config for a given network."""
match network:
case Network.MAINNET:
case Network.MAINNET | Network.GNOSIS | Network.ARBITRUM_ONE:
include_slippage = True
case Network.GNOSIS | Network.ARBITRUM_ONE:
include_slippage = False
case _:
raise ValueError(
f"No buffer accounting config set up for network {network}."
Expand Down
2 changes: 1 addition & 1 deletion src/fetch/dune.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def get_period_slippage(self, job_id: Optional[str] = None) -> list[DuneRecord]:

return self._get_query_results(
self._parameterized_query(
QUERIES["PERIOD_SLIPPAGE"], params=self._period_params()
QUERIES["PERIOD_SLIPPAGE"], params=self._network_and_period_params()
),
job_id,
)
Expand Down
5 changes: 5 additions & 0 deletions src/fetch/payouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,9 @@ def construct_payouts(
for _, payment in complete_payout_df.iterrows()
)

total_slippage = slippage_df["eth_slippage_wei"].sum()
total_network_fees = batch_rewards_df["network_fee_eth"].sum()

log_saver.print(
"Payment breakdown (ignoring service fees):\n"
f"Performance Reward: {performance_reward / 10 ** 18:.4f}\n"
Expand All @@ -594,6 +597,8 @@ def construct_payouts(
f"Partner Fees Tax: {partner_fee_tax_wei / 10 ** 18:.4f}\n"
f"Partner Fees: {total_partner_fee_wei_taxed / 10 ** 18:.4f}\n"
f"COW DAO Service Fees: {service_fee / 10 ** 18:.4f}\n\n"
f"Network Fees: {total_network_fees / 10**18:.4f}\n"
f"Slippage: {total_slippage / 10**18:.4f}\n\n"
f"Exchange rate native token to COW: {exchange_rate_native_to_cow:.4f} COW/native token\n"
f"Exchange rate native token to ETH: {exchange_rate_native_to_eth:.4f} ETH/native token\n",
category=Category.TOTALS,
Expand Down
Loading