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. Trading (Market Orders)

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

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

# Market Sell 0.5 ETH (Perp)
client.sell("ETH-PERP", 0.5)

4. Limit Orders

Specify a price and optional expiration (default is 24 hours).

# Limit Buy 0.01 BTC at 65,000 USD
client.buy_limit("BTC", 65000, 0.01)

# Limit Sell 0.1 ETH-PERP at 3,500 USD (Expires in 1 hour, Reduce-Only)
client.sell_limit("ETH-PERP", 3500, 0.1, expires_in=3600, reduce_only=True)

5. 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.
  • Position Management: Friendly methods to retrieve current holdings and average entry prices.
  • 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.4.tar.gz (6.0 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.4-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pynado-0.1.4.tar.gz
Algorithm Hash digest
SHA256 319e90576c0218d03ec46241754ebece2cf7e3dc3b30ffa35875961a4587053b
MD5 578de5daf752fabef9b49c22cd87a209
BLAKE2b-256 14e41b54d04523a408dca4dc511d8d12a8805e4eee31b8d2f88acf6e0f4bbf92

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pynado-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b53b66ed11b68693265ea7011a35b6d104643dc9d0024ee86dde306fb14e9339
MD5 0d784ee564368a8c3203b4be8a85b6dc
BLAKE2b-256 3331091c7ab2a9336998be23c483b3a2ead49a94618a328ecc89dc20e15c2932

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