Skip to main content
Skip to main content

Python SDK

warning

The Silhouette API and SDK is currently in beta and under active development. More operations and features will be added soon.

The official Python SDK provides a convenient way to interact with the Silhouette API.

Installation

pip install silhouette-python-sdk

The package is available on PyPI.

Quick start

from silhouette import SilhouetteApiClient

# Initialise the client with your private key
client = SilhouetteApiClient(
base_url="https://api.silhouette.exchange",
private_key="your_private_key_here",
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