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 & 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']}")
4. 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")
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
floatfor balances, acceptsfloatfor orders). - Symbol Resolution: Supports both Spot ("BTC") and Perp ("BTC-PERP") symbols.
- 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
.envfiles.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pynado-0.1.5.tar.gz.
File metadata
- Download URL: pynado-0.1.5.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cac78914194dc06df9eb42da942609f7dee56c383ac80c013cc22b85be9adb4f
|
|
| MD5 |
0737fc5d1f996b15329c6c9aa1c963a2
|
|
| BLAKE2b-256 |
52390587d508214c3a4fda351e6ab2ae86841ec308dad717bd168f7a908a019b
|
File details
Details for the file pynado-0.1.5-py3-none-any.whl.
File metadata
- Download URL: pynado-0.1.5-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd369e7dc47294962bd472b619d5f61ec6efd665bb905e7badfbd8f255ae4684
|
|
| MD5 |
b0fd61507fff01f4c96707f68994adab
|
|
| BLAKE2b-256 |
7bb76f1927399a7f342594cf97b4a141f7052c6f7d305d86bb3e540e977d1ad4
|