NEW

CCIP is now live for all developers. See what's new.

Data Streams Liquidity-Weighted Bid-Ask Prices (LWBA)

Chainlink Data Streams provides reports with a Mid and Liquidity-Weighted Bid and Ask (LWBA) prices. These three prices form a pricing spread that offers protocols insight into market activity based on the current state of the order books.

Bid and Ask prices

What are Bid and Ask prices?

Bid and Ask prices appear in the order book of an exchange and represent the trading orders buyers and sellers actively submit. These prices drive potential market transactions.

On an exchange, the Mid price in the order book is derived from the midpoint between the best Bid and the best Ask price. While the Mid price serves as a useful reference, for instance, in calculating funding rates, it is important to note that it is not a price at which trades should be executed. Actual trades must match an open bid or ask.

  • Bid price: The Bid price refers to the maximum price that a buyer is willing to pay for an asset. It represents the highest price at which a buyer would agree to buy.
  • Ask price: The Ask price is the minimum price at which a seller is willing to sell their asset. It represents the lowest price at which a seller would agree to sell.

Key characteristics

  • Price spread: The difference between the Ask and the Bid prices is the spread. A narrower spread typically indicates a more liquid market, whereas a wider spread can signify less liquidity or higher volatility.
  • Market orders: When traders place market orders to buy or sell immediately, they accept the best available Ask or Bid prices from the market. This interaction drives immediate transactions but can also impact the market price if the order size is substantial compared to the available volume.
  • Liquidity and volume: Bid and Ask prices are not static and can fluctuate based on the asset's trading volume and market liquidity. High liquidity generally results in a narrower spread, which enables more trading activity near this spread and facilitates smoother transactions without substantial impacts on the market price.

In Chainlink Data Streams, Bid and Ask prices play a pivotal role in the construction of Liquidity-Weighted Bid and Ask (LWBA) prices.

What is a Liquidity-Weighted price?

A Liquidity-Weighted price considers the Bid and Ask prices based on the available liquidity at each price level in the order books. This method weights price data by the volume of assets available at each price point, and provides a more accurate reflection of market conditions where larger orders would significantly impact the price.

What are the benefits of LWBA prices?

Liquidity-weighted Bid and Ask prices help in several key areas:

  • Accuracy: They offer a more precise measure of the market price that considers the volume available at different price levels and allows for true market sentiment to be reflected.
  • Risk Management: They consider the market's depth and help protocols assess and manage their risk more effectively and dynamically during periods of high volatility.
  • Efficiency: Liquidity-weighted prices facilitate smarter order execution, which accurately reflects realistic slippage and enhances the trading experience for traders and protocols by closely mirroring actual market conditions.

Use case examples

  • Derivatives trading: Platforms can use LWBA prices to set more accurate strike prices in options markets or fair settlement prices in futures contracts.
  • Liquidity provision: Automated market makers (AMMs) and other liquidity providers can use these prices to quote more accurate and realistic prices that reflect current market conditions.
  • Loan collateralization: Lending platforms might use liquidity-weighted prices to determine more realistic valuations for collateral during loan issuance and liquidation processes, thereby reducing the risk of unfair liquidations.

Practical examples of LWBA prices

To better understand how LWBA prices are calculated and used, consider the following examples that illustrate their application in different market scenarios. Each example explains the calculation, highlights trading and risk management benefits, and discusses the spread between Bid and Ask prices.

Example 1: Market volatility

Scenario: Assume the market experiences a sudden drop, leading to a scenario where most buy orders accumulate at a lower price point. Similarly, sellers might be inclined to lower their ask prices to exit positions quickly. The order book shows 10 units at $0.99 but a more substantial 100 units at $0.90.

Order book:

TypePriceQuantity
Bid$0.9910
Bid$0.90100
Ask$1.0115
Ask$1.0585

LWBA Price Calculation:

  • Bid = ((10 x 0.99) + (100 x 0.90)) / 110 = $0.909
  • Ask = ((15 x 1.01) + (85 x 1.05)) / 100 = $1.044

Spread Calculation: Ask - Bid = $1.044 - $0.909 = $0.135

The LWBA Bid price of $0.909 and Ask price of $1.044 provide a realistic snapshot of the market under volatile conditions. The spread of $0.135 illustrates a wider gap due to high volatility, impacts liquidity and indicates a less efficient market. This dual perspective helps traders and protocols manage risk by pricing assets closer to the most liquid market levels and offers a more cautious approach to valuation during market drops.

Example 2: Market stability

Scenario: In a stable market, traders place the bulk of buy and sell orders close to the current market prices, leading to high liquidity near these levels.

Order book:

TypePriceQuantity
Bid$0.9890
Bid$0.9910
Ask$1.0050
Ask$1.0150

LWBA Price Calculation:

  • Bid = ((10 x 0.99) + (90 x 0.98)) / 100 = $0.981
  • Ask = ((50 x 1.00) + (50 x 1.01)) / 100 = $1.005

Spread Calculation: Ask - Bid = $1.005 - $0.981 = $0.024

The LWBA Bid price of $0.981 and Ask price of $1.005 reflect the concentration of liquidity near the top price points, with a narrow spread of $0.024 that indicates a highly liquid and efficient market. This pricing accuracy allows traders to execute orders close to their desired price points with minimal slippage and enhances transaction cost efficiency and market predictiveness in stable conditions.

Conclusion

ExampleWeighted Bid PriceWeighted Ask PriceSpreadMarket conditionKey benefit
1$0.909$1.044$0.135High volatilityAligns price with majority liquidity
2$0.981$1.005$0.024Market stabilityMinimizes slippage and improves price accuracy

In these examples, Liquidity-Weighted Bid and Ask prices, along with the spread between them, adjust dynamically based on the actual distribution of orders within the market. By reflecting real-time liquidity and volume, these prices and spreads provide protocols and traders with critical information that enhances pricing accuracy, reduces trading risks, and increases efficiency across various market conditions.

What's next

Stay updated on the latest Chainlink news