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

Uploaded CPython 3.13Windows x86-64

nqs_sdk-0.6.7-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.7-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.7-cp312-cp312-win_amd64.whl (12.1 MB view details)

Uploaded CPython 3.12Windows x86-64

nqs_sdk-0.6.7-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.7-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.7-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: nqs_sdk-0.6.7-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.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8df2f2f9609de178fd68724574deb9c910765d16c307fd179707d9d3226941bd
MD5 703dbeff634031e16f5f1e2d396f575f
BLAKE2b-256 9493e3e3e213e02a21756b18842e347781486362fa8e491cfd4abee258f98fb5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nqs_sdk-0.6.7-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ddbca605ac45baa46271799b4e2e076a85ca17e91b8f2379c325c3c137f5fb52
MD5 c232cd7588df5cf6a90fe4d0b9bf736e
BLAKE2b-256 b80fc3d0758e9ad4b2292aa75f3f2e2836f74e0b598382162c4e5116fd9d7a10

See more details on using hashes here.

File details

Details for the file nqs_sdk-0.6.7-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.7-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 135ad296252883537192701fb316c4774f3e375a0f4bf9679c872cca30cd354d
MD5 33ca570f848a74d1743f319c67341fb3
BLAKE2b-256 d592a96c984363be5cf58833d8eb773471443fb95b9df9440a88be1c7a2fec35

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nqs_sdk-0.6.7-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.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c07ef2b28f08a55bd7958329f58b373fb5cf19db01b7a967b79bb9ef2af17dcd
MD5 acd31581d0cd31c36f9888bf90f49188
BLAKE2b-256 bb6567f1d913f0dfb03f4631a26478d23251da52f31a1e0a133de8b29624e3cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nqs_sdk-0.6.7-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 66dc06cbbdbf956ffa94f35ab2ff54b316ff84c805d8dacb5b4c2d7b6eb409a1
MD5 260f857d8752c4b3768e1923ed9d2c44
BLAKE2b-256 2f00bf8ecb38cd8b5d41b17c77887471b14820c03aba0b289bf154018c88a6bd

See more details on using hashes here.

File details

Details for the file nqs_sdk-0.6.7-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.7-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 d9ddfcbbcc873876e35e8bac5e25cd7f7c5c2d0201a02cb3cf9d45c0415cc7c1
MD5 d9b361be6836d45fdcfd44c6205a4045
BLAKE2b-256 1cd075b0f673ef28e0854733b33b00dc913c7a598c6eda83ea7c4d1d785317cd

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