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/arbiter && cd arbiter/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, then copy the ACT_AS into .env
  6. Set API_URL to the base server URL (e.g. https://trading-bootcamp.fly.dev)
  7. Optionally set COHORT to the cohort name you want to connect to. If omitted, the cohort is auto-detected from your memberships: if you belong to exactly one cohort it's picked automatically; otherwise (zero or multiple memberships) the client raises ValueError and you must set COHORT explicitly.

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 also use list_cohorts() to discover available cohorts programmatically:

from metagame import list_cohorts
info = list_cohorts("https://trading-bootcamp.fly.dev", jwt)
print(info["cohorts"])  # Available cohorts

You can figure out the Jupyter Notebook if you wish.

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.8.7.tar.gz (192.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.8.7-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for metagame-0.8.7.tar.gz
Algorithm Hash digest
SHA256 b9f18c9abdc4d840cb698619856fad98bd148ec4383ab011ea796207e2e03425
MD5 d6382c619bcd0b0cc83a9b92186482f4
BLAKE2b-256 31ed373050914c1d0ddd44f4c63920fd038f30f051a65b8e8cff100d4183a535

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for metagame-0.8.7-py3-none-any.whl
Algorithm Hash digest
SHA256 86945301aa73cc18bfee34b9a7affc8a070e51959296968c92585b08192e01a3
MD5 a4786f73528f38056c909b5b82d25c04
BLAKE2b-256 40c81ef2ae8fb21a78c5d0c81640d36ce04d003803d0da1ed7eb827ffdad0da7

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