# Interacting with Oracle on MoveVM

## Overview <a href="#overview" id="overview"></a>

This tutorial guides you through fetching oracle prices in a Move on Minitia environment utilizing the `0x1::oracle` modules. By following this tutorial, developers can understand how to integrate and retrieve real-time financial data within their smart contracts on the Minitia blockchain.

## **Sample Contract Implementation** <a href="#sample-contract-implementation" id="sample-contract-implementation"></a>

### GetPrice <a href="#getprice" id="getprice"></a>

Using `0x1::oracle::get_price`, one can fetch prices from the oracle.

```
#[view]
public fun get_price(pair_id: String): (u256, u64, u64) {
    get_price_internal(*string::bytes(&pair_id))
}
```

* pair\_id: `{Base}/{Quote}` format string. through the following lcd query, you can check the available pairs: `{LCD_URI}/slinky/oracle/v1/get_all_tickers`
* response: (price, update\_at, decimals)
  * price is before applying decimals. for example, if the price is 123456789 and decimalsis 3, the real price is 123456.789.
  * update\_at is a UNIX time when the price was updated.

## Conclusion

This section provides a foundation for integrating real-time oracle data into your blockchain applications, leveraging Cosmos-based oracles within an Move context. It's suitable for financial applications requiring access to up-to-date currency prices and can be expanded or modified to fit specific requirements or additional functionalities.
