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.1.tar.gz (4.5 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.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mockmarket-0.1.1.tar.gz
  • Upload date:
  • Size: 4.5 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.1.tar.gz
Algorithm Hash digest
SHA256 c952e2808878bada23cb7f4a64c1abb70cb69a7e5c1ab9d5e118bc881d2c03d0
MD5 d6c0c7b73642fdef3fc2589409c03da8
BLAKE2b-256 9033f8c324e2b419f569ca247122a7e159e064134ace0c9e2c78aea10f4b175d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mockmarket-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c8b056020d9fda3a9052bd7e3797d0c71243e8074a8e178d701a040913444bd
MD5 76f28d1a82f18ab5aeb09f461a5cd193
BLAKE2b-256 706200e22585ebb8b775e6265006d3b054358d1b0fe17f7a1b1978744f8590d0

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