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

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.4.tar.gz (4.7 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.4-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mockmarket-0.1.4.tar.gz
Algorithm Hash digest
SHA256 b0b0875d04116fa71eff10b6e1b4edff9e0f0c284729ff482088ee8cae42c7a8
MD5 6c5a98d0733e2331b04becef94fa6f45
BLAKE2b-256 52201a7d5f060c77a1dc693ba16db58c6d3b56da9d2ea67fbadcb2b69f11ca68

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mockmarket-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d0caff242b354255e765af020d24bfbc1357a2c76bb454e628928e8b2f8e29f1
MD5 30f8bbebd33fafd4fc3dc51537d18eb3
BLAKE2b-256 1f97ab0e9f8a9ee723798d713a7c458b514b22464b4c4ee40881f1c74fba198c

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