Order Book
Preview
| Price USD | Size SOL | Cumulative total SOL |
|---|---|---|
| 782 | 8.6K | |
| 1.2K | 7.8K | |
| 1.1K | 6.6K | |
| 2.2K | 5.5K | |
| 1.8K | 3.3K | |
| 278 | 1.5K | |
| 363 | 1.2K | |
| 574 | 858 | |
| 284 | 284 |
| Price USD | Size SOL | Cumulative total SOL |
|---|---|---|
| 194 | 194 | |
| 543 | 737 | |
| 314 | 1.1K | |
| 592 | 1.6K | |
| 715 | 2.4K | |
| 744 | 3.1K | |
| 789 | 3.9K | |
| 735 | 4.6K | |
| 1.1K | 5.7K |
Hover a level to see the cost of filling up to it
Click a price to use it, for example in an order ticket.
Install
Add it with your package manager, or copy the source manually.
Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide
Download the release archive to your project root, then install the local file.
Import the shared styles once in your application.
API Reference
OrderBook
bidsreadonly OrderBookLevel[]Snapshot of buy levels. Equal prices are combined; invalid and zero sizes are omitted.
—asksreadonly OrderBookLevel[]Snapshot of sell levels. Supply new arrays when the book changes.
—levels?numberNumber of nearest levels to show on each side.
9lastPrice?numberLast traded price. Omit to show the midpoint of the best bid and ask.
—label?string—baseSymbol?stringquoteSymbol?stringUSDformatPrice?(value: number) => stringvalue.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })formatSize?(value: number) => stringvalue.toLocaleString("en-US", { notation: "compact", maximumFractionDigits: 1 })v-model:activeLevel?OrderBookActiveLevelThe level whose depth is inspected: it and every better level on its side are highlighted, and `OrderBookDepthSummary` totals them. Controlled.
—defaultActiveLevel?OrderBookActiveLevel—@level-select?(level: { price: number; size: number; total: number }, side: 'bid' | 'ask') => voidFired when a price is chosen; listening makes every price a button.
—labels?Partial<OrderBookMessages>Override any built-in string.
—class?string—@active-level-change?(value: OrderBookProps['activeLevel']) => void—#default?slotCompose `OrderBookHeader`, `OrderBookSide`, `OrderBookSpread`, `OrderBookDepthSummary` and `OrderBookBalance`; omit it for the default ladder.
—OrderBookHeader
class?string—OrderBookSide
sideOrderBookSideNameWhich half of the book to list: asks run best-last, bids best-first.
—class?string—OrderBookSpread
class?string—OrderBookBalance
class?string—OrderBookDepthSummary
#placeholder?slotShown while no level is inspected.
—#default?{ summary: OrderBookDepthSummaryData }Custom readout for the inspected levels.
—class?string—Updated