{"id":13508609,"url":"https://github.com/roq-trading/roq-cpp-samples","last_synced_at":"2025-04-04T17:09:35.656Z","repository":{"id":45766544,"uuid":"126928065","full_name":"roq-trading/roq-cpp-samples","owner":"roq-trading","description":"C++ examples.","archived":false,"fork":false,"pushed_at":"2025-03-28T13:25:06.000Z","size":10687,"stargazers_count":161,"open_issues_count":0,"forks_count":55,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-28T16:11:09.505Z","etag":null,"topics":["api","cpp23","demo","example"],"latest_commit_sha":null,"homepage":"https://roq-trading.com/","language":"C++","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roq-trading.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-27T04:19:09.000Z","updated_at":"2025-03-28T13:25:10.000Z","dependencies_parsed_at":"2024-01-10T05:30:12.432Z","dependency_job_id":"43ae2d5e-b872-4a9d-ad94-fdb56080b4e4","html_url":"https://github.com/roq-trading/roq-cpp-samples","commit_stats":null,"previous_names":["roq-trading/roq-cpp-samples","roq-trading/roq-samples"],"tags_count":70,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roq-trading%2Froq-cpp-samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roq-trading%2Froq-cpp-samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roq-trading%2Froq-cpp-samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roq-trading%2Froq-cpp-samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roq-trading","download_url":"https://codeload.github.com/roq-trading/roq-cpp-samples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217221,"owners_count":20903009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","cpp23","demo","example"],"created_at":"2024-08-01T02:00:55.595Z","updated_at":"2025-04-04T17:09:35.632Z","avatar_url":"https://github.com/roq-trading.png","language":"C++","readme":"# roq-cpp-samples\n\nSamples demonstrating how to implement various features of algorithmic trading\nsolutions.\n\n\n## Operating Systems\n\n* Linux (x86-64, AArch64)\n* macOS (x86-64, Arm64)\n\n\n## Library/Package Dependencies\n\n* [Abseil-C++](https://github.com/abseil/abseil-cpp) (Apache 2.0 License)\n* [FlatBuffers](https://github.com/google/flatbuffers) (Apache 2.0 License)\n* [fmt](https://github.com/fmtlib/fmt) (MIT License)\n* [roq-api](https://github.com/roq-trading/roq-api) (MIT License)\n* [roq-logging](https://github.com/roq-trading/roq-api) (MIT License)\n* roq-web (Commerical License, free to use)\n* roq-client (Commerical License, free to use)\n\nOptional\n\n* [Catch2](https://github.com/catchorg/Catch2) (Boost Software License 1.0 License)\n* [Google Benchmark](https://github.com/google/benchmark) (Apache 2.0 License)\n\n\n## Prerequisites\n\nThe project is primarily designed to be compatible with the conda package manager.\n\n\u003e Use `stable` for (the approx. monthly) release build.\n\u003e Use `unstable` for the more regularly updated development builds.\n\n### Initialize sub-modules\n\n```bash\ngit submodule update --init --recursive\n```\n\n### Create development environment\n\n```bash\nscripts/create_conda_env unstable debug\n```\n\n### Activate environment\n\n```bash\nsource opt/conda/bin/activate dev\n```\n\n## Building\n\n\u003e Sometimes you may need to delete CMakeCache.txt if CMake has cached an incorrect configuration.\n\n```bash\ncmake . \u0026\u0026 make -j4\n```\n\n\n## Using\n\n* [Example 1](./src/roq/samples/example-1/README.md)\n  * Connect to market gateway\n  * Subscribe using regex patterns\n* [Example 2](./src/roq/samples/example-2/README.md)\n  * Manage disconnect\n  * Process incremental market data update\n  * Maintain a market depth view\n  * Update a simple model\n* [Example 3](./src/roq/samples/example-3/README.md)\n  * Maintain positions\n  * Place limit orders\n  * Deal with order acks and updates\n  * Historical simulation\n  * Live trading\n* [Example 4](./src/roq/samples/example-4/README.md)\n  * Subscribe and nothing else\n* [Example 5](./src/roq/samples/example-5/README.md)\n  * Transfer `CustomMessage` from a secondary thread\n* [Import](./src/roq/samples/import/README.md)\n  * Convert any data source to an event-log\n  * Encoding has header-only dependencies\n\n\n### Simulation Data (install)\n\nSimulation requires you to either use your own event logs (automatically\ncaptured when you're running a gateway) or use sample data\n\n```bash\nconda install -y --channel https://roq-trading.com/conda/unstable \\\n    roq-data\n```\n\nData can now be found in the `$CONDA_PREFIX/share/roq-data/` directory.\n\n\n### Gateways (install, configure, run)\n\n\n#### [Deribit](https://roq-trading.com/docs/reference/gateways/roq-deribit/)\n\n```bash\nconda install -y --channel https://roq-trading.com/conda/unstable \\\n    roq-deribit\n```\n\nIt is easiest to start from a config file template\n\n```bash\ncp $CONDA_PREFIX/share/roq-deribit/config.toml ~/deribit.toml\n```\n\nEdit this file and update with your Deribit API credentials\n([link](https://test.deribit.com/main#/account?scrollTo=api)).\n\nYou should look for these lines and replace as appropriate\n\n```text\nlogin = \"YOUR_DERIBIT_LOGIN_GOES_HERE\"\nsecret = \"YOUR_DERIBIT_SECRET_GOES_HERE\"\n```\n\nLaunch the gateway\n\n```bash\nroq-deribit \\\n    --name \"deribit\" \\\n    --config_file ~/deribit.toml \\\n    --client_listen_address ~/deribit.sock\n```\n\n#### [Coinbase Pro](https://roq-trading.com/docs/reference/gateways/roq-coinbase-pro/)\n\n```bash\nconda install -y --channel https://roq-trading.com/conda/unstable \\\n    roq-coinbase-pro\n```\n\nIt is easiest to start from a config file template\n\n```bash\ncp $CONDA_PREFIX/share/roq-coinbase-pro/config.toml ~/coinbase-pro.toml\n```\n\nEdit this file and update with your Coinbase Pro API credentials\n([link](https://public.sandbox.pro.coinbase.com/profile/api)).\n\nYou should look for these lines and replace as appropriate\n\n```text\nlogin = \"YOUR_COINBASE_PRO_API_KEY_GOES_HERE\"\npassword = \"YOUR_COINBASE_PRO_PASSPHRASE_GOES_HERE\"\nsecret = \"YOUR_COINBASE_PRO_SECRET_GOES_HERE\"\n```\n\nLaunch the gateway\n\n```bash\nroq-coinbase-pro \\\n    --name \"coinbase-pro\" \\\n    --config_file ~/coinbase-pro.toml \\\n    --client_listen_address ~/coinbase-pro.sock\n```\n\n## License\n\nThe project is released under the terms of the BSD 3-Clause license.\n\n\n## Links\n\n* [Roq GmbH](https://roq-trading.com/)\n* [Documentation](https://roq-trading.com/docs/)\n* [Contact us](mailto:info@roq-trading.com)\n","funding_links":[],"categories":["C++","api"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froq-trading%2Froq-cpp-samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froq-trading%2Froq-cpp-samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froq-trading%2Froq-cpp-samples/lists"}