Skip to main content

Nuant Quantitative System SDK

Project description

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.

For additional examples and tests, please visit the companion repository at https://github.com/Nuant/nqs-sdk-extension/.

Prerequisites

Before installing the NQS SDK, ensure you have:

  • Python 3.12 or 3.13
  • pip package manager

Installation

Install the NQS SDK using pip:

pip install nqs-sdk

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

Environment Configuration

Get your API key from

https://agents.nuant.ai/subscribe

The 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.

(
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:

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

Verify Installation

First, verify that the installation was successful:

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:

from nqs_sdk import Simulation
from nqs_sdk.protocols import UniswapV3Factory
import json

# Initialize simulation with protocols and configuration
uniswap_v3 = UniswapV3Factory() # factory for all UniswapV3 instances
sim = Simulation([uniswap_v3], "./examples/configs/basic_config.yml")

# Run the simulation
all_observables = sim.run()

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

Tips:

  • By default, the execution is quiet, and you can make it verbose to watch the execution flow.
  • Data queries to feed the simulation can be expensive; consider setting the quantlib cache to make it faster.

for both, see Useful environment variables section below.

Getting Involved

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-agent 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
  • Support of Linux arm64

Useful environment variables

Variable name Example Description
QUANTLIB_CONFIG nuant-quantlib.toml Path to a config file in TOML format
QUANTLIB_CACHE ./your_dir/.cache Cache directory to optimize quantlib calls


(be sure to create the directory)

RUST_LOG debug Configure the log level of core engine

For more environment variables, see Environment variables

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

nqs_sdk-0.6.9-cp313-cp313-win_amd64.whl (11.9 MB view details)

Uploaded CPython 3.13Windows x86-64

nqs_sdk-0.6.9-cp313-cp313-manylinux_2_28_x86_64.whl (13.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

nqs_sdk-0.6.9-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (22.4 MB view details)

Uploaded CPython 3.13macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

nqs_sdk-0.6.9-cp312-cp312-win_amd64.whl (11.9 MB view details)

Uploaded CPython 3.12Windows x86-64

nqs_sdk-0.6.9-cp312-cp312-manylinux_2_28_x86_64.whl (13.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

nqs_sdk-0.6.9-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (22.4 MB view details)

Uploaded CPython 3.12macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file nqs_sdk-0.6.9-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: nqs_sdk-0.6.9-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 11.9 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for nqs_sdk-0.6.9-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 897dd623072aa6384baaf10efeb5daee95f8755c14647868b99397f934f66863
MD5 010fd0620861a97d7d8cf3427a0a5c9e
BLAKE2b-256 8b78bbe029704643e926eabbf46bd9d51b08b950ca7343a2aaea5f966c3e5dfa

See more details on using hashes here.

File details

Details for the file nqs_sdk-0.6.9-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nqs_sdk-0.6.9-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 07dd1c5aca13dbc8bca5a32a9ae8fc6fd654c19c4484671c24f953bc116dfc8d
MD5 2a734d96fe7421e751c23e1a36e24616
BLAKE2b-256 8e4172a813e7e01218ce4c410915de7548b1837c5e578d76ca59414a184773ff

See more details on using hashes here.

File details

Details for the file nqs_sdk-0.6.9-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for nqs_sdk-0.6.9-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 1ba5e39ee7c4f55ad672bed288f7b25eec49f82e2d91374029e25d6ca832e0a0
MD5 e73df5a339f799377bc43f017ccc9ee3
BLAKE2b-256 5d5db780f2866afd76e4895b2d7de4f1a56f3b8a743e0f4b46b5c156645f67d8

See more details on using hashes here.

File details

Details for the file nqs_sdk-0.6.9-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: nqs_sdk-0.6.9-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 11.9 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for nqs_sdk-0.6.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 11ac1ca768d664b0ffa8dd6ecf37a3aceb9a0187e70d8bd453659b717fdd5df1
MD5 c03fa0b505a8bead1926ffa56af368a1
BLAKE2b-256 8f291cfb046dbdbc2857451c296a1f492c66d3188bf5a0984cd2598daab52863

See more details on using hashes here.

File details

Details for the file nqs_sdk-0.6.9-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nqs_sdk-0.6.9-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a99a7766770bc08103abb2450a9c28226280de3657065deff7e21a4d1e207636
MD5 64cce99308c74f5e43060fcf0dba6b32
BLAKE2b-256 804da517eb2a71c80a11a18b476cf4454deeadbe49b3f6d26e180b91002c3308

See more details on using hashes here.

File details

Details for the file nqs_sdk-0.6.9-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for nqs_sdk-0.6.9-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 eb280a8901c2da25d7b7a60d049409875a179a16519aa69e492b6e86a1b01b57
MD5 d04366d4b963477885140f42d251360b
BLAKE2b-256 7799e29c784c0e2c621fd2b17119e3e1c8145dc4cff5947f7c49b6a9131b9e4d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page