Skip to main content

Python client for the OrcaLayer API — Polymarket whale and market analytics

Project description

orcalayer

Official Python client for the OrcaLayer API — Polymarket whale and market analytics: wallet P&L, open positions, smart-whale leaderboard, market search and real-time whale alerts.

Install

pip install orcalayer

Requires Python 3.10+. Single dependency: httpx.

Quickstart

Three lines to a first result — no API key needed for public endpoints:

from orcalayer import OrcaLayer

ol = OrcaLayer()
print(ol.leaderboard(limit=5))

Anonymous access is limited to 200 requests/min per IP, and wallet endpoints (wallet_overview, wallet_positions) additionally to 300 requests/day per IP. With a Premium API key (get one here) you get 600 req/min, no daily cap, and access to Premium endpoints such as whale alerts:

ol = OrcaLayer(api_key="ol_your_key")
alerts = ol.whale_alerts(minutes=30, min_usd=1000)

Methods

Method Endpoint Access
leaderboard(sort, category, limit, ...) Smart-whale leaderboard with server-side filters Public
wallet_overview(address) Wallet profile + trading stats (accepts 0x address or nickname) Public
wallet_positions(address, limit, offset) Open positions, sorted by current value Public
markets(q, category, min_volume, ...) Market search (accepts free text or a Polymarket URL) Public
whale_alerts(minutes, min_usd, ...) Recent smart-whale trades feed Premium

All methods return the JSON response as a plain dict, exactly as the API sends it. Full field reference: orcalayer.com/docs.

Behavior notes

  • Rate limits: on HTTP 429 the client reads Retry-After and retries with exponential backoff (default 3 attempts). Disable with OrcaLayer(retry_on_rate_limit=False). A Retry-After beyond 5 minutes signals the anonymous daily cap rather than a burst — the client then raises RateLimitError immediately instead of retrying.
  • Transient 502 responses are retried once automatically.
  • Premium endpoints without a key raise PremiumRequiredError with a link to pricing — no network call is made.
  • Wallet overview freshness: responses include as_of (data timestamp) and degraded (heavy side-stats timed out, core stats still present).
  • Cold heavy wallets answer HTTP 202 while their stats are computed server-side. The client retries once automatically after the server's Retry-After interval; if the wallet is still not ready it raises WalletComputingError (carrying retry_after) so a 202 body is never mistaken for wallet data.

Errors

from orcalayer import PremiumRequiredError, RateLimitError, AuthenticationError, ServerError

All inherit from orcalayer.OrcaLayerError.

License

MIT. See LICENSE.

Data is provided for informational purposes only and is not financial advice.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orcalayer-0.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orcalayer-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file orcalayer-0.1.0.tar.gz.

File metadata

  • Download URL: orcalayer-0.1.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for orcalayer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2189342315ce3bf7e4cca2b7d67bcf696866a74bdd4094f3fe887e2a5aae2ebc
MD5 61b29ccaa8d1d68019d88bb7a6002b77
BLAKE2b-256 ea5ac6f287cdad9ab735502a727b1b8f91b112a9a2d96d792c023841bcf58e24

See more details on using hashes here.

File details

Details for the file orcalayer-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: orcalayer-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for orcalayer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e69258b72219d0a59d8ed20990eddec7769c4da4758312ab8b820ec4a16882f9
MD5 ebfaadaafdc8dc0108b7ca743bd83fc8
BLAKE2b-256 821efc7cbbcfdf027329ee2c37db93f7f260a7309543991dad22607376c574e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page