Constructs a new LpTokenPriceTask.
Optionalproperties: ILpTokenPriceTaskProperties to set
OptionalmercurialMercurial finance pool address. A full list can be found here: https://github.com/mercurial-finance/stable-swap-n-pool-js
OptionalorcaOrca pool address. A full list can be found here: https://www.orca.so/pools
OptionalPoolLpTokenPriceTask PoolAddress.
A list of Switchboard aggregator accounts used to calculate the fair LP price. This ensures the price is based on the previous round to mitigate flash loan price manipulation.
A list of OracleJobs to execute in order to yield the price feed jobs to use for the fair price formula.
OptionalraydiumThe Raydium liquidity pool ammId. A full list can be found here: https://raydium.io/pools
OptionalsaberSaber pool address. A full list can be found here: https://github.com/saber-hq/saber-registry-dist
If enabled and price_feed_addresses provided, the oracle will calculate the fair LP price based on the liquidity pool reserves. See our blog post for more information: https://switchboardxyz.medium.com/fair-lp-token-oracles-94a457c50239
Converts this LpTokenPriceTask to JSON.
JSON object
StaticcreateCreates a new LpTokenPriceTask instance using the specified properties.
Optionalproperties: ILpTokenPriceTaskProperties to set
LpTokenPriceTask instance
StaticdecodeDecodes a LpTokenPriceTask message from the specified reader or buffer.
Reader or buffer to decode from
Optionallength: numberMessage length if known beforehand
LpTokenPriceTask
StaticdecodeDecodes a LpTokenPriceTask message from the specified reader or buffer, length delimited.
Reader or buffer to decode from
LpTokenPriceTask
StaticencodeEncodes the specified LpTokenPriceTask message. Does not implicitly {@apilink oracle_job.OracleJob.LpTokenPriceTask.verify|verify} messages.
LpTokenPriceTask message or plain object to encode
Optionalwriter: WriterWriter to encode to
Writer
StaticencodeEncodes the specified LpTokenPriceTask message, length delimited. Does not implicitly {@apilink oracle_job.OracleJob.LpTokenPriceTask.verify|verify} messages.
LpTokenPriceTask message or plain object to encode
Optionalwriter: WriterWriter to encode to
Writer
StaticfromCreates a LpTokenPriceTask message from a plain object. Also converts values to their respective internal types.
Plain object
LpTokenPriceTask
StaticgetGets the default type url for LpTokenPriceTask
OptionaltypeUrlPrefix: stringyour custom typeUrlPrefix(default "type.googleapis.com")
The default type url
StatictoCreates a plain object from a LpTokenPriceTask message. Also converts values to other types if specified.
LpTokenPriceTask
Optionaloptions: IConversionOptionsConversion options
Plain object
StaticverifyVerifies a LpTokenPriceTask message.
Plain object to verify
null if valid, otherwise the reason why it is not
Fetch LP token price info from a number of supported exchanges.
See our blog post on Fair LP Token Oracles
NOTE*: This is not the swap price but the price of the underlying LP token.
Input: None
Returns: The price of an LP token for a given AMM pool.
Example: Fetch the Orca LP token price of the SOL/USDC pool
Example: Fetch the fair price Orca LP token price of the SOL/USDC pool
Example: Fetch the fair price Raydium LP token price of the SOL/USDC pool