Metadata-Version: 2.4
Name: nqs_sdk
Version: 0.6.3
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Rust
Requires-Dist: numpy>=1.26.0
Requires-Dist: python-dotenv>=1.0.1
Requires-Dist: dill>=0.3.8
Requires-Dist: sortedcontainers==2.4.0
Requires-Dist: pyyaml==6.0.1
Requires-Dist: restrictedpython>=8.0
Requires-Dist: llm-sandbox[docker]>=0.3.16
Requires-Dist: a2a-sdk>=0.2.11
License-File: LICENSE.txt
Summary: Nuant Quantitative System SDK
Author: The Lab @ Nuant
Maintainer-email: "The Lab @ Nuant" <thelab@nuant.ai>
Requires-Python: >=3.12, <3.14
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
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

<!-- 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
from nqs_sdk.protocols import UniswapV3
import json

# Initialize simulation with protocols and configuration
# You can use the example config or create your own with create_config.py
uniswap_v3 = UniswapV3Factory() # factory for all UniswapV3 instances
sim = Simulation([uniswap_v3], "./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:

- API stabilisation
- API examples with arbitrageur or other multi-agents scenarios

And later:

- Compound V2 support, more protocols will follow
- Open Rust API to extend core interfaces directly in Rust
- API for external data provider

  (currently the NQS SDK uses quantlib and data.app.nuant.com for data handling)
- EVM based *any* protocol executions

Known issues:

- Support of Python 3.11 and 3.13
- Support of Linux arm64

