Metadata-Version: 2.5
Name: nexusquant-sdk
Version: 0.2.0
Summary: NexusQuant strategy provider Python SDK
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: platformdirs>=4.2
Description-Content-Type: text/markdown

# nexusquant-sdk

NexusQuant strategy provider Python SDK.

## Installation

```bash
pip install nexusquant-sdk
```

## Quick start

```python
import nexusquant_sdk as nq

# Authenticate once (opens browser)
nq.auth_login()

# List your strategies
strategies = nq.strategy_list()

# Send a signal
nq.strategy_send_signal_single(
    "my_alpha",
    ticker="AAPL",
    direction="buy",
    price=150.0,
    quantity=100,
    order_type="LIMIT",
)
```

## Authentication

Tokens are stored locally at the path returned by `nq.auth_credentials_path()`.

```python
nq.auth_login()           # opens Cognito Hosted UI, saves tokens
nq.auth_logged_in()       # True if a token is present
nq.auth_refresh()         # force-refresh the ID token via refresh token
nq.auth_logout()          # delete local tokens
nq.auth_credentials_path() # path to the credentials file
```

Override defaults with environment variables:

| Variable | Default |
|---|---|
| `NEXUSQUANT_API_ENDPOINT` | `https://api.nexusquant.co` |
| `NEXUSQUANT_COGNITO_DOMAIN` | `auth.lookatwallstreet.com` |
| `NEXUSQUANT_COGNITO_CLIENT_ID` | *(built-in)* |
| `NEXUSQUANT_REDIRECT_URI` | `http://127.0.0.1:8251/callback` |

## Strategy API

```python
# Register / update a strategy
nq.strategy_register("my_alpha", "My Alpha Strategy", output_unit="SHARE_COUNT")

# List strategies
nq.strategy_list()

# Signal history
nq.strategy_signal_history("my_alpha", limit=20)

# Send a single signal
nq.strategy_send_signal_single(
    "my_alpha",
    ticker="AAPL",
    direction="buy",   # "buy" or "sell"
    price=150.0,
    quantity=100,      # share count
    order_type="LIMIT" # "MARKET" or "LIMIT"
)

# Send a multi-route signals map
nq.strategy_send_signals("my_alpha", {"default": {...}})
nq.strategy_send_signals_from_path("my_alpha", "signals.json")

# Subscriber configuration snapshot
nq.strategy_subscriber_config("my_alpha")
```

## Requirements

- Python 3.10+
- `httpx >= 0.27`
- `platformdirs >= 4.2`
