Skip to content

Commit

Permalink
Merge branch 'main' into change_exchange_rate_formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
harisang authored Dec 14, 2024
2 parents 52cb82b + 22d6161 commit 1a3d8e1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
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:.6g} COW/native token\n"
f"Exchange rate native token to ETH: {exchange_rate_native_to_eth:.6g} ETH/native token\n",
category=Category.TOTALS,
Expand Down

0 comments on commit 1a3d8e1

Please sign in to comment.