Contributing to tradedesk¶
We welcome contributions to tradedesk. This guide covers the standards and
workflow you need to contribute successfully.
Getting Started¶
- Fork the repository and create a feature branch from
main. - Clone locally and install the dev dependencies:
- We use
uvfor dependency management. If you haveuvinstalled you can use it directly:
- Install the pre-commit hooks. These run
ruff-formatand a guard that blocks private strategy research from being committed to this public repo (paths underresearch/,killstack/, or anything containingprivate):
The guard script lives at scripts/hooks/block-private-research.sh and is
also runnable on demand against the staged tree. If a commit is rejected
with Blocked: private research content detected — commit to ig_trader
instead, the listed files belong in the private ig_trader repo, not here.
Code Standards¶
Python Version¶
Python 3.11+ is required.
Style and Linting¶
We use ruff for linting and formatting:
Rules enforced: E, F, I (import sorting), TID (tidy imports).
Line length is 100 characters.
Type Checking¶
We use mypy in strict mode:
All contributions must pass with zero type errors.
Import Conventions¶
Cross-domain imports must use top-level re-exports. For example, code in
tradedesk.execution should import from tradedesk.marketdata, never from
tradedesk.marketdata.events. Classes and functions intended for use outside
their domain must be explicitly exported in __init__.py.
Testing¶
We use pytest:
- All new and existing tests must pass following any code change.
- Include tests for new functionality or bug fixes.
- Code coverage must not decrease.
Credentials and Release Automation¶
Local development, CI, and backtests do not require repository secrets.
Live IG execution uses environment variables read by
tradedesk.execution.ig.settings.Settings:
IG_API_KEY(required)IG_USERNAME(required)IG_PASSWORD(required)IG_ENVIRONMENT(optional, defaults toDEMO; must beDEMOorLIVE)
Do not commit real IG values in examples, shell history snippets, or tests. The
library negotiates the short-lived IG session headers (CST and
X-SECURITY-TOKEN) during authentication, so contributors should not try to
store or configure those manually.
Maintainers triggering .github/workflows/prepare-release.yml must configure
these repository secrets:
RELEASE_APP_IDRELEASE_APP_PRIVATE_KEY
The shared reusable release workflow uses those values to mint a GitHub App
token for checkout, version bumping, pushing the release commit, and creating
the GitHub release. .github/workflows/publish.yml uses PyPI trusted
publishing via GitHub OIDC (id-token: write), so no PyPI API token secret is
expected in this repository.
Pull Requests¶
- Keep changes small, well-scoped, and documented in PR descriptions.
- Open PRs against
main. - Rebase your branch onto
mainbefore submitting — we do not use merge commits. - Provide a brief rationale and expected impact in the PR description.
- Do not include secrets or internal data.
Commit Messages¶
Follow Conventional Commits:
feat(strategy): add trailing stop support
fix(portfolio): correct position sizing on partial fills
docs: update backtesting guide
Reporting Issues¶
If you find a bug or have a feature request, open an issue describing the goal and expected behaviour. Include steps to reproduce for bugs.
If unsure, open an issue describing the goal and request guidance before implementing.
License¶
Licensed under the Apache License, Version 2.0. See: https://www.apache.org/licenses/LICENSE-2.0
Copyright 2026 Radius Red Ltd. | Contact