> For the complete documentation index, see [llms.txt](https://docs.aozo.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aozo.io/stake/protocol-and-security/slpx-xcm-oracle.md).

# SLPx XCM Oracle

## What is Bifrost XCM Oracle?

In order to facilitate easy querying of Bifrost vToken Exchange Price on other chains at the Pallet and Contract levels, a <mark style="color:purple;">scheduled price feed task</mark> sent by <mark style="color:purple;">Bifrost SLPx Pallet</mark> is needed. Hence, Bifrost Runtime will automatically send XCM messages to the SLPx Contract of the target chain to update the Exchange Price of vTokens in the Contract.

{% hint style="info" %}
Below link will help you quickly understand the relevant concepts:
{% endhint %}

\- [<mark style="color:purple;">**SLPx XCM Oracle Tech Doc**</mark>](https://github.com/bifrost-finance/slpx-contracts?tab=readme-ov-file#xcmoracle)

**- How is** [<mark style="color:purple;">**vToken Exchange Price calculated**</mark>](/stake/protocol-and-security/liquid-staking-protocol-slp/vdot.md#dot-reward) **and** [<mark style="color:purple;">**verified in the Bifrost parachain**</mark>](/stake/protocol-and-security/bifrost-audit-reports.md#bifrost-security-evaluation)**?**

\- [<mark style="color:purple;">**What is SLPx?**</mark>](/stake/developers-and-ecosystem/builder-resources/slpx-integration-reference/overview.md)

\- [<mark style="color:purple;">**What is XCM?**</mark>](https://wiki.polkadot.network/docs/learn-xcm)

***

### How to verify that XCM Oracle uses XCM to synchronize messages to the target chain?

1. The SLPx Pallet synchronizes the vToken Exchange Price on Bifrost and sends it to the target chain at regular intervals. [<mark style="color:purple;">Link to the code base</mark>](https://github.com/bifrost-finance/bifrost/blob/develop/pallets/slpx/src/lib.rs#L299)

```rust
let configuration = XcmEthereumCallConfiguration::<T>::get();
				match configuration {
					Some(mut configuration) => {
						let currency_id = currency_list[0];
						let token_amount = T::VtokenMintingInterface::get_token_pool(currency_id);
						// It's impossible to go wrong.
						let vcurrency_id = T::VtokenMintingInterface::vtoken_id(currency_id)
							.expect("Error convert vcurrency_id");
						let vtoken_amount = T::MultiCurrency::total_issuance(vcurrency_id);

						if configuration.last_block + configuration.period < n {
							let encoded_call = Self::encode_transact_call(
								configuration.contract,
								currency_id,
								token_amount,
								vtoken_amount,
							);

							let result = Self::send_xcm_to_set_token_amount(
								encoded_call,
								configuration.xcm_weight,
								configuration.xcm_fee,
							);

							if result.is_err() {
								return weight
									.saturating_add(T::DbWeight::get().reads_writes(4, 0));
							}
							Self::deposit_event(Event::XcmSetTokenAmount {
								currency_id,
								token_amount,
								vcurrency_id,
								vtoken_amount,
							});
```

2. Query messages sent by Bifrost XCM Oracle: [<mark style="color:purple;">Link to Bifrost Subsca</mark>n](https://bifrost.subscan.io/event?page=1\&time_dimension=date\&module=slpx\&event_id=xcmsettokenamount). The capture below includes the total amount of DOT (Token2:0) and vDOT (vToken2:0) in Bifrost liquid staking. (Check other token index in the [<mark style="color:purple;">Library</mark>](/stake/user-guides/mint-redeem-vtoken-without-dapp.md#token-and-vtoken-index-library).)

<figure><img src="https://content.gitbook.com/content/r31MTx7UH8xa62qIBTTw/blobs/WFvdVAXLfu6mANJdNKz6/image.png" alt=""><figcaption></figcaption></figure>

3. Query XCM Oracle transactions in [<mark style="color:purple;">XCM Message</mark>](https://bifrost.subscan.io/xcm_message): [<mark style="color:purple;">Here is a case</mark>](https://bifrost.subscan.io/xcm_message/polkadot-02542a3efa1f734e1a13fcce6965b445f8bb2199).

<figure><img src="https://content.gitbook.com/content/r31MTx7UH8xa62qIBTTw/blobs/M43eUH8ycFA9PtVqna3t/image.png" alt=""><figcaption></figcaption></figure>

4. View Bifrost Parachain Address (mapped by Moonbeam EVM) transactions synchronizing price information to the Oracle contract on Moonbeam or Moonriver: [<mark style="color:purple;">Link to Moonscan</mark>](https://moonscan.io/address/0x7369626cee070000000000000000000000000000)

<figure><img src="https://content.gitbook.com/content/r31MTx7UH8xa62qIBTTw/blobs/ect7nlixdoOoxP5ilKTt/image.png" alt=""><figcaption></figcaption></figure>

5. Query the latest price of vToken in the XCM Oracle contract on Moonbeam or Moonriver:

\- [<mark style="color:purple;">Moonriver</mark>](https://moonriver.moonscan.io/address/0x682d05cd8d96b9904ec2b1b97bd1eb640b10fc2d#readProxyContract)

\- [<mark style="color:purple;">Moonbeam</mark>](https://moonscan.io/address/0xef81930aa8ed07c17948b2e26b7bfaf20144ef2a#readProxyContract)

For example, querying the price of vDOT by DOT with 10 decimals.

<figure><img src="https://content.gitbook.com/content/r31MTx7UH8xa62qIBTTw/blobs/8xdEFnDtUhPs7lqhyv15/image.png" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aozo.io/stake/protocol-and-security/slpx-xcm-oracle.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
