[SUI] Is there a way to get a price without having "&PriceInfoObject" as function argument?

In the documentation we have a function “get_sui_price” which takes “price_info_object: &PriceInfoObject" as argument:

public fun get_sui_price( // Other arguments clock: &Clock, price_info_object: &PriceInfoObject,): I64 {

My question is would it be possible to create such a function without having &PriceInfoObject as an argument? We could get this reference in the code of the function by any other mean but I don’t see how..

Hello,

The PriceInfoObject contains the information for where the price object containing price data is located. It isn’t possible to omit this as otherwise, the other functions would have no way of accessing price data.

1 Like

Hi darunrs, I have one more question about this (Sui Move code). In this get_sui_price(), I wonder that which one should I enter as the price_info_object param? I have tried with the Price Feed IDs from this page Price Feed IDs | Pyth Developer Hub and the CLI command “sui client call” but it shows the error “Object does not exist“. Where do I look up for price_info_object param?