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.5.tar.gz (33.8 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.5-py3-none-any.whl (41.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for scxt-0.1.5.tar.gz
Algorithm Hash digest
SHA256 dfd15b9f2c091b284163f76847e8a6b24ffbb907175f33be1d358c23ef46693c
MD5 e13eccbfb31317fb0552639952578413
BLAKE2b-256 aec23211db98528544743372037ed91a81d1269329c0271c4f3fbb4e41503945

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for scxt-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b70c5a19a2a88732489da28fbc797452b05b3dcdc36c3c687d722f9ec7795658
MD5 f3d23ee75bd0afcb8e96ad8d8ecfeb86
BLAKE2b-256 906a83029bd0b5831efcc1ac7cbbd018e27c7a07eb2f1371dd2fba50fcbd9d87

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