Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Charli3 Dendrite

Python SDK for interacting with Cardano DEXs

Python version License PRs welcome

Overview

Charli3 Dendrite is a powerful Python SDK designed for seamless interaction with multiple Decentralized Exchanges (DEXs) on the Cardano blockchain. It provides a unified interface for developers to access various DEX functionalities, simplifying the process of building applications in the Cardano ecosystem.

Key Features

  • 🔄 Multi-DEX Support: Integrate with Minswap, MuesliSwap, Spectrum, SundaeSwap, VyFi, GeniusYield, Axo, and WingRiders
  • 💧 Liquidity Pool Data: Fetch and analyze pool information across different DEXs
  • 💱 Swap Operations: Execute token swaps with ease
  • 🧩 Flexible Asset Handling: Manage various asset types and pool states efficiently
  • 🔗 On-chain Data Integration: Connect with Blockfrost or custom data providers
  • 🛠 Extensible Architecture: Easily add support for new DEXs and features

Quick Start

Installation

# Using pip
pip install charli3_dendrite

# Using Poetry
poetry add charli3_dendrite

Supported DEXs

Charli3 Dendrite currently supports the following Cardano DEXs:

  • Minswap
  • MuesliSwap
  • Spectrum
  • SundaeSwap
  • VyFi
  • WingRiders
  • GeniusYield
  • Axo

Upcoming DEXs

  • CardanoSwaps
  • Metadex
  • CSwap

Not Supported

  • TeddySwap
  • Cerra
  • SaturnSwap
  • Splash

Each DEX is implemented as a separate module within the charli3 dendrite.dexs.amm package.

Core Components

AbstractPoolState

The AbstractPoolState class in amm_base.py provides the base implementation for AMM (Automated Market Maker) pool states. It includes methods for:

  • Extracting pool information
  • Handling swap operations
  • Calculating prices and TVL (Total Value Locked)

AbstractPairState

The AbstractPairState class in base.py defines the interface for all pair states (both AMM and orderbook-based). It includes abstract methods that must be implemented by specific DEX classes.

Assets

The Assets class in models.py represents a collection of assets (tokens) and their quantities. It provides utility methods for working with asset collections, including addition and subtraction operations.

Configuration

Charli3 Dendrite can be configured using environment variables or a .env file. See sample.env for an example of the configuration options.

Data Provider Configuration

Charli3 Dendrite supports multiple data providers to fetch on-chain data. Currently, it supports Blockfrost and DBSync, with plans to add Ogmios and Kupo in the future.

Blockfrost Configuration

Blockfrost is the default data provider for Charli3 Dendrite. To use Blockfrost, you need to set up your API key in the environment variables or .env file:

PROJECT_ID="your-blockfrost-project-id"
NETWORK="mainnet"  # or "testnet" for the Cardano testnet

DBSync Configuration

Charli3 Dendrite also supports using a DBSync instance as a data provider. To configure DBSync, set the following environment variables:

DBSYNC_HOST="your-dbsync-host"
DBSYNC_PORT="your-dbsync-port"
DBSYNC_DB_NAME="your-dbsync-database-name"
DBSYNC_USER="your-dbsync-username"
DBSYNC_PASS="your-dbsync-password"

Future Plans: Ogmios and Kupo

We are planning to add support for Ogmios and Kupo as additional data providers in future releases. These will offer alternative ways to interact with the Cardano blockchain and may provide performance improvements or additional features. Stay tuned for updates on the integration of these providers. Once implemented, they will be configurable in a similar manner to the existing providers.

Wallet Configuration

Charli3 Dendrite supports wallet integration for performing transactions. You can configure a wallet using a mnemonic phrase:

WALLET_MNEMONIC="your wallet mnemonic phrase"

Development

To set up the development environment:

  1. Clone the repository
  2. Install dependencies: poetry install
  3. Set up pre-commit hooks: pre-commit install

Running Tests

poetry run pytest --benchmark-disable -v --slow -n auto

For parallel test execution:

poetry run pytest -n auto

Contributing

Contributions to Charli3 Dendrite are welcome! Please refer to the CONTRIBUTING.md file for guidelines on how to contribute to the project.

Metadata

Release files for charli3_dendrite 0.2.0.dev117

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for charli3_dendrite 0.2.0.dev117
File Size Uploaded Provenance Actions
charli3_dendrite-0.2.0.dev117.tar.gz 51.6 kB Without provenance Details for charli3_dendrite-0.2.0.dev117.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for charli3_dendrite 0.2.0.dev117
File Interpreter ABI Platform Actions
charli3_dendrite-0.2.0.dev117-py3-none-any.whl Python 3 none any Details for charli3_dendrite-0.2.0.dev117-py3-none-any.whl

Total release size: 117.3 kB

Release files / charli3_dendrite-0.2.0.dev117.tar.gz

Download URL charli3_dendrite-0.2.0.dev117.tar.gz
Size 51.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5073343404b1b29d919b7d3b85004f07581a6442beeadc13c2b5ddc4f9287172
BLAKE2b-256 checksum
How to use checksums
8b5b82ddc38dca0a6abda1842f78a67ad92459f264e2255282438bcaf6086eeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.13 Linux/5.15.0-106-generic

Release files / charli3_dendrite-0.2.0.dev117-py3-none-any.whl

Download URL charli3_dendrite-0.2.0.dev117-py3-none-any.whl
Size 65.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b956eaac669536c821faa658736b44f3355c98154f9a217e62847cb506128368
BLAKE2b-256 checksum
How to use checksums
c0202a48b2857c7b814c9ed3c29cb6d3f65e9934480755c539ae784987296dca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.13 Linux/5.15.0-106-generic

Security for charli3_dendrite 0.2.0.dev117

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page