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.3.tar.gz (16.0 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.3-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nexode_sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 16.0 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.3.tar.gz
Algorithm Hash digest
SHA256 7c56738ad23069a0ed293ffabc73bea2b8ab3d541e582fdc64493491db32688b
MD5 e21a7b6a3f7b5c43916c6be6e1593979
BLAKE2b-256 e9c6f2a67c1686e2331f8cc117ea88da0efe3d5d32a2beb0aa5563b55e514974

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nexode_sdk-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 21.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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3eb3699150719bfa4414c4af8a8dc042f1b60e732b5c3f3c1a94fd5e218e4c27
MD5 ce737c6887bce89a6bf15a31b29947ac
BLAKE2b-256 96237e70cd193dcddfa4f37c74e4d2746fffebb73a3553c05cb18808eb75e936

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