Skip to main content

Superchain exchange trading library

Project description

SCXT

SCXT is a Python library providing a unified interface for interacting with exchanges across the Optimism Superchain

Overview

SCXT abstracts away the complexities of interacting with protocols by providing a consistent API across all supported exchanges. This makes it easier for developers to build trading tools, bots, and analytics platforms that work across multiple protocols and chains.

Quickstart

The core idea is to create an instance of the exchange you want to use. Let's use Synthetix V2 on the Optimism network (chain ID 10) as an example.

import os
from scxt.exchanges import SynthetixV2
from dotenv import load_dotenv

# Load environment variables (optional, for API keys etc.)
load_dotenv()

# Configuration for Synthetix V2
config = {
    "chain_id": 10,  # Optimism Mainnet
    "private_key": os.getenv("PRIVATE_KEY"), # Your wallet's private key
    "rpc_url": os.getenv("CHAIN_10_RPC") # An Optimism RPC endpoint
}

# Create the exchange instance
exchange = SynthetixV2(config)

# Fetch markets
markets = exchange.fetch_markets()
print("Markets:", markets)

Features

  • Unified API between protocols and exchanges
  • Market data retrieval (available markets, prices, order books)
  • Account information and balances
  • Consistent error handling and data formats

Supported Exchanges

  • Synthetix V2
  • Odos

Documentation

For detailed documentation, examples, and API references, visit the documentation site (coming soon).

Acknowledgments

  • This project is supported by an Optimism Builders Grant
  • Inspired by the CCXT library for centralized exchanges

Status

SCXT is currently in early development. The API is subject to change as the project evolves.

Project details


Download files

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

Source Distribution

scxt-0.1.3.tar.gz (33.2 kB view details)

Uploaded Source

Built Distribution

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

scxt-0.1.3-py3-none-any.whl (41.0 kB view details)

Uploaded Python 3

File details

Details for the file scxt-0.1.3.tar.gz.

File metadata

  • Download URL: scxt-0.1.3.tar.gz
  • Upload date:
  • Size: 33.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.11

File hashes

Hashes for scxt-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7000f99e428aa5a9f6130d2de0710c20d39c97a11e56e64488cd26ff87bb9b03
MD5 293e9a9fcb5b3520d18884235df39242
BLAKE2b-256 84299b949ed9f1d61fdfefbbfd8995b106a22abadeca289ed5da340ec840b6fa

See more details on using hashes here.

File details

Details for the file scxt-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: scxt-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 41.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.11

File hashes

Hashes for scxt-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2bc902f4b8cabae803c5c01c8553edc752c0f53eb384ee6df185e104a6ca19dc
MD5 7f81ed2aedc0c9b2c72785bbf4ea8f55
BLAKE2b-256 d8edc689ad87b3fadf54b9d2dde0aad044ee68c3dcec9c8329887e1823887619

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