Skip to main content

Official Python SDK for the Nexode prediction-market API

Project description

nexode-sdk

Official Python SDK for the Nexode prediction-market API.

pip install nexode-sdk
from nexode import Nexode, Outcome, OrderSide

nx = Nexode(api_key="nxd_...")          # or set NEXODE_API_KEY

market = nx.markets.list()[0]
print(nx.markets.ticker(market.id, Outcome.YES).best_bid)

order = nx.orders.create(
    market_id=market.id, outcome=Outcome.YES,
    side=OrderSide.BUY, price="0.55", quantity=100,
)
nx.orders.cancel(order.id)

Preview an order's fees before placing it — same numbers the matching engine charges:

quote = nx.markets.fee_quote(
    market.id, Outcome.YES, side=OrderSide.BUY, price="0.55", quantity=100,
)
quote.taker_fee        # fee on a full fill at the limit price
quote.max_taker_fee    # hard ceiling across every fill pattern
quote.meets_minimum    # passes the market's minimum-notional gate

Create an API key in Settings → Developer. The SDK exchanges it for short-lived access tokens and refreshes them automatically.

You work in terms of a market and an outcome (yes/no); the SDK handles the routing. nx.markets and nx.events browse markets, nx.orders/nx.trades trade and report fills, and nx.mints/nx.redeems/ nx.burns cover account activity.

Browsing is filtered and sorted server-side:

from nexode import EventSort

events = nx.events.list(
    category="sports",
    sort=EventSort.TRENDING,   # ending / trending / new / markets / name
    hide_stale_settled=True,
    limit=20,
)

event = nx.events.by_slug("nba-finals")     # markets too: nx.markets.by_slug(...)

Outcomes carry display labels — on a game market yes/no might read "Lakers"/"Celtics". The SDK maps both ways:

market.labels                       # {Outcome.YES: "Lakers", Outcome.NO: "Celtics"}
market.outcome_label(Outcome.YES)   # "Lakers" (falls back to "Yes"/"No")
market.outcome_for_label("Celtics") # Outcome.NO — trade by team name
market.winning_label                # label of the resolved outcome, or None

nx.api_keys lists and revokes keys on your account; create them in Settings → Developer.

nx.portfolio.snapshot() returns the raw inputs for PnL in one call — trades, open orders, mints, redeems, burns, the markets involved, and current tickers:

s = nx.portfolio.snapshot()
# s.trades[i].market_id / .outcome / .price / .quantity
# s.markets[market_id].collateral_price        # cost basis / resolution
# s.tickers[f"{market_id}:{outcome}"].best_bid # mark open positions

See the full reference at docs.nexode.io.

Development

cd nexode-sdk
pip install -e '.[dev]'
pytest

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

nexode_sdk-0.1.1.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

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

nexode_sdk-0.1.1-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file nexode_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: nexode_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for nexode_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f141aa69bcb88d4354fd26b0de481f81e612658f1b9c1329d4ab40a0f641401d
MD5 91d355c3b66e74469443b4771b0a2ede
BLAKE2b-256 cb8ca0ec77998df2de9fb7736b6ee82b1eed06917a85d598fa597668af08ca2e

See more details on using hashes here.

File details

Details for the file nexode_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: nexode_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for nexode_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 df972520a6aa25459c9c5770ecccecd14c01b157ff830498df5aa2224a2ac835
MD5 a45e04227c0fd6b1961c44e5a8ca14a8
BLAKE2b-256 9310f5282ecb6ad6d9793621b4680cc1a07954e01b68d98a6d4dfc8e590d0ae5

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