Lux Docs
Lux Skills Reference

Lux Oracle - Optimistic Oracle Protocol

Lux Oracle is an optimistic oracle for on-chain price feeds and arbitrary data verification. Fork of UMA Protocol, adapted for Lux C-Chain. It is a...

Overview

Lux Oracle is an optimistic oracle for on-chain price feeds and arbitrary data verification. Fork of UMA Protocol, adapted for Lux C-Chain. It is a Yarn/Lerna monorepo containing Solidity smart contracts, JavaScript/TypeScript off-chain services, and an SDK.

When to use

  • Integrating on-chain price feeds or arbitrary data verification into Lux dApps
  • Building financial derivatives or prediction markets on Lux C-Chain
  • Running off-chain oracle services (monitors, liquidators, dispute bots)

Quick reference

ItemValue
Repogithub.com/luxfi/oracle
LanguageJavaScript, TypeScript, Solidity
Package managerYarn workspaces
Monorepo toolLerna
Build toolHardhat (with Foundry support in packages/core)
TestingMocha, Ganache-CLI on port 9545
LicenseAGPL-3.0
UpstreamUMA Protocol
Default branchmaster

How it works

1. Data requester posts question + reward bond
2. Proposer submits answer + proposer bond
3. Dispute window opens (configurable)
4. If disputed: escalated to DVM (Data Verification Mechanism)
5. If undisputed: answer accepted, bonds returned

Monorepo packages

PackagePurpose
coreSmart contracts (OptimisticOracle, VotingToken, Finder, etc.)
sdkTypeScript SDK for oracle interaction
optimistic-oracleOptimistic oracle off-chain services
commonShared utilities and configuration
apiAPI package
monitorsOn-chain monitoring services
monitor-v2Next-gen monitoring
financial-templates-libFinancial template utilities
contract-notifierContract event notification
scriptsDeployment and management scripts
affiliatesAffiliate tracking
serverless-orchestrationServerless bot orchestration
contracts-frontendFrontend contract ABIs
contracts-nodeNode.js contract interfaces
fx-tunnel-relayerCross-chain relay (FxPortal)
polymarket-notifierPolymarket integration

One-file quickstart

git clone https://github.com/luxfi/oracle.git
cd oracle
yarn

# Build all packages
yarn build

# Start local Ganache
yarn ganache-cli -e 1000000000 -p 9545 -l 9000000 -d

# Run all tests (requires Ganache running on port 9545)
yarn test

# Run tests for a specific package
yarn workspace @uma/core test

Core contracts

ContractPurpose
OptimisticOracleCore oracle with dispute mechanism
SkinnyOptimisticOracleGas-optimized oracle variant
VotingTokenGovernance token for dispute resolution
FinderContract registry for protocol components
IdentifierWhitelistApproved price identifiers

Development

# Lint (ESLint + Prettier)
yarn lint

# Lint with autofix
yarn lint-fix

# Build (quick)
yarn qbuild

# Clean build artifacts
yarn clean

# Remove all node_modules
yarn clean-packages

# Add dependency to a specific package
yarn workspace @uma/core add <dependency>

# Add cross-package dependency
yarn lerna add @uma/some-package --scope @uma/my-package

Architecture

oracle/
  packages/
    core/             -- Solidity contracts + Hardhat + Foundry
      contracts/      -- OptimisticOracle, VotingToken, Finder, etc.
      deploy/         -- Deployment scripts
      test/           -- Contract tests (Mocha)
      foundry.toml    -- Foundry configuration (supplementary)
      hardhat.config.js
    sdk/              -- TypeScript SDK
    optimistic-oracle/ -- Off-chain oracle services
    monitors/         -- Chain monitoring bots
    common/           -- Shared utilities
    ...
  hardhat.config.js   -- Root config (delegates to packages/core)
  lerna.json          -- Lerna monorepo config
  • lux/lux-exchange.md -- DEX that consumes price feeds
  • lux/lux-evm.md -- C-Chain deployment target
  • lux/lux-safe.md -- Multisig for oracle governance

On this page