Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Default owner for everything in the repo.
# Later matches take precedence over earlier ones.
* @chizy7
26 changes: 26 additions & 0 deletions .github/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Getting Help with PinnacleMM

Thanks for using PinnacleMM! Here's how to get help:

## Documentation

Start with the docs — most questions are covered there:

- [Getting Started Guide](../docs/user_guide/getting_started.md)
- [System Architecture](../docs/architecture/system_overview.md)
- [API Reference](../docs/api/reference.md)
- [Full documentation index](../README.md#documentation)

## Questions and Bug Reports

- **Bugs**: open an issue using the [bug report template](https://github.com/chizy7/PinnacleMM/issues/new?template=bug_report.md)
- **Feature ideas**: use the [feature request template](https://github.com/chizy7/PinnacleMM/issues/new?template=feature_request.md)
- **General questions**: open an issue, or email [chizy@chizyhub.com](mailto:chizy@chizyhub.com)

## Security Issues

**Do not open a public issue.** Please follow the [security policy](SECURITY.md) to report vulnerabilities privately.

## Contributing

Want to fix it yourself? See the [Contributing Guide](../CONTRIBUTING.md).
83 changes: 83 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Contributor Covenant 3.0 Code of Conduct

## Our Pledge

We pledge to make our community welcoming, safe, and equitable for all.

We are committed to fostering an environment that respects and promotes the dignity, rights, and contributions of all individuals, regardless of characteristics including race, ethnicity, caste, color, age, physical characteristics, neurodiversity, disability, sex or gender, gender identity or expression, sexual orientation, language, philosophy or religion, national or social origin, socio-economic position, level of education, or other status. The same privileges of participation are extended to everyone who participates in good faith and in accordance with this Covenant.

## Encouraged Behaviors

While acknowledging differences in social norms, we all strive to meet our community's expectations for positive behavior. We also understand that our words and actions may be interpreted differently than we intend based on culture, background, or native language.

With these considerations in mind, we agree to behave mindfully toward each other and act in ways that center our shared values, including:

1. Respecting the **purpose of our community**, our activities, and our ways of gathering.
2. Engaging **kindly and honestly** with others.
3. Respecting **different viewpoints** and experiences.
4. **Taking responsibility** for our actions and contributions.
5. Gracefully giving and accepting **constructive feedback**.
6. Committing to **repairing harm** when it occurs.
7. Behaving in other ways that promote and sustain the **well-being of our community**.

## Restricted Behaviors

We agree to restrict the following behaviors in our community. Instances, threats, and promotion of these behaviors are violations of this Code of Conduct.

1. **Harassment.** Violating explicitly expressed boundaries or engaging in unnecessary personal attention after any clear request to stop.
2. **Character attacks.** Making insulting, demeaning, or pejorative comments directed at a community member or group of people.
3. **Stereotyping or discrimination.** Characterizing anyone's personality or behavior on the basis of immutable identities or traits.
4. **Sexualization.** Behaving in a way that would generally be considered inappropriately intimate in the context or purpose of the community.
5. **Violating confidentiality**. Sharing or acting on someone's personal or private information without their permission.
6. **Endangerment.** Causing, encouraging, or threatening violence or other harm toward any person or group.
7. Behaving in other ways that **threaten the well-being** of our community.

### Other Restrictions

1. **Misleading identity.** Impersonating someone else for any reason, or pretending to be someone else to evade enforcement actions.
2. **Failing to credit sources.** Not properly crediting the sources of content you contribute.
3. **Promotional materials**. Sharing marketing or other commercial content in a way that is outside the norms of the community.
4. **Irresponsible communication.** Failing to responsibly present content which includes, links or describes any other restricted behaviors.

## Reporting an Issue

Tensions can occur between community members even when they are trying their best to collaborate. Not every conflict represents a code of conduct violation, and this Code of Conduct reinforces encouraged behaviors and norms that can help avoid conflicts and minimize harm.

When an incident does occur, it is important to report it promptly. To report a possible violation, email the project maintainer at **[chizy@chizyhub.com](mailto:chizy@chizyhub.com)**. All reports will be handled with discretion and confidentiality.

Community Moderators take reports of violations seriously and will make every effort to respond in a timely manner. They will investigate all reports of code of conduct violations, reviewing messages, logs, and recordings, or interviewing witnesses and other participants. Community Moderators will keep investigation and enforcement actions as transparent as possible while prioritizing safety and confidentiality. In order to honor these values, enforcement actions are carried out in private with the involved parties, but communicating to the whole community may be part of a mutually agreed upon resolution.
Comment thread
coderabbitai[bot] marked this conversation as resolved.

## Addressing and Repairing Harm

If an investigation by the Community Moderators finds that this Code of Conduct has been violated, the following enforcement ladder may be used to determine how best to repair harm, based on the incident's impact on the individuals involved and the community as a whole. Depending on the severity of a violation, lower rungs on the ladder may be skipped.

1. Warning
1. Event: A violation involving a single incident or series of incidents.
2. Consequence: A private, written warning from the Community Moderators.
3. Repair: Examples of repair include a private written apology, acknowledgement of responsibility, and seeking clarification on expectations.
2. Temporarily Limited Activities
1. Event: A repeated incidence of a violation that previously resulted in a warning, or the first incidence of a more serious violation.
2. Consequence: A private, written warning with a time-limited cooldown period designed to underscore the seriousness of the situation and give the community members involved time to process the incident. The cooldown period may be limited to particular communication channels or interactions with particular community members.
3. Repair: Examples of repair may include making an apology, using the cooldown period to reflect on actions and impact, and being thoughtful about re-entering community spaces after the period is over.
3. Temporary Suspension
1. Event: A pattern of repeated violation which the Community Moderators have tried to address with warnings, or a single serious violation.
2. Consequence: A private written warning with conditions for return from suspension. In general, temporary suspensions give the person being suspended time to reflect upon their behavior and possible corrective actions.
3. Repair: Examples of repair include respecting the spirit of the suspension, meeting the specified conditions for return, and being thoughtful about how to reintegrate with the community when the suspension is lifted.
4. Permanent Ban
1. Event: A pattern of repeated code of conduct violations that other steps on the ladder have failed to resolve, or a violation so serious that the Community Moderators determine there is no way to keep the community safe with this person as a member.
2. Consequence: Access to all community spaces, tools, and communication channels is removed. In general, permanent bans should be rarely used, should have strong reasoning behind them, and should only be resorted to if working through other remedies has failed to change the behavior.
3. Repair: There is no possible repair in cases of this severity.

This enforcement ladder is intended as a guideline. It does not limit the ability of Community Moderators to use their discretion and judgment, in keeping with the best interests of our community.

## Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public or other spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## Attribution

This Code of Conduct is adapted from the Contributor Covenant, version 3.0, permanently available at [https://www.contributor-covenant.org/version/3/0/](https://www.contributor-covenant.org/version/3/0/).

Contributor Covenant is stewarded by the Organization for Ethical Source and licensed under CC BY-SA 4.0. To view a copy of this license, visit [https://creativecommons.org/licenses/by-sa/4.0/](https://creativecommons.org/licenses/by-sa/4.0/)

For answers to common questions about Contributor Covenant, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are provided at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations). Additional enforcement and community guideline resources can be found at [https://www.contributor-covenant.org/resources](https://www.contributor-covenant.org/resources). The enforcement ladder was inspired by the work of [Mozilla's code of conduct team](https://github.com/mozilla/inclusion).
162 changes: 162 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Contributing to PinnacleMM

Thank you for your interest in contributing to PinnacleMM! This document explains how to set up your development environment, the conventions the project enforces in CI, and how to get your changes merged.

By participating in this project, you agree to abide by our [Code of Conduct](CODE_OF_CONDUCT.md).

## Ways to Contribute

- **Report bugs** using the [bug report template](https://github.com/chizy7/PinnacleMM/issues/new?template=bug_report.md)
- **Request features** using the [feature request template](https://github.com/chizy7/PinnacleMM/issues/new?template=feature_request.md)
- **Report security vulnerabilities** privately — see [SECURITY.md](.github/SECURITY.md). **Never open a public issue for a security vulnerability.**
- **Improve documentation** — guides live in [`docs/`](docs/)
- **Submit code** — bug fixes, performance improvements, new strategies, exchange connectors, and tests are all welcome. Check the [Roadmap](docs/ROADMAP.md) for planned work and good areas to help.

For large changes, please open an issue first to discuss the approach before investing significant time.

## Development Setup

### Prerequisites

- C++20 compatible compiler (GCC 10+, Clang 10+, or MSVC 2019+)
- CMake 3.14+
- Boost libraries 1.72+
- OpenSSL
- nlohmann_json
- Google Test and Google Benchmark (for tests and benchmarks)
- Python 3 with `pre-commit` (for the git hooks — see below)

spdlog and fmt are auto-downloaded at pinned versions if not installed locally.

On macOS:

```bash
brew install cmake boost openssl nlohmann-json googletest google-benchmark pre-commit
```

On Ubuntu/Debian:

```bash
sudo apt-get install -y cmake build-essential libboost-all-dev libssl-dev \
nlohmann-json3-dev libgtest-dev libbenchmark-dev
pip install pre-commit
```

### Build and Test

```bash
# Fork the repo on GitHub, then:
git clone https://github.com/<your-username>/PinnacleMM.git
cd PinnacleMM

# Build (auto-checks dependencies)
scripts/run-native.sh build

# Run the full test suite
scripts/run-native.sh test

# Run performance benchmarks
scripts/run-native.sh benchmark
```

Or manually:

```bash
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON -DBUILD_BENCHMARKS=ON ..
make -j$(nproc || sysctl -n hw.ncpu)
```

For memory-safety validation during development, build with sanitizers:

```bash
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_SANITIZERS=ON .. && make -j8
```

Note that CI builds with AddressSanitizer enabled, so memory errors will fail your PR even if they don't crash locally.

## Pre-commit Hooks (Required)

The project uses [pre-commit](https://pre-commit.com/) to enforce formatting and linting. Install the hooks once after cloning:

```bash
pre-commit install
```

After this, every `git commit` automatically runs:

- **clang-format** (v17, using the repo's `.clang-format`) on C/C++ files
- **cmake-format** on CMake files
- **hadolint** on Dockerfiles
- **shellcheck** on shell scripts
- General checks: trailing whitespace, end-of-file newlines, YAML validity, merge-conflict markers, large files, line endings

If a hook fails, the commit is aborted. Formatting hooks fix the files in place — just `git add` the fixed files and commit again. To run all hooks against the whole repo manually:

```bash
pre-commit run --all-files
```

CI runs the same hooks on every PR (`.github/workflows/pre-commit.yml`), so skipping local installation just means you find out later.

## Coding Guidelines

- **C++20**, matching the style of the surrounding code
- Formatting is defined by `.clang-format` — don't hand-format; let the hook do it
- This is an ultra-low latency system: on hot paths, avoid allocations, locks, and exceptions; prefer lock-free structures and `std::atomic` consistent with the existing core engine
- Add unit tests (Google Test) for new functionality; add benchmarks (Google Benchmark) for performance-sensitive changes
- Update the relevant docs in `docs/` when behavior or interfaces change

## Commit Messages and PR Titles

PR titles **must** follow [Conventional Commits](https://www.conventionalcommits.org/) — this is enforced by CI (`pr-title-lint.yml`) and PRs with non-conforming titles cannot merge:

```text
<type>(<optional scope>): <subject>
```

- Allowed types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`
- The subject must start with a **lowercase** letter
- The full header must be at most 100 characters

Examples:

```text
feat(strategy): add inventory-skew quoting to basic market maker
fix(exchange): handle coinbase websocket reconnect race
perf(core): reduce order book update latency with arena allocator
```

Using the same convention for individual commit messages is encouraged (PRs are typically squash-merged using the PR title).

## Pull Request Process

1. Create a topic branch from `main` in your fork
2. Make your changes, with tests
3. Run locally before pushing:
- `pre-commit run --all-files`
- `scripts/run-native.sh test`
4. Open a PR against `main` and fill out the PR template completely
5. Make sure CI passes. On every PR, CI runs:
- **Build and Test** on Ubuntu and macOS, Debug and Release, with AddressSanitizer
- **Performance benchmarks** (Release builds)
- **Pre-commit hooks** (formatting/linting)
- **PR title lint** (conventional commit format)
- **Docker build test**
6. Address review feedback; a maintainer will merge once approved

## Performance Expectations

PinnacleMM targets microsecond-level latency. If your change touches the core engine, order book, or execution paths:

- Run the relevant benchmarks before and after (`scripts/run-native.sh benchmark`)
- Include the numbers in your PR description
- Regressions on hot paths need a strong justification

## Questions?

- Check the [documentation](docs/) and [Getting Started Guide](docs/user_guide/getting_started.md) first
- Open a [discussion or issue](https://github.com/chizy7/PinnacleMM/issues)
- Contact the maintainer: [chizy@chizyhub.com](mailto:chizy@chizyhub.com)

Thank you for contributing!
Loading
Loading