black-market-sdk
Canonical Python SDK for the Black Market protocol on Robinhood Chain — Abyss DEX infrastructure, Atomic token launches, and the lending market.
Built on web3.py. Python 3.10+. Mirrors the TypeScript SDK (@black-market/sdk).
Install
pip install black-market-sdk
Quick start
from black_market_sdk import create_protocol_web3, get_addresses, ROBINHOOD_MAINNET_CHAIN_ID
w3 = create_protocol_web3(chain_id=ROBINHOOD_MAINNET_CHAIN_ID)
addresses = get_addresses(ROBINHOOD_MAINNET_CHAIN_ID) # canonical mainnet deployment
# get_addresses() defaults to the workbench fork (46631); pass the chain id explicitly.
Wallet client (signing)
import os
from black_market_sdk import create_protocol_wallet_web3
w3, account = create_protocol_wallet_web3(
private_key=os.environ["PRIVATE_KEY"],
chain_id=4663,
)
Atomic launches
from black_market_sdk import (
AtomicLaunchPoolRecipeInput,
build_atomic_launch_calldata,
derive_atomic_launch_pool_recipe,
estimate_atomic_launch_initial_buy,
)
# Derive the one-sided launch position from a target FDV.
recipe = derive_atomic_launch_pool_recipe(
AtomicLaunchPoolRecipeInput(
paired_token_decimals=18,
paired_token_usd_price_x18=2_500 * 10**18,
target_market_cap_usd_x18=5_000 * 10**18,
launched_token_is_quote=False,
fee=3_000,
)
)
# Validate a request and encode deployAndLaunch calldata.
calldata = build_atomic_launch_calldata(request, native_buy_amount=0)
Networks
| Chain ID | Network |
|---|---|
4663 |
Robinhood Chain mainnet |
46631 |
Black Market workbench (fork) |
31337 |
Local Anvil |
get_addresses() defaults to workbench chain 46631; pass 4663 for canonical mainnet or 31337 for Anvil. Overrides are read once at module import. Launch addresses accept bare, VITE_, then NEXT_PUBLIC_ keys on every chain. Abyss infrastructure overrides apply only to 31337 and 46631; mainnet Abyss addresses remain canonical. Lending overrides apply to 31337 with all three forms and to 46631 with VITE_/NEXT_PUBLIC_ only. LIQUIDATION_EXECUTOR is additionally overridable on mainnet.
Package layout
| Module | Contents |
|---|---|
black_market_sdk.addresses |
Chain IDs, canonical deployment addresses, env overrides |
black_market_sdk.abis |
Lending-market ABIs (pool, data providers, lens, oracle, vesting, …) |
black_market_sdk.abyss |
Abyss DEX ABIs and launch-module ABIs, pool profiles, fee tiers |
black_market_sdk.auction |
Atomic launch supply constants and paired-asset (quote) catalog |
black_market_sdk.launch |
Launch templates, Atomic launch recipe derivation, calldata building |
black_market_sdk.live |
Reserve/user position normalization from lens & data-provider rows |
black_market_sdk.format |
RAY/WAD math, health-factor and units formatting helpers |
black_market_sdk.client |
web3.py client factories |
Examples
Examples never sign or broadcast transactions. quickstart.py builds a fresh launch request offline; launch_recipe.py focuses on pricing math; and abby_launch.py reconstructs the successful Abby mainnet launch byte-for-byte.
python examples/quickstart.py
python examples/launch_recipe.py
python examples/abby_launch.py
Development
pip install -e ".[dev]"
pytest
Releasing
Releases are published to PyPI from GitHub Actions with trusted publishing (OIDC) — no API tokens or passwords are stored in this repository.
- Bump
versioninpyproject.tomland commit. - Cut a matching git tag (for example,
v0.1.0) and create a GitHub Release from it. - The
publishworkflow runs on the releasepublishedevent, verifies the tag matchespyproject.toml, builds and checks the sdist and wheel, then uploads them to PyPI via OIDC. It can also be run manually with an explicit version input.
The publish job declares environment: pypi. Configure the pypi environment
in the repository settings (required reviewers, allowed branches/tags) so a
human approves every release, and register the workflow as a trusted publisher
in the PyPI project settings.
License
MIT
Release files for black-market-sdk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| black_market_sdk-0.1.0.tar.gz | 1.1 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| black_market_sdk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.1 MB
Release files / black_market_sdk-0.1.0.tar.gz
| Download URL | black_market_sdk-0.1.0.tar.gz |
|---|---|
| Size | 1.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f4ce062ba65af3848df8148f9e99fcd54af15686fe360a415a5c0b2047f0c1e
|
|
BLAKE2b-256 checksum How to use checksums |
e88e9fbd6349838d35a1ffd8d96fa30714c27b0764959b9e16855d1505e0d273
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.
Transparency logRelease files / black_market_sdk-0.1.0-py3-none-any.whl
| Download URL | black_market_sdk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 35.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7a53558f84feca023eb4d31629365d41966701da4a4e41481397e6ea11751222
|
|
BLAKE2b-256 checksum How to use checksums |
606bd2db12f969b11254d7d6ea8e1c1477fc34e407c906231d67c98c776893f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.
Transparency log