Metadata-Version: 2.4
Name: nqs-sdk
Version: 0.4.0
Summary: Nuant Quantitative System SDK
Author: The Lab @ Nuant
Maintainer-email: "The Lab @ Nuant" <thelab@nuant.ai>
Project-URL: homepage, https://github.com/Nuant/nqs-sdk
Project-URL: documentation, https://nuant.github.io/nqs-sdk/
Project-URL: repository, https://github.com/Nuant/nqs-sdk
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Requires-Python: ~=3.12.0
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: nqs-pycore==0.4.0
Requires-Dist: micro_language==0.3.1
Requires-Dist: sortedcontainers==2.4.0
Requires-Dist: networkx==3.3
Requires-Dist: pyvinecopulib==0.6.5
Requires-Dist: requests==2.32.3
Requires-Dist: eth_typing==4.4.0
Requires-Dist: web3==6.20.0
Requires-Dist: gql==3.5.0
Requires-Dist: requests_toolbelt==1.0.0
Requires-Dist: pyyaml==6.0.1
Requires-Dist: numpy==1.26.0
Requires-Dist: python-dotenv==1.0.1
Dynamic: license-file

<!-- WARNING: original source file is docs/getting_started.rst -->

# Getting Started

**Nuant Quantitative System SDK** is a purpose-built SDK for decentralized finance. It enables a unified lifecycle that supports research, protocol-level simulation, backtesting, optimization, and live monitoring. Designed to empower quants, researchers, and developers, NQS makes it easy to experiment, iterate, and bring DeFi protocols and strategies from concept to execution.

This repository is the public endpoint for the nqs-sdk package, available on PyPI, providing all the tools needed to build, test, and run strategies within a single, integrated environment.

## Prerequisites

Before installing the NQS SDK, ensure you have:

- Python 3.12 (currently supported version; more versions coming soon)
- pip package manager

## Installation

Install the NQS SDK using pip:

```bash
pip install nqs-sdk
```

Note: This installation will also include several other packages provided by Nuant.

### Environment Configuration

Get your API key from

<a href="https://agents.nuant.ai/subscribe" target="_blank" rel="noopener noreferrer">https://agents.nuant.ai/subscribe</a>

This following command creates a `nuant-quantlib.toml` file with the required proxy configuration for accessing Nuant’s GraphQL API.
Make sure to replace `YOUR_API_KEY`.

```bash
(
echo "[proxy]"
echo 'url = "https://data.app.nuant.com/graphql"'
echo 'api-key = "YOUR_API_KEY" # <- the one, you got previously'
) > nuant-quantlib.toml
```

Then, export it as an environment variable:

```bash
export QUANTLIB_CONFIG=/path/to/nuant-quantlib.toml
```

### Verify Installation

First, verify that the installation was successful:

```python
import nqs_sdk
print(f"NQS SDK version: {nqs_sdk.__version__}")
```

## Quick Start

### Basic Use Case

Here’s a simple example to get you started with the NQS SDK:

```python
import nqs_sdk.preload  # noqa: F401 # should be always on top
from nqs_sdk import Simulation, ProtocolManager
import json

# Create protocol managers
uniswap = ProtocolManager("uniswap_v3_rust")

# Initialize simulation with protocols and configuration
# You can use the example config or create your own with create_config.py
sim = Simulation([uniswap], "./examples/configs/basic_config.yml")

# Run the simulation
all_observables_str = sim.run() # this intermediate step will be fixed soon
all_observables = json.loads(all_observables_str)

# Access results
print(f"Simulation completed with {len(all_observables)} observables")
```

### Getting Involved

- **Documentation**: [https://nuant.github.io/nqs-sdk/](https://nuant.github.io/nqs-sdk/)
  > - [Explore Core Concepts](https://nuant.github.io/nqs-sdk/core_concepts.html) - Learn about the fundamental architecture and components
  > - [Study How to Build](https://nuant.github.io/nqs-sdk/build.html) - Dive deeper into configuration and practical examples
  > - [Check the API Reference](https://nuant.github.io/nqs-sdk/api_reference.html) - Detailed documentation of all classes and methods
- **GitHub Issues**: [https://github.com/Nuant/nqs-sdk/issues](https://github.com/Nuant/nqs-sdk/issues)
- **Contact**: Contact us to [thelab@nuant.ai](mailto:thelab@nuant.ai) for joining us on private Telegram channel
- **Examples**: Explore practical implementations in the [examples](https://github.com/Nuant/nqs-sdk/tree/master/examples) directory. [JSON schemas](https://github.com/Nuant/nqs-sdk/tree/master/examples/configs/schemas) are provided to ensure proper format and validation.

Now that you have the NQS SDK installed and understand the basics, you might want to:

## Known issues and roadmap

Coming soon:

- Programmatic API to manage simulation and backtest directly in Python
- API stabilisation

And later:

- Compound V2 support, more protocols will follow
- EVM based *any* protocol executions

Known issues:

- Support of Python 3.13
- Improve protocol naming to reflect implementation variants (e.g. uniswap_v3_rust)
- Replace default String sim.run() output by a native Python dict
