Skip to main content

A friendly, Pythonic wrapper for the Nado Protocol SDK

Project description

Pynado

A friendly, Pythonic wrapper for the Nado Protocol SDK. Pynado simplifies the interaction with the Nado Protocol by abstracting low-level details and handling unit conversions automatically.

Installation

pip install pynado

Usage

1. Setup

Create a .env file in your project root to store your private key securely:

NADO_PRIVATE_KEY='your_private_key_here'

2. Basic Example

Initialize the client and check your account details:

from pynado import Nado

# Initialize the client (defaults to TESTNET and loads key from .env)
client = Nado()

# Access properties directly
print(f"Wallet Address: {client.address}")
print(f"USDT Balance:   {client.balance:,.2f}")

3. Market Data

Retrieve real-time prices and order book depth.

# Get current mid-price
price = client.get_price("BTC-PERP")
print(f"BTC Price: {price}")

# Get top 5 levels of the order book
book = client.get_market_liquidity("ETH-PERP", depth=5)
print(f"Best Bid: {book['bids'][0][0]}")

4. Trading (Market & Limit Orders)

Pynado handles symbol resolution (Spot vs. Perp), unit scaling (to_x18), and price rounding automatically.

# Market Buy 0.01 BTC
client.buy("BTC", 0.01)

# Limit Sell 0.5 ETH-PERP at 3,500 USD (Expires in 24h by default)
res = client.sell_limit("ETH-PERP", 3500, 0.5)
print(f"Order Digest: {res['digest']}")

5. Order Management

Cancel specific orders using their digest or clear your entire book.

# Cancel a specific order
client.cancel_order("ETH-PERP", "0x...")

# Cancel ALL open orders across all products
client.cancel_all_orders()

# Cancel all open orders for a specific product
client.cancel_all_orders("BTC")

6. Checking Positions

You can easily check specific positions or get an overview of your entire account.

# Get a specific position
pos = client.get_position("BTC-PERP")
print(f"Amount: {pos['amount']}, Entry Price: {pos['average_entry_price']}")

# Get all active positions
all_pos = client.get_all_positions()
for p in all_pos:
    print(f"{p['symbol']}: {p['amount']}")

Features

  • Simple Interface: One class (Nado) to rule them all.
  • Automatic Scaling: Handles 18-decimal scaling for you (returns float for balances, accepts float for orders).
  • Symbol Resolution: Supports both Spot ("BTC") and Perp ("BTC-PERP") symbols.
  • Market Data: Easy access to prices and order book liquidity.
  • Position Management: Friendly methods to retrieve current holdings and average entry prices.
  • Order Management: Easy methods to cancel specific orders or clear your entire order book.
  • Intelligent Defaults: Automatically handles price increments (rounding) and order expiration.
  • Environment Friendly: Native support for .env files.

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

pynado-0.1.6.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

pynado-0.1.6-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file pynado-0.1.6.tar.gz.

File metadata

  • Download URL: pynado-0.1.6.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for pynado-0.1.6.tar.gz
Algorithm Hash digest
SHA256 09c36b3b3c66e45d0d119e5ce2a683747d579178240c97064f9f7219d9c69ff0
MD5 9a0d3ed7e331bcabe4e7e5aa288d0915
BLAKE2b-256 4dde45679050a0492aa94970917a4287f3c6562d0db90b9602eeba7f43f5f2df

See more details on using hashes here.

File details

Details for the file pynado-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: pynado-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for pynado-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f648bf3acfe3163d1a2592d7f3fe0ca2abe33d61c36890b5bb00fab8323e4387
MD5 b75ef2e1e60f282afcba6f751442b8f4
BLAKE2b-256 def531f5f3640592c6a0771988ed5b36726c5725a13071ebafb49ae94a08250a

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