Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
temp fix for barter using same address in staging and prod
Browse files Browse the repository at this point in the history
  • Loading branch information
harisang committed Aug 30, 2024
1 parent bb1727e commit f134c56
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/sql/orderbook/barn_batch_rewards.sql
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,10 @@ SELECT
when tx_hash is NULL then NULL
else concat('0x', encode(tx_hash, 'hex'))
end as tx_hash,
concat('0x', encode(solver, 'hex')) as solver,
CASE
WHEN solver ='\xC7899Ff6A3aC2FF59261bD960A8C880DF06E1041' THEN concat('0x', encode('\x5f7A6aeec3D3E80558278632954DA4b730996F83', 'hex')) -- workaround for week where Barter used a single account for testing colocation in staging and then used the same account for prod
ELSE concat('0x', encode(solver, 'hex'))
END as solver,
execution_cost :: text as execution_cost,
surplus :: text as surplus,
protocol_fee :: text as protocol_fee,
Expand Down
12 changes: 9 additions & 3 deletions src/sql/orderbook/barn_order_rewards.sql
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,11 @@ order_protocol_fee_prices AS (
),
winning_quotes as (
SELECT
concat('0x', encode(oq.solver, 'hex')) as quote_solver,
oq.order_uid
CASE
WHEN solver ='\xC7899Ff6A3aC2FF59261bD960A8C880DF06E1041' THEN concat('0x', encode('\x5f7A6aeec3D3E80558278632954DA4b730996F83', 'hex')) -- workaround for week where Barter used a single account for testing colocation in staging and then used the same account for prod
ELSE concat('0x', encode(solver, 'hex'))
END as quote_solver,
oq.order_uid
FROM
trades t
INNER JOIN orders o ON order_uid = uid
Expand All @@ -351,7 +354,10 @@ winning_quotes as (
select
trade_hashes.block_number as block_number,
concat('0x', encode(trade_hashes.order_uid, 'hex')) as order_uid,
concat('0x', encode(oq.solver, 'hex')) as solver,
CASE
WHEN trade_hashes.solver ='\xC7899Ff6A3aC2FF59261bD960A8C880DF06E1041' THEN concat('0x', encode('\x5f7A6aeec3D3E80558278632954DA4b730996F83', 'hex')) -- workaround for week where Barter used a single account for testing colocation in staging and then used the same account for prod
ELSE concat('0x', encode(trade_hashes.solver, 'hex'))
END as solver,
quote_solver,
concat('0x', encode(trade_hashes.tx_hash, 'hex')) as tx_hash,
coalesce(surplus_fee, 0) :: text as surplus_fee,
Expand Down

0 comments on commit f134c56

Please sign in to comment.