Skip to main content
Version: Mainnet

Price Oracle

The RollApp Price Oracle is a smart contract deployed on your RollApp that provides real-time asset price data. This functionality is essential for DeFi applications, trading platforms, and other systems requiring accurate price information.

Overview

The Price Oracle consists of:

  • A smart contract deployed on your RollApp
  • An off-chain worker process that fetches and submits price data
  • Integration with the roller CLI tool for deployment and management

Prerequisites

Before deploying the Price Oracle, ensure you have:

  • A running RollApp full node or sequencer node
  • The roller CLI tool installed
  • Access to the RollApp's admin account

Deployment

Follow these steps to deploy and configure the Price Oracle:

  1. Deploy the Price Oracle contract:
roller oracle price deploy
  1. Start the off-chain worker process using one of these methods:
roller oracle price start

Contracts API

The Price Oracle provides a contracts API for interacting with the Price Oracle contract.

For detailed API documentation on how to use the Price Oracle, please refer to the Price Oracle Contracts

Example

For a complete example and detailed API documentation on how to use the Price Oracle, please refer to the Price Oracle Example

Best Practices

  • Always verify the Price Oracle service is running before relying on it in your applications
  • Monitor the service logs for any potential issues
  • Consider implementing fallback mechanisms in case of service disruption