Skip to content

Commit

Permalink
join on block numbers (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
bh2smith authored Jan 4, 2023
1 parent 83bf8dd commit c7e9c85
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions queries/dune_v2/period_slippage.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Query here: https://dune.com/queries/1777559
-- https://github.com/cowprotocol/solver-rewards/pull/169
with
filtered_trades as (
select t.block_time,
Expand All @@ -20,7 +20,8 @@ filtered_trades as (
'0x9008d19f58aabd9ed0d60971565aa8510560ab41' as contract_address
from cow_protocol_ethereum.trades t
join cow_protocol_ethereum.batches b
on t.tx_hash = b.tx_hash
on t.block_number = b.block_number
and t.tx_hash = b.tx_hash
left outer join cow_protocol_ethereum.order_rewards f
on f.tx_hash = t.tx_hash
and f.order_uid = t.order_uid
Expand Down Expand Up @@ -87,7 +88,8 @@ other_transfers as (
end as transfer_type
from erc20_ethereum.evt_Transfer t
inner join cow_protocol_ethereum.batches b
on evt_tx_hash = b.tx_hash
on evt_block_number = b.block_number
and evt_tx_hash = b.tx_hash
inner join batchwise_traders bt
on evt_tx_hash = bt.tx_hash
where b.block_time between '{{StartTime}}' and '{{EndTime}}'
Expand Down
2 changes: 1 addition & 1 deletion src/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@ def with_params(
name="Solver Slippage for Period",
filepath="period_slippage.sql",
v1_id=1728478,
v2_id=1783854,
v2_id=1836718,
),
}

0 comments on commit c7e9c85

Please sign in to comment.