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

Uploaded CPython 3.13Windows x86-64

nqs_sdk-0.6.8-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.8-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (22.7 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.8-cp312-cp312-win_amd64.whl (12.1 MB view details)

Uploaded CPython 3.12Windows x86-64

nqs_sdk-0.6.8-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.8-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (22.7 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.8-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: nqs_sdk-0.6.8-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 12.1 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.8-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6c352307ac26468fdaa5bfdbbc99e7045fa1fa0ce501e5ed3bb721ee684fd7b8
MD5 a1c3b2fb545d627f4c37c296994f1454
BLAKE2b-256 9990340b5a24817d81016bcd62309eca1e36051817129245a52ef36b759bf138

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nqs_sdk-0.6.8-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 54b8cb8454db9f50f531fc1e1f6a6f254eff7e5614330721b0d2233ff38fe193
MD5 58936cec60f85debf2b28ba3937aac08
BLAKE2b-256 208a8d130259c5e4a12adc14157d7127d937fa14ffbb8e66f69faab64c377c61

See more details on using hashes here.

File details

Details for the file nqs_sdk-0.6.8-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.8-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 30aaa01af4d4cc3eb72db9fba1462324f69bd6091375a648d67b3a2debbdafba
MD5 2d7c6505b712c714902c3250db07f361
BLAKE2b-256 b31954eef13f8c0244600a4e06a74c963ae4ca550183120a8258d803a96373d2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nqs_sdk-0.6.8-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 12.1 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.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7bb4deafaf3c3ba3c46c8818817fa0fd6565eb5de3f6556f0974c5cc29356b07
MD5 6f77be968f8aaab7f79208cf32831f4c
BLAKE2b-256 7911f71ea095f50b92fe1e53000eaf5440885c2e0eb7660c42edfa73bbc2e8aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nqs_sdk-0.6.8-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 900a6ff6fd8b9de142e35dedbf29020a18eedf4f05729bdd5e1f678ea081fad8
MD5 56978ce7b859d7e919f1ed553d408d6b
BLAKE2b-256 07639dec8e6f1da7d5866dabf89c7d12e34d2480b8067a9ec3953c1697a66a53

See more details on using hashes here.

File details

Details for the file nqs_sdk-0.6.8-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.8-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 66e7186716c22cae486f1de23054ca9dd371dfdd69dd57e2cad15bd8d273404c
MD5 3237c859eb18f77e4cbed40eb98699e2
BLAKE2b-256 03c9cf9c0dbe81b66099eb5e62522ef03b86691d46c9f680a6ab1a3366710cdd

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