ethereal-sdk


Nameethereal-sdk JSON
Version 0.1.0b11 PyPI version JSON
download
home_pageNone
SummaryPython SDK for interacting with the Ethereal API
upload_time2025-07-30 17:13:34
maintainerNone
docs_urlNone
authorMeridian Labs
requires_python>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Ethereal Python SDK

A Python library for interacting with the Ethereal trading platform. This SDK provides tools for trading, managing positions, and accessing market data.

## SDK Documentation

For full documentation, visit the [documentation site](https://meridianxyz.github.io/ethereal-py-sdk/).

## Installation

### Using uv (Recommended)

[uv](https://github.com/astral-sh/uv) is a fast Python package installer and resolver:

```bash
# Install uv if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install the SDK
uv add ethereal-sdk
```

### Using pip

```bash
pip install ethereal-sdk
```

## Quick Start

```python
from ethereal import RESTClient

# Create a client
config = {
    "base_url": "https://api.etherealtest.net",
    "chain_config": {
        "rpc_url": "https://rpc.etherealtest.net"
        "private_key": "your_private_key",  # optional
    }
}
client = RESTClient()

# Get market data
products = client.list_products()
prices = client.list_market_prices()

# Place an order (NOTE: Private key and account are required)
client.create_order(
    order_type="limit",
    quantity=1.0,
    side=0,  # 0 for buy, 1 for sell
    price=100.0,
    ticker="BTCUSD"
)
```

## Development

To set up the development environment:

```bash
# Clone the repository
git clone git@github.com:meridianxyz/ethereal-py-sdk.git
cd ethereal-py-sdk

# Install dependencies with uv
uv sync

# Run tests
uv run pytest

# Run the linter
uv run ruff check --fix

# Run the example CLI
uv run python -i examples/cli.py
```

## Main Features

### Market Data

- List available trading products
- Get current market prices
- View market order book
- Track funding rates

### Trading

- Place market and limit orders
- Cancel orders
- View order history
- Track trades and fills

### Account Management

- Manage subaccounts
- View positions
- Track token balances
- Handle deposits and withdrawals

### Websocket Support

- Real-time market data
- Live order book updates

## Configuration

The SDK can be configured with these options:

- `private_key`: Your private key for authentication
- `base_url`: API endpoint (default: "https://api.etherealtest.net")
- `timeout`: Request timeout in seconds
- `verbose`: Enable debug logging
- `rate_limit_headers`: Enable rate limit headers

## Examples

### Get Market Data

```python
# List all available products
products = client.list_products()

# Get current prices
all_product_ids = [product.id for product in products]
prices = client.list_market_prices(productIds=all_product_ids)

# View market liquidity
btc_product_id = client.products_by_ticker['BTCUSD'].id
liquidity = client.get_market_liquidity(productId=btc_product_id)
```

### Manage Orders

```python
# Place a limit order
order = client.create_order(
    order_type="limit",
    quantity=1.0,
    side=0,
    price=100.0,
    ticker="BTCUSD"
)

# Cancel an order
client.cancel_order(orderId="<uuid of order>")

# View order history
subaccount_id = client.subaccounts[0].id
orders = client.list_orders(subaccountId=subaccount_id)
```

### Account Operations

```python
# List subaccounts
subaccounts = client.subaccounts

# View positions
positions = client.list_positions(subaccountId=subaccounts[0].id)

# Get token balances
balances = client.get_subaccount_balances(subaccountId=subaccounts[0].id)
```

## Error Handling

The SDK includes built-in error handling for:

- Invalid requests
- Authentication errors
- Rate limiting
- Network issues

## Ethereal Documentation

For full documentation, visit our [documentation site](https://docs.ethereal.trade).

## Support

For issues and questions, please refer to the project's issue tracker or documentation.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ethereal-sdk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Meridian Labs",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/fb/78/6423c06ac529eec4e783bb18ce77f391346281c9f385259edc3de7306c0f/ethereal_sdk-0.1.0b11.tar.gz",
    "platform": null,
    "description": "# Ethereal Python SDK\n\nA Python library for interacting with the Ethereal trading platform. This SDK provides tools for trading, managing positions, and accessing market data.\n\n## SDK Documentation\n\nFor full documentation, visit the [documentation site](https://meridianxyz.github.io/ethereal-py-sdk/).\n\n## Installation\n\n### Using uv (Recommended)\n\n[uv](https://github.com/astral-sh/uv) is a fast Python package installer and resolver:\n\n```bash\n# Install uv if you don't have it\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n\n# Install the SDK\nuv add ethereal-sdk\n```\n\n### Using pip\n\n```bash\npip install ethereal-sdk\n```\n\n## Quick Start\n\n```python\nfrom ethereal import RESTClient\n\n# Create a client\nconfig = {\n    \"base_url\": \"https://api.etherealtest.net\",\n    \"chain_config\": {\n        \"rpc_url\": \"https://rpc.etherealtest.net\"\n        \"private_key\": \"your_private_key\",  # optional\n    }\n}\nclient = RESTClient()\n\n# Get market data\nproducts = client.list_products()\nprices = client.list_market_prices()\n\n# Place an order (NOTE: Private key and account are required)\nclient.create_order(\n    order_type=\"limit\",\n    quantity=1.0,\n    side=0,  # 0 for buy, 1 for sell\n    price=100.0,\n    ticker=\"BTCUSD\"\n)\n```\n\n## Development\n\nTo set up the development environment:\n\n```bash\n# Clone the repository\ngit clone git@github.com:meridianxyz/ethereal-py-sdk.git\ncd ethereal-py-sdk\n\n# Install dependencies with uv\nuv sync\n\n# Run tests\nuv run pytest\n\n# Run the linter\nuv run ruff check --fix\n\n# Run the example CLI\nuv run python -i examples/cli.py\n```\n\n## Main Features\n\n### Market Data\n\n- List available trading products\n- Get current market prices\n- View market order book\n- Track funding rates\n\n### Trading\n\n- Place market and limit orders\n- Cancel orders\n- View order history\n- Track trades and fills\n\n### Account Management\n\n- Manage subaccounts\n- View positions\n- Track token balances\n- Handle deposits and withdrawals\n\n### Websocket Support\n\n- Real-time market data\n- Live order book updates\n\n## Configuration\n\nThe SDK can be configured with these options:\n\n- `private_key`: Your private key for authentication\n- `base_url`: API endpoint (default: \"https://api.etherealtest.net\")\n- `timeout`: Request timeout in seconds\n- `verbose`: Enable debug logging\n- `rate_limit_headers`: Enable rate limit headers\n\n## Examples\n\n### Get Market Data\n\n```python\n# List all available products\nproducts = client.list_products()\n\n# Get current prices\nall_product_ids = [product.id for product in products]\nprices = client.list_market_prices(productIds=all_product_ids)\n\n# View market liquidity\nbtc_product_id = client.products_by_ticker['BTCUSD'].id\nliquidity = client.get_market_liquidity(productId=btc_product_id)\n```\n\n### Manage Orders\n\n```python\n# Place a limit order\norder = client.create_order(\n    order_type=\"limit\",\n    quantity=1.0,\n    side=0,\n    price=100.0,\n    ticker=\"BTCUSD\"\n)\n\n# Cancel an order\nclient.cancel_order(orderId=\"<uuid of order>\")\n\n# View order history\nsubaccount_id = client.subaccounts[0].id\norders = client.list_orders(subaccountId=subaccount_id)\n```\n\n### Account Operations\n\n```python\n# List subaccounts\nsubaccounts = client.subaccounts\n\n# View positions\npositions = client.list_positions(subaccountId=subaccounts[0].id)\n\n# Get token balances\nbalances = client.get_subaccount_balances(subaccountId=subaccounts[0].id)\n```\n\n## Error Handling\n\nThe SDK includes built-in error handling for:\n\n- Invalid requests\n- Authentication errors\n- Rate limiting\n- Network issues\n\n## Ethereal Documentation\n\nFor full documentation, visit our [documentation site](https://docs.ethereal.trade).\n\n## Support\n\nFor issues and questions, please refer to the project's issue tracker or documentation.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python SDK for interacting with the Ethereal API",
    "version": "0.1.0b11",
    "project_urls": {
        "Homepage": "https://github.com/meridianxyz/ethereal-py"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8c9e94c8bed4fdd112d150bc996392364d464f0ff7ffdcc482a151171023e805",
                "md5": "95930582039b413eaffb732b234749da",
                "sha256": "4bbafe28e8ccae296e218e02e16b259cc18b721f1f8e3cec05a24a7fc2afb093"
            },
            "downloads": -1,
            "filename": "ethereal_sdk-0.1.0b11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "95930582039b413eaffb732b234749da",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 93442,
            "upload_time": "2025-07-30T17:13:33",
            "upload_time_iso_8601": "2025-07-30T17:13:33.012531Z",
            "url": "https://files.pythonhosted.org/packages/8c/9e/94c8bed4fdd112d150bc996392364d464f0ff7ffdcc482a151171023e805/ethereal_sdk-0.1.0b11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "fb786423c06ac529eec4e783bb18ce77f391346281c9f385259edc3de7306c0f",
                "md5": "6f3443c754e52e468e91b6f895bc75fd",
                "sha256": "bea46e39c5e46bbfe69612e509c6319b9006aacaaf7ffc44db37e2048d03ad5a"
            },
            "downloads": -1,
            "filename": "ethereal_sdk-0.1.0b11.tar.gz",
            "has_sig": false,
            "md5_digest": "6f3443c754e52e468e91b6f895bc75fd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 80037,
            "upload_time": "2025-07-30T17:13:34",
            "upload_time_iso_8601": "2025-07-30T17:13:34.076288Z",
            "url": "https://files.pythonhosted.org/packages/fb/78/6423c06ac529eec4e783bb18ce77f391346281c9f385259edc3de7306c0f/ethereal_sdk-0.1.0b11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-30 17:13:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "meridianxyz",
    "github_project": "ethereal-py",
    "github_not_found": true,
    "lcname": "ethereal-sdk"
}
        
Elapsed time: 2.93122s