Function tulipv2_sdk_common::pyth::parse_pyth_price
source Β· [−]pub fn parse_pyth_price(pyth_price: &Price) -> Result<Decimal, ProgramError>Expand description
π¨ see the warning at the end of this function for safe usage π¨
parses the Price account for the currently stored price data.
π¨ warning π¨
this function does not check price staleness, confidence, or any other such validation of the price. it simply ensures that the value can be parsed into a Decimal without error.
this is only intended for use with the pyth price feeds published by tulip, and should be used cautiously as inappropriate usage will result in loss of money