[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