Skip to content

Commit 8ea81a3

Browse files
authored
Fix usdc native price issue (#523)
This PR corrects the USDC native price on mainnet for certain auctions, due to a bogus USDC native price that temporarily appeared. The bogus price that appeared was this one: 56150942718177291268870111232 which suggests that the price of ETH is ``` 10^36 / 56150942718177291268870111232 / 10^6 = 17.80914 USDC. ``` Prod mainnet auctions with id in [10410727, 10410755] were affected. No barn auctions seem to have been affected We use the correct price that appeared in auction 10410756 to correct all previous ones ``` mainnet=> select * from auction_prices where token='\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' and auction_id = 10410756; auction_id | token | price ------------+--------------------------------------------+----------------------------- 10410756 | \xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 | 523378898648164562100027392 (1 row) ```
1 parent caf60d7 commit 8ea81a3

File tree

2 files changed

+44
-8
lines changed

2 files changed

+44
-8
lines changed

queries/orderbook/auction_prices_corrections.sql

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,42 @@ auction_prices_corrections (blockchain, environment, auction_id, token, price) a
8181
-- price taken from nearby auction 10325156
8282
('ethereum', 'prod', 10325171::bigint, '\x35d8949372d46b7a3d5a56006ae77b215fc69bc0'::bytea, 533247805376780::numeric(78, 0)),
8383

84+
-- bogus baseline price for USDC that caused a crazy native price for the token
85+
-- query to confirm results: select * from auction_prices where token='\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' and price > 56150942718177291268870111000;
86+
-- fixing 29 auctions in total
87+
88+
('ethereum', 'prod', 10410755::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
89+
('ethereum', 'prod', 10410754::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
90+
('ethereum', 'prod', 10410753::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
91+
('ethereum', 'prod', 10410752::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
92+
('ethereum', 'prod', 10410751::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
93+
('ethereum', 'prod', 10410750::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
94+
('ethereum', 'prod', 10410749::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
95+
('ethereum', 'prod', 10410748::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
96+
('ethereum', 'prod', 10410747::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
97+
('ethereum', 'prod', 10410746::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
98+
('ethereum', 'prod', 10410745::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
99+
('ethereum', 'prod', 10410744::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
100+
('ethereum', 'prod', 10410743::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
101+
('ethereum', 'prod', 10410742::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
102+
('ethereum', 'prod', 10410741::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
103+
('ethereum', 'prod', 10410740::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
104+
('ethereum', 'prod', 10410739::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
105+
('ethereum', 'prod', 10410738::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
106+
('ethereum', 'prod', 10410737::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
107+
('ethereum', 'prod', 10410736::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
108+
('ethereum', 'prod', 10410735::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
109+
('ethereum', 'prod', 10410734::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
110+
('ethereum', 'prod', 10410733::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
111+
('ethereum', 'prod', 10410732::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
112+
('ethereum', 'prod', 10410731::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
113+
('ethereum', 'prod', 10410730::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
114+
('ethereum', 'prod', 10410729::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
115+
('ethereum', 'prod', 10410728::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
116+
('ethereum', 'prod', 10410727::bigint, '\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea, 524485367578693373855268864::numeric(78, 0)),
117+
118+
----------- USDC fix done -----------
119+
84120
-- correction only relevant for the tests in the test_batch_rewards.py file
85121
('ethereum', 'prod', 53::bigint, '\x02'::bytea, 500000000000000::numeric(78, 0))
86122

queries/orderbook/excluded_quotes.sql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
-- this table excludes certain accounts due to wash-trading
1+
-- this table excludes certain accounts due to repetitive trading back and forth
22
excluded_quotes as ( --noqa: PRS
33
select uid as order_uid
44
from orders
55
where (
6-
-- wash-trading USDC/DAI on mainnet
6+
-- repetitive trading USDC/DAI on mainnet
77
(
88
owner = '\x687f584fd1f4a4d9eb277c03a24fe28f4b0675b7'
99
or
@@ -20,7 +20,7 @@ excluded_quotes as ( --noqa: PRS
2020
)
2121
or
2222
(
23-
-- wash-trading USDC/USDT on mainnet
23+
-- repetitive trading USDC/USDT on mainnet
2424
(
2525
owner = '\x9071bfe89d0880edc21e977f3837b5503200f11d'
2626
or
@@ -55,7 +55,7 @@ excluded_quotes as ( --noqa: PRS
5555
)
5656
or
5757
(
58-
-- wash-trading DAI/USDT on mainnet
58+
-- repetitive trading DAI/USDT on mainnet
5959
owner = '\xbde2ff8a6c87594dff3ef96ef7809be5d5eacde4'
6060
and
6161
(
@@ -66,7 +66,7 @@ excluded_quotes as ( --noqa: PRS
6666
)
6767
or
6868
(
69-
-- wash-trading WETH/WSTETH on mainnet
69+
-- repetitive trading WETH/WSTETH on mainnet
7070
owner = '\x8ca1187f83f434d5db5c7688fd64bffa281acccc'
7171
and
7272
(
@@ -77,7 +77,7 @@ excluded_quotes as ( --noqa: PRS
7777
)
7878
or
7979
(
80-
-- wash-trading USDC/USDBC on Base
80+
-- repetitive trading USDC/USDBC on Base
8181
owner = '\xd5c813a01224cabc76e4cd8e10e4029dca0bd7f9'
8282
and
8383
(
@@ -88,7 +88,7 @@ excluded_quotes as ( --noqa: PRS
8888
)
8989
or
9090
(
91-
-- wash-trading USDC/USDCE on Arbitrum
91+
-- repetitive trading USDC/USDCE on Arbitrum
9292
owner = '\xd7fcb6fdb9e51507f872442efb4d5c40a60c6d36'
9393
and
9494
(
@@ -99,7 +99,7 @@ excluded_quotes as ( --noqa: PRS
9999
)
100100
or
101101
(
102-
-- wash-trading WETH/USDC on Base
102+
-- repetitive trading WETH/USDC on Base
103103
owner = '\x2bcd269ff2c06c95834cb3eca0e52987e58cc5b1'
104104
and
105105
(

0 commit comments

Comments
 (0)