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.5-cp313-cp313-win_amd64.whl (12.0 MB view details)

Uploaded CPython 3.13Windows x86-64

nqs_sdk-0.6.5-cp313-cp313-manylinux_2_28_x86_64.whl (14.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

nqs_sdk-0.6.5-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (22.6 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.5-cp312-cp312-win_amd64.whl (12.0 MB view details)

Uploaded CPython 3.12Windows x86-64

nqs_sdk-0.6.5-cp312-cp312-manylinux_2_28_x86_64.whl (14.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

nqs_sdk-0.6.5-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (22.6 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.5-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: nqs_sdk-0.6.5-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 12.0 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.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3df2df0281bea8e49daf850e5f4a160b5bde8367e57e8059bb7b662c0f618839
MD5 aa6328664b1fc919454366c3c4851d2c
BLAKE2b-256 626aa37b2308c7a4e409128979fa9e23a3a9b258287a284180d026bc27b01d6c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nqs_sdk-0.6.5-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8ea7aee85870e45c172a31fcd0b6be40ecdd5c9d1e9e609f7de379b3a14161ac
MD5 061991defae35d4cd89e492d7be8eab5
BLAKE2b-256 6916abb3dcb898e7647fa103297a219c60d7723dd131caf748412d97df17481b

See more details on using hashes here.

File details

Details for the file nqs_sdk-0.6.5-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.5-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 3cabb6195bac2a57730301eec227300ec1faa8c884f528eda95fb4f0cab41ebe
MD5 bfcc08787f2b770e7fb56eb3e7abe729
BLAKE2b-256 b7a065a111e6634ccae591dccaf5ad61db963006a6dab432a5247e972a5e7bbc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nqs_sdk-0.6.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 12.0 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.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 03b29f47f02a173d598aa2313c7eb74055aafb4ce1137a21f35619d701795687
MD5 dabd8301a68719c625f7c7ae80d6b9ae
BLAKE2b-256 bbf465575c224485fba319a22a797ed2e9205fe866109dd20bbe16b494946a83

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nqs_sdk-0.6.5-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c539a241e175933750af29930c902c219bd50efd8e2764e40c3519a0f5dc89d4
MD5 79686f02c9acd318c7c615080542d7fb
BLAKE2b-256 2f948d49d1d35f9094c4d81a899cae28aa40111967ed91e29c2ad6b3a3208a74

See more details on using hashes here.

File details

Details for the file nqs_sdk-0.6.5-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.5-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 74d9e99bb3181f1355947f365f78293d7e587114df15be35133e74930edeb58a
MD5 6313641900916db429b389899d677dbc
BLAKE2b-256 e006c2b5d43fc549a60846897268a19f6f3d30f63f680aa68c0108bfefc9f903

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