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

Computing slippage for individual transactions not possible #362

Open
fhenneke opened this issue May 28, 2024 · 0 comments
Open

Computing slippage for individual transactions not possible #362

fhenneke opened this issue May 28, 2024 · 0 comments

Comments

@fhenneke
Copy link
Collaborator

Restricting the slippage query to an individual transaction hash in this query is currently broken due to the table

,raw_protocol_fee_data as (
select
order_uid,
tx_hash,
cast(cast(data.protocol_fee as varchar) as int256) as protocol_fee,
data.protocol_fee_token as protocol_fee_token,
cast(cast(data.surplus_fee as varchar) as int256) as surplus_fee,
solver,
symbol
from cowswap.raw_order_rewards ror
join tokens.erc20 t
on t.contract_address = from_hex(ror.data.protocol_fee_token)
and blockchain = 'ethereum'
where
block_number >= (select start_block from block_range) and block_number <= (select end_block from block_range)
and data.protocol_fee_native_price > 0
)

which does not use the same filtering as all the other tables at the top.

Other queries for slippage do work but do not implement the correction for charging protocol fees in the correct token.

Potentially, joining on filtered_trades might help. Then the filtering on block numbers could be removed as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant