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.2.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.2-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mockmarket-0.1.2.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":"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.2.tar.gz
Algorithm Hash digest
SHA256 98171e924dee22d916c6a72b8aae68f62c51b81a416748b794988bdb00b996c8
MD5 1fbd657ce0fad773e870a9fe0ba479b9
BLAKE2b-256 a2275eaf4838a8164e60595a693d1e488bef43348ff088391ae350a01258d0cd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mockmarket-0.1.2-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":"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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f5310604e0314b981f68eccca438b32490c9aef5da30a454ca4780141bb4a77b
MD5 5a96bda0cea14668c3add1da266138ab
BLAKE2b-256 3375e677f1c28887c73ec4a04c9261c5f6dd36e8489e9101e15bb801382218e9

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