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, 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 server's default cohort is used.

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
print(info["default_cohort"])  # Server default cohort name

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.5.1.tar.gz (128.1 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.5.1-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: metagame-0.5.1.tar.gz
  • Upload date:
  • Size: 128.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for metagame-0.5.1.tar.gz
Algorithm Hash digest
SHA256 0d34f87a63959cdc0af22463983a72cf3877cb64869514264bc828f5c5b03663
MD5 756855f552d45d1a7e5eab41fe003c65
BLAKE2b-256 07d8af8cea793791af98b806dc9382e4aadeb644401fec5dc5528b7733d40bae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metagame-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for metagame-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 574a69dd672ac1a71abbbc0554db80e24b728f0aeec1fc7411c6ed9d9fc8f47d
MD5 2b2d936ea2064c68863664e3dd2e145a
BLAKE2b-256 c10bdfb25f73a1df505113d682f66a70d69e1a62d729bcb99489d9d89e80d733

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