Skip to main content

Oracle Service

A self-contained Python service for transmitting analysis signals to an Ethereum-compatible blockchain via smart contract interactions.

What This Project Is

This is a backend service that:

  1. Monitors a database for high-severity analysis results.
  2. Transmits signed transactions to a Guardian smart contract on-chain.
  3. Exposes a FastAPI REST API for managing oracle signals (create, retry, list, stats).
  4. Integrates with a DAO governance framework (proposals, voting, IP licensing).

What This Project Is NOT

  • This is NOT a price oracle (e.g., Chainlink-style).
  • This does NOT make autonomous financial decisions.
  • This does NOT require blockchain to function — it runs in simulation mode without Web3 credentials.

Architecture

oracle_service/
├── service.py      — Web3 connection, transaction building, signal monitor
├── routes.py       — FastAPI REST API endpoints
├── config.py       — Environment-based settings
├── db.py           — SQLAlchemy session management
├── worker.py       — Job queue stub (replace with Celery for production)
├── models/         — SQLAlchemy models (OracleSignal, AnalysisResult, Job)
└── schemas/        — Pydantic response schemas

API Endpoints

Method Path Description
GET / Health check
GET /status Oracle configuration status
GET /signals List signals (filterable)
GET /signals/{id} Get signal details
POST /signals/create Create signal from analysis result
POST /signals/{id}/retry Retry failed signal
GET /stats/summary Signal statistics
GET /transactions/{hash} Transaction status (placeholder)

Prerequisites

  • Python 3.10+
  • PostgreSQL or SQLite
  • Redis (optional, for production job queue)
  • Ethereum RPC endpoint (optional, runs in simulation without it)

Installation

pip install -r requirements.txt

Configuration

Set environment variables:

# Required for blockchain mode
export ORACLE_ENABLED=true
export ETHEREUM_RPC=https://your-rpc-endpoint
export ORACLE_PRIVATE_KEY=0x...
export GUARDIAN_CONTRACT=0x...
export DAO_CONTRACT=0x...
export CHAIN_ID=1

# Database
export DATABASE_URL=postgresql://user:pass@localhost/oracle

# Optional
export REDIS_URL=redis://localhost:6379/0
export DEBUG=false

Usage

Run the signal monitor:

python -m oracle_service.service

Run the API server (integrate with FastAPI app):

from fastapi import FastAPI
from oracle_service.routes import router

app = FastAPI()
app.include_router(router, prefix="/oracle")

Smart Contracts

The service interacts with three Solidity contracts (see contracts/test/):

  • YOUDAO — Governance: proposals, voting, staking, IP licensing
  • YOUAIGuardian — Oracle signal submission, heartbeat monitoring
  • TreasuryMultiSig — Multi-signature fund management

Disclaimer

This software is provided "as is" without warranty. The authors are not responsible for any financial losses resulting from blockchain transactions.

Metadata

Release files for oracle-signal-service 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oracle-signal-service 1.0.0
File Size Uploaded Provenance
oracle_signal_service-1.0.0.tar.gz 11.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for oracle-signal-service 1.0.0
File Interpreter ABI Platform
oracle_signal_service-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.5 kB

Release files / oracle_signal_service-1.0.0.tar.gz

Download URL oracle_signal_service-1.0.0.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
541d484929ce8b88f57c15d350a511995f1bf8c591419935c14e0528d10dc1ec
BLAKE2b-256 checksum
How to use checksums
2d46a370e69df47fc38aa163d0433f9cf41ffcc820384aab63c3c6879e857bc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.6

Release files / oracle_signal_service-1.0.0-py3-none-any.whl

Download URL oracle_signal_service-1.0.0-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cca29090c53d461ad47826bcad6624acf9f3fe7599671a7627b961209fb6f0c9
BLAKE2b-256 checksum
How to use checksums
c6ed8237717a2009134653a17dc658664762274e15b36012b8fe2179a92b6813
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.6

Security for oracle-signal-service 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page