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.4.tar.gz (33.4 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.4-py3-none-any.whl (41.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for scxt-0.1.4.tar.gz
Algorithm Hash digest
SHA256 6dc39669896197e1f9f80c4accc3b2e6650bdfbcea4840fb5c7eea8ba2a8c257
MD5 b7c775e4243992a200afb0c723dc0cdc
BLAKE2b-256 fcbab3c6ae373e910a8c9cbb65e6f8f301e63ee5d0b7c0327ad621dd066bc1a0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for scxt-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a9fb9ab6c1b5c3aa52174c46bf80414f6f733762f0c8826f9d2e11d6215c6c1d
MD5 3504dac782e9ba8bc3a5408a81a71ea9
BLAKE2b-256 d11e8f75b85da3aa089c6d7bcf0b347c3b5eb5d6e441c7cfdae54ad4f434c415

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