Skip to content

Commit

Permalink
restrict orders which receive quote rewards
Browse files Browse the repository at this point in the history
- only orders where the amounts are below quoted amounts are eligible
- only orders which are not partially fillable are eligible
  • Loading branch information
fhenneke committed Jan 10, 2024
1 parent caa3015 commit 20afdbe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion queries/orderbook/quote_rewards.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ with winning_quotes as (SELECT concat('0x', encode(oq.solver, 'hex')) as solver,
FROM trades t
INNER JOIN orders o ON order_uid = uid
JOIN order_quotes oq ON t.order_uid = oq.order_uid
WHERE block_number >= {{start_block}} AND block_number <= {{end_block}}
WHERE ((o.kind = 'sell' AND o.buy_amount <= oq.buy_amount)
OR (o.kind='buy' AND o.sell_amount >= oq.sell_amount))
AND o.partially_fillable='f'
AND block_number >= {{start_block}} AND block_number <= {{end_block}}
AND oq.solver != '\x0000000000000000000000000000000000000000')

SELECT solver, count(*) AS num_quotes
Expand Down

0 comments on commit 20afdbe

Please sign in to comment.