You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/guide/stablecoin-dex/view-the-orderbook.mdx
+41-30Lines changed: 41 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,15 +21,18 @@ In this guide, we use [Index Supply](https://www.indexsupply.net) as our indexin
21
21
22
22
Query the best bid and ask prices to calculate the current spread for a token pair.
23
23
24
-
Find the highest bid prices (buyers) for PathUSD. This query filters out fully filled and cancelled orders, groups by price level (tick), and shows the top 5 bid prices with their total liquidity.
24
+
These examples use the mainnet `USDC.e / pathUSD` orderbook; `pathUSD` is the quote token for `USDC.e` — see [Quote Tokens](/protocol/exchange/quote-tokens).
25
+
26
+
Find the highest bid prices (buyers) for the `USDC.e / pathUSD` book. This query filters out fully filled and cancelled orders, groups by price level (tick), and shows the top 5 bid prices with their total liquidity.
25
27
26
28
<IndexSupplyQuery
27
-
title={'Best Bid Prices for PathUSD'}
29
+
chainId={4217}
30
+
title={'Best Bid Prices for USDC.e'}
28
31
query={`SELECT
29
32
tick as price,
30
33
SUM(amount) as total_liquidity
31
34
FROM orderplaced
32
-
WHERE token = '0x20c0000000000000000000000000000000000000'
35
+
WHERE token = '0x20c000000000000000000000b9537d11c60e8b50'
33
36
AND "isBid" = true
34
37
AND NOT EXISTS (
35
38
SELECT 1 FROM orderfilled
@@ -46,15 +49,16 @@ Find the highest bid prices (buyers) for PathUSD. This query filters out fully f
Find the lowest ask prices (sellers) for PathUSD. The spread is the difference between the highest bid and lowest ask price.
52
+
Find the lowest ask prices (sellers) for the `USDC.e / pathUSD` book. The spread is the difference between the highest bid and lowest ask price.
50
53
51
54
<IndexSupplyQuery
52
-
title={'Best Ask Prices for PathUSD'}
55
+
chainId={4217}
56
+
title={'Best Ask Prices for USDC.e'}
53
57
query={`SELECT
54
58
tick as price,
55
59
SUM(amount) as total_liquidity
56
60
FROM orderplaced
57
-
WHERE token = '0x20c0000000000000000000000000000000000000'
61
+
WHERE token = '0x20c000000000000000000000b9537d11c60e8b50'
58
62
AND "isBid" = false
59
63
AND NOT EXISTS (
60
64
SELECT 1 FROM orderfilled
@@ -75,17 +79,18 @@ Find the lowest ask prices (sellers) for PathUSD. The spread is the difference b
75
79
76
80
View aggregated liquidity at each price level to understand the orderbook structure.
77
81
78
-
This query shows all active orders for BetaUSD, including both regular and flip orders.
82
+
This query shows all active orders in the `USDC.e / pathUSD` book, including both regular and flip orders.
79
83
80
84
<IndexSupplyQuery
81
-
title={'BetaUSD Order Depth by Price Level'}
85
+
chainId={4217}
86
+
title={'USDC.e Order Depth by Price Level'}
82
87
query={`SELECT
83
88
tick as price,
84
89
"isBid" as is_bid,
85
90
COUNT("orderId") as num_orders,
86
91
SUM(amount) as total_amount
87
92
FROM orderplaced
88
-
WHERE token = '0x20c0000000000000000000000000000000000002'
93
+
WHERE token = '0x20c000000000000000000000b9537d11c60e8b50'
89
94
AND NOT EXISTS (
90
95
SELECT 1 FROM orderfilled
91
96
WHERE orderfilled."orderId" = orderplaced."orderId"
@@ -107,10 +112,11 @@ This query shows all active orders for BetaUSD, including both regular and flip
107
112
108
113
Get detailed information about a specific order including its placement details, fill history, and cancellation status.
109
114
110
-
This query inspects the details of the most recent order for PathUSD. It shows when the order was created, at what price (tick), the order size, whether it's a flip order, and who placed it.
115
+
This query inspects the details of the most recent order in the `USDC.e / pathUSD` book. It shows when the order was created, at what price (tick), the order size, whether it's a flip order, and who placed it.
111
116
112
117
<IndexSupplyQuery
113
-
title={'Order Placement Details'}
118
+
chainId={4217}
119
+
title={'Order Placement Details for USDC.e'}
114
120
query={`SELECT
115
121
"orderId",
116
122
tick,
@@ -123,45 +129,49 @@ This query inspects the details of the most recent order for PathUSD. It shows w
123
129
block_num,
124
130
tx_hash
125
131
FROM orderplaced
126
-
WHERE token = '0x20c0000000000000000000000000000000000000'
132
+
WHERE token = '0x20c000000000000000000000b9537d11c60e8b50'
127
133
ORDER BY block_num DESC
128
134
LIMIT 1`}
129
135
signatures={["OrderPlaced"]}
130
136
/>
131
137
132
138
#### Order fill status
133
139
134
-
Check if an order has been partially or fully filled. This query shows up to 5 fill events for order number `2`, including the amount filled in each transaction and whether it was a partial fill.
140
+
Check if recent `USDC.e` orders have been partially or fully filled. This query shows up to 5 fill events for the `USDC.e / pathUSD` market, including the amount filled in each transaction and whether it was a partial fill.
135
141
136
142
<IndexSupplyQuery
137
-
title={'Order Fill History'}
143
+
chainId={4217}
144
+
title={'Order Fill History for USDC.e'}
138
145
query={`SELECT
139
-
"orderId",
140
-
"amountFilled",
141
-
"partialFill",
142
-
block_num,
143
-
tx_hash
144
-
FROM orderfilled
145
-
WHERE "orderId" = 2
146
-
ORDER BY block_num DESC
146
+
ofl."orderId",
147
+
ofl."amountFilled",
148
+
ofl."partialFill",
149
+
ofl.block_num,
150
+
ofl.tx_hash
151
+
FROM orderfilled ofl
152
+
INNER JOIN orderplaced op
153
+
ON ofl."orderId" = op."orderId"
154
+
WHERE op.token = '0x20c000000000000000000000b9537d11c60e8b50'
155
+
ORDER BY ofl.block_num DESC
147
156
LIMIT 5`}
148
-
signatures={["OrderFilled"]}
157
+
signatures={["OrderFilled", "OrderPlaced"]}
149
158
/>
150
159
151
160
#### Cancelled orders
152
161
153
-
Check if an order has been cancelled. This query returns an order for PathUSD that was explicitly cancelled by the maker before being fully filled.
162
+
Check if a `USDC.e`order has been cancelled. This query returns a recent order from the `USDC.e / pathUSD` book that was explicitly cancelled by the maker before being fully filled.
154
163
155
164
<IndexSupplyQuery
156
-
title={'Order Cancellation Status'}
165
+
chainId={4217}
166
+
title={'Order Cancellation Status for USDC.e'}
157
167
query={`SELECT
158
168
oc."orderId",
159
169
oc.block_num,
160
170
oc.tx_hash
161
171
FROM ordercancelled oc
162
172
INNER JOIN orderplaced op ON oc."orderId" = op."orderId"
163
-
WHERE op.token = '0x20c0000000000000000000000000000000000000'
164
-
ORDER BY op.block_num DESC
173
+
WHERE op.token = '0x20c000000000000000000000b9537d11c60e8b50'
174
+
ORDER BY oc.block_num DESC
165
175
LIMIT 1`}
166
176
signatures={["OrderCancelled", "OrderPlaced"]}
167
177
/>
@@ -170,10 +180,11 @@ Check if an order has been cancelled. This query returns an order for PathUSD th
170
180
171
181
View the last prices a token traded at to understand recent market activity.
172
182
173
-
This query joins order fill events with their corresponding placement details to show the price tick and amount for recent trades.
183
+
This query joins order fill events with their corresponding placement details to show the price tick and amount for recent trades in the `USDC.e / pathUSD` book.
174
184
175
185
<IndexSupplyQuery
176
-
title={'Recent Trade Prices for PathUSD'}
186
+
chainId={4217}
187
+
title={'Recent Trade Prices for USDC.e'}
177
188
query={`SELECT
178
189
ofl.block_num,
179
190
ofl."orderId",
@@ -183,7 +194,7 @@ This query joins order fill events with their corresponding placement details to
183
194
FROM orderfilled ofl
184
195
INNER JOIN orderplaced o
185
196
ON ofl."orderId" = o."orderId"
186
-
WHERE o.token = '0x20c0000000000000000000000000000000000000'
197
+
WHERE o.token = '0x20c000000000000000000000b9537d11c60e8b50'
0 commit comments