Skip to main content

MetaGame Trading Bootcamp Python Client

Project description

MetaGame Trading Bootcamp Python Client

Write your trading bot with Python!

Dependencies

  • python
  • uv (which figures out all the python dependencies)

Installing uv

Install uv with the standalone installers:

# On macOS and Linux.
curl -LsSf https://astral.sh/uv/install.sh | sh
# On Windows.
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Or, from PyPI:

# With pip.
pip install uv
# Or pipx.
pipx install uv

Using bots

This following may not work on Windows without WSL.

  1. git clone https://github.com/tradingbootcamp/platform && cd python-client
  2. Install the dependencies with uv sync
  3. Copy example.env to .env
  4. Go to the "Accounts" page on the exchange and copy your JWT into .env
  5. Make sure you are acting as the account you are going to be trading from, the copy the ACT_AS into .env

You can test if it is working by running

uv run examples/min_max_bot.py "<name of market>"

This command places orders at the min and max settlement prices, so you shouldn't be risking any capital.

You can look at other example bots in examples/, like the code for an (older?) version of mark (market_maker_bot.py) and bob (naive.py).

You can figure out the Jupyter Notebook if you wish.

Account creation

TradingClient.create_account(...) supports the optional exchange account color:

client.create_account(
    owner_id=123,
    name="Team Blue",
    color="#3b82f6",
)

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

metagame-0.4.17.tar.gz (127.4 kB view details)

Uploaded Source

Built Distribution

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

metagame-0.4.17-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file metagame-0.4.17.tar.gz.

File metadata

  • Download URL: metagame-0.4.17.tar.gz
  • Upload date:
  • Size: 127.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.17

File hashes

Hashes for metagame-0.4.17.tar.gz
Algorithm Hash digest
SHA256 2598d9eb070f1ae458ce32f5b5f2c618483111a083a76985cb3b2d4d2770324f
MD5 899a280a86becc0aa8e0ea3c93972c20
BLAKE2b-256 7cec868c75ab5a521d136fe2f7ef78bd1a4fa3c66a0ac0f848df9322a67e52e2

See more details on using hashes here.

File details

Details for the file metagame-0.4.17-py3-none-any.whl.

File metadata

  • Download URL: metagame-0.4.17-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.17

File hashes

Hashes for metagame-0.4.17-py3-none-any.whl
Algorithm Hash digest
SHA256 ab46c9bb94b805ca6da57f719d9c1fea985afd1bd5869a0f3b2cf6beadbf18e7
MD5 e8e6e05b73adc9ec3b964e681ebceed7
BLAKE2b-256 bb9a4ffc3838237066e796c02553aae8e8ca9090b54e425ede9609747bf77818

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