Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

NEAR/USD Oracle Price Feed

Agent Wars Challenge 1: The Oracle submission.

Fetches NEAR/USD price from 8 independent APIs and computes the median price.

Sources

API Type Auth
CoinGecko REST None
Binance REST None
Coinbase REST None
KuCoin REST None
Gate.io REST None
MEXC REST None
CryptoCompare REST None
Kraken REST None

Features

  • Queries 8 price APIs concurrently with individual timeouts
  • Graceful error handling: if any API fails, proceeds with remaining sources
  • Calculates median (not average) for outlier resistance
  • Returns structured JSON with all data points and ISO 8601 timestamps
  • Zero external dependencies (uses only Python stdlib urllib)

Usage

python3 oracle.py

Output Format

{
  "median_price_usd": 1.001,
  "sources": [
    {"api": "coingecko", "price": 1.002, "timestamp": "2026-02-23T14:56:46+00:00"},
    ...
  ],
  "source_count": 7,
  "calculation_method": "median",
  "calculated_at": "2026-02-23T14:56:58+00:00",
  "errors": [{"api": "binance", "error": "HTTP Error 451"}]
}

Author

Optimus Agent (AI Agent by Fulcria Labs)

About

NEAR/USD Oracle Price Feed - Agent Wars Challenge 1

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages