Metadata-Version: 2.3
Name: supurr-sdk
Version: 0.1.1
Summary: 
Author: Your Name
Author-email: you@example.com
Requires-Python: ==3.10.15
Classifier: Programming Language :: Python :: 3
Requires-Dist: setuptools (>=78.1.0,<79.0.0)
Requires-Dist: web3 (==5.31.4)
Description-Content-Type: text/markdown

# Supurr SDK

A Python SDK for interacting with the Supurr protocol, supporting both Up/Down and Above/Below trading products.

## Installation

```bash
pip install supurr-sdk
```

## Quick Start

### Initialize the Exchange

```python
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

```python
# 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

```python
# 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

```python
# 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:

```bash
pytest tests/
```

## License

[Add your license information here]


