Skip to main content

Async Python SDK for the MockMarket algorithmic trading sandbox

Project description

MockMarket SDK

Async Python SDK for the MockMarket algorithmic trading sandbox.

Built with httpx + pydantic v2.

Installation

uv add mockmarket-sdk

Quick Start

import asyncio
from mockmarket import MockMarketAsyncClient, OrderCreate, SandboxCreate


async def main() -> None:
    async with MockMarketAsyncClient("YOUR_API_KEY") as client:
        sandbox = await client.sandboxes.create(
            SandboxCreate(
                name="My Bot",
                fee_structure="standard",
                base_slippage_pct=0.1,
                latency_ms=50,
            )
        )
        candles = await client.market.get_candles(sandbox.id, "AAPL")
        order = await client.orders.create(
            OrderCreate(
                sandbox_id=sandbox.id,
                symbol="AAPL",
                side="buy",
                order_type="limit",
                quantity=10.0,
                price=150.0,
            )
        )
        positions = await client.risk.get_positions(sandbox.id)
        balance = await client.risk.get_balance(sandbox.id)
        pnl = await client.analytics.get_pnl(sandbox.id)


asyncio.run(main())

Sub-clients

Client Namespace Methods
Sandboxes client.sandboxes list(), create(), get(), stop(), update()
Market Data client.market get_ticks(), get_candles(), get_universe(), search_stocks(), get_quote(), get_history(), get_profile()
Orders client.orders list(), create(), get()
Risk client.risk get_positions(), get_balance(), get_liquidations()
Analytics client.analytics get_trades(), get_pnl(), get_metrics()

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

mockmarket-0.1.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mockmarket-0.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file mockmarket-0.1.0.tar.gz.

File metadata

  • Download URL: mockmarket-0.1.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mockmarket-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8cdce15e8ed93c22c28fe6a5761f3bc7b7015bf928dde357c20818b9113914eb
MD5 00509d6ed7981a17ad8242f30d34f5d9
BLAKE2b-256 894af3c84dc71d02674f6e486f851c18830c3ee3d788b45d2e6e1cd999edf372

See more details on using hashes here.

File details

Details for the file mockmarket-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mockmarket-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mockmarket-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c082ddd1df8b74df9bda8141cab262d80da36b5f620409530b5de50c479af24
MD5 40e4f88854ff35987ffc2e784d199e42
BLAKE2b-256 f8495de431573cfa6a2e68959257c2daa178cc4c5a20b7ced9de3a647095d41c

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