Interface PriceData
- All Known Implementing Classes:
ImmutablePriceData
@Beta
@Immutable
public interface PriceData
Represents price information for a token pair in an Oracle.
-
Method Summary
Modifier and TypeMethodDescriptionThe asset price after applying thescale()precision level.The primary asset in a trading pair.static ImmutablePriceData.Builderbuilder()Construct aPriceDatabuilder.The quote asset in a trading pair.Optional<com.google.common.primitives.UnsignedInteger> scale()The scaling factor to apply to an asset price.
-
Method Details
-
builder
Construct aPriceDatabuilder.- Returns:
- An
ImmutablePriceData.Builder.
-
baseAsset
String baseAsset()The primary asset in a trading pair. Any valid identifier, such as a stock symbol, bond CUSIP, or currency code is allowed. For example, in the BTC/USD pair, BTC is the base asset; in 912810RR9/BTC, 912810RR9 is the base asset.- Returns:
- A
String.
-
quoteAsset
String quoteAsset()The quote asset in a trading pair. The quote asset denotes the price of one unit of the base asset. For example, in the BTC/USD pair, BTC is the base asset; in 912810RR9/BTC, 912810RR9 is the base asset.- Returns:
- A
String.
-
assetPrice
Optional<AssetPrice> assetPrice()The asset price after applying thescale()precision level. It's not included if the last update transaction didn't include thebaseAsset()/quoteAsset()pair.- Returns:
- An
OptionalAssetPrice.
-
scale
Optional<com.google.common.primitives.UnsignedInteger> scale()The scaling factor to apply to an asset price. For example, if scale is 6 and original price is 0.155, then the scaled price is 155000. Valid scale ranges are 0-10. It's not included if the last update transaction didn't include thebaseAsset()/quoteAsset()pair.- Returns:
- An
OptionalUnsignedInteger.
-