Skip to main content
Skip to main content

Python SDK

The official Python SDK provides programmatic access to the Silhouette API. All requests route through shielded execution, so strategy, size, and intent are not attributable to the user's wallet on the public orderbook.

Installation

pip install silhouette-python-sdk

The package is available on PyPI.

Quick Start

import os
from silhouette import SilhouetteApiClient

# Initialize the client with your private key
# Never hardcode your private key - use environment variables
client = SilhouetteApiClient(
base_url="https://api.silhouette.exchange",
private_key=os.environ["SILHOUETTE_PRIVATE_KEY"],
auto_auth=True,
)

# Check your balances
balances = client.user.get_balances()
print(balances)

# Place an order
order = client.order.create_order(
side="buy",
order_type="limit",
base_token="HYPE",
quote_token="USDC",
amount="1.0",
price="0.001",
)
print(f"Order placed: {order['orderId']}")

Resources