Skip to content
Document

Run a price oracle node

This page teaches you to register your baker node for the additional service of price oracle, and how to deregister from the service in case you want to use the tokens for something else.

Price oracles monitor and report prices of the BYOC. Any node with sufficient tokens associated to the large oracle contract can register as a price oracle.
You can learn more about the price oracles here.

You must complete these requirements before you can continue

  1. Run a baker node
  2. Stake 5 K MPC tokens. You need a total staking balance of 30K for both price oracle and baker node.

Register as a price oracle

Becoming a price oracle requires a stake of 5000 MPC associated to the large oracle contract and a Register transaction at one of the price oracles:

  1. Find the large oracle contract with the address 04f1ab744630e57fb9cfcd42e6ccbf386977680014
  2. Sign in (upper right corner)
  3. Invoke the contract action AssociateTokensToContract with a minimum amount of 5000 MPC tokens. You need 5000 tokens per price oracle you register for.
  4. Go to ETH Price Oracle contract, BNB Price Oracle contract or MATIC Price Oracle contract and invoke the action Register

Steps to deregister as a price oracle

The first step to deregister is to verify which price oracle the node serves. If known, skip to deregistration.

Verify which price oracle your node serves

  1. Open the large oracle contract state
  2. Open the map stakedTokens
  3. Search for your blockchain address CTRL+f
  4. Open the struct next to your blockchain address
  5. Open the map lockedToOracle
  6. You can see the addresses of the oracles your node serve and MPC tokens staked to them
  7. Copy the address of the oracle you want to leave (you can distinguish the price oracles from deposit and withdrawal oracles by looking at the amount of MPC tokes they have "locked", price oracles have 5000, deposit and withdrawal oracles 250000)
  8. Paste the address to the search field of the browser, to navigate to the contract

Deregister from a price oracle

To leave a price oracle see the step-by-step guide below.

  1. Sign in to the browser
  2. Opt out of notifying price updates by invoking the contract action Opt out on the price oracle your node serves:
  3. Wait an hour to ensure any ongoing round is finished.
  4. Invoke the contract action Deregister on the contract.

If your node has already reported a price in the current round, your invocation of Deregister will result in an error saying:

Cannot deregister an oracle node that has notified a price update on an ongoing round

This means that you did not wait long enough (step 3), or that you did not opt out of notifying price updates for future rounds (step 2). Please make sure that you have opted out, and that you have waited an hour from when you opted out.