No project description provided
Project description
Supurr SDK
A Python SDK for interacting with the Supurr protocol, supporting both Up/Down and Above/Below trading products.
Installation
pip install supurr-sdk
Quick Start
Initialize the Exchange
from supurr_sdk.Exchange import SupurrExchange
# Initialize with your private key and desired product
exchange = SupurrExchange(
pk="your_private_key",
product="up_down" # or "above_below"
)
Trading with Up/Down Product
# Set the active market
exchange.product.set_active_market("BTCUSD")
# Place a trade
result = exchange.place_trade(
is_up=True, # True for up, False for down
amount=int(0.1 * 10**18), # Amount in token-decimals
duration=360 # Expiration time in seconds
)
Trading with Above/Below Product
# Set the active market
exchange.product.set_active_market("BTCUSD")
# Get valid expiry timestamps
valid_timestamps = exchange.product.get_valid_expiry_timestamps()
# Place a trade with strike price
result = exchange.place_trade(
is_up=True, # True for above, False for below
amount=int(0.01 * 10**18), # Amount in token-decimals
expiration=valid_timestamps[0], # Use a valid timestamp
strike=84000 # Strike price
)
Checking Current Price
# Get current price for the active market
current_price = exchange.price_provider.get_price(exchange.product.active_market)
Features
- Support for both Up/Down and Above/Below trading products
- Integration with Pyth price feeds
- Automatic market selection and validation
- Built-in token approval handling
- Support for multiple markets (e.g., BTCUSD)
Available Markets
- BTCUSD (with price precision of 1)
Error Handling
The SDK includes built-in validation for:
- Invalid expiration times
- Invalid strike prices
- Market availability
- Token approvals
Notes
- All amounts should be provided in token-decimals (1 ETH = 10^18 token-decimals)
- The SDK uses Web3.py for blockchain interactions
- Make sure to have sufficient token approvals before trading
- The SDK supports both testnet and mainnet deployments
Development
To run the test suite:
pytest tests/
License
[Add your license information here]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
supurr_sdk-0.1.1.tar.gz
(12.4 kB
view details)
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 supurr_sdk-0.1.1.tar.gz.
File metadata
- Download URL: supurr_sdk-0.1.1.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.10.15 Linux/6.2.0-39-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
935bd8af62210c2c615376c6d3e9694a458be5798fcb77d59f93abc1f092c9df
|
|
| MD5 |
95956b47e1a927a5eedf734948bcf88c
|
|
| BLAKE2b-256 |
eaf65afd57e6fd5edd876c8930a7798a117bfade809938dc68e51416882eef56
|
File details
Details for the file supurr_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: supurr_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.10.15 Linux/6.2.0-39-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d7a2c58c1f35cbbe257bc1d1a2f418d6851236b297799342317ff422ea2a52b
|
|
| MD5 |
acaf277dbb5dcfd39ca6c4c4bbdfd073
|
|
| BLAKE2b-256 |
df3c3ab5fb8bebf08bd61979d19d0b8ce0b59e9986d32310f85e58c2372f3459
|