{"id":25452815,"url":"https://github.com/yllvar/brownian-market-maker","last_synced_at":"2025-10-09T13:11:38.965Z","repository":{"id":248885553,"uuid":"830080258","full_name":"yllvar/Brownian-Market-Maker","owner":"yllvar","description":"Adapting Avellaneda \u0026 Stoikov market making using ccxt for KuCoin","archived":false,"fork":false,"pushed_at":"2024-07-17T15:05:43.000Z","size":12,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-10T03:25:34.390Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yllvar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-07-17T14:48:23.000Z","updated_at":"2025-07-28T08:45:33.000Z","dependencies_parsed_at":"2024-07-17T18:40:00.818Z","dependency_job_id":null,"html_url":"https://github.com/yllvar/Brownian-Market-Maker","commit_stats":null,"previous_names":["yllvar/brownian-market-maker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yllvar/Brownian-Market-Maker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yllvar%2FBrownian-Market-Maker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yllvar%2FBrownian-Market-Maker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yllvar%2FBrownian-Market-Maker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yllvar%2FBrownian-Market-Maker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yllvar","download_url":"https://codeload.github.com/yllvar/Brownian-Market-Maker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yllvar%2FBrownian-Market-Maker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001543,"owners_count":26083102,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-02-17T23:41:42.430Z","updated_at":"2025-10-09T13:11:38.919Z","avatar_url":"https://github.com/yllvar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Brownian-Market-Maker\nAdapting Avellaneda \u0026amp; Stoikov market making using ccxt for KuCoin\n\nInfluced by this repo: https://github.com/fedecaccia/avellaneda-stoikov\n\n# Avellaneda-Stoikov Market Making Simulation\n\nThis project implements a simulation of high-frequency trading using the Avellaneda-Stoikov market-making model. The simulation utilizes Brownian motion to model stock price dynamics and implements market-making strategies to manage inventory and optimize profit.\n\n## Components\n\n### 1. `main.py`\n\nThis is the main script that orchestrates the simulation. It initializes the market maker, simulates trading scenarios, and visualizes the results using Matplotlib.\n\n### 2. `brownian.py`\n\nContains the implementation of the Brownian motion simulation, which is essential for modeling stock price movements over time.\n\n### 3. `brownian_path.py`\n\nProvides an example of generating a single realization of Brownian motion and plotting it using Matplotlib. This can be useful for understanding the stochastic process used in the simulation.\n\n### 4. `requirements.txt`\n\nLists all the Python libraries and their versions required to run the project. Use `pip install -r requirements.txt` to install them.\n\n## Installation\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/your_username/avellaneda-stoikov-market-making.git\n   cd avellaneda-stoikov-market-making\n   ```\n\n2. Install dependencies:\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n## Usage\n\n### Running the Simulation\n\nTo run the simulation with default settings (symbol: BTC/USDT, 100 simulations):\n\n```bash\npython main.py\n```\n\n### Customizing the Simulation\n\nYou can customize the simulation by modifying parameters in `main.py`:\n\n- Adjust `n_sim` in `simulate()` method to change the number of simulations.\n- Modify parameters such as `sigma`, `T`, `N`, `dt`, `gamma`, `k` in the `simulate()` method to explore different scenarios.\n\n### Visualizing Brownian Motion\n\nTo visualize a single realization of Brownian motion:\n\n```bash\npython brownian_path.py\n```\n\nThis will plot the path of Brownian motion over a specified time interval.\n\n## Results\n\nThe simulation results include:\n\n- Final inventory held\n- Last price observed\n- Cash balance\n- Final wealth (cash + inventory value)\n- Maximum and minimum inventory held during the simulation\n- Average and standard deviation of Profit and Loss (PnL) across simulations\n\n## Parameters\n\nThe parameters used in the simulations can be found and adjusted in `main.py`. These include:\n\n- `sigma`: Volatility of the stock\n- `T`: Total time period of simulation\n- `N`: Number of steps in the simulation\n- `dt`: Time step size\n- `gamma`: Risk factor influencing bid/ask spread\n- `k`: Market model parameter influencing intensity of order placement\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Acknowledgments\n\n- Federico Caccia https://github.com/fedecaccia/avellaneda-stoikov\n- Marco Avellaneda \u0026 Sasha Stoikov for their pioneering work on market making models.\n- Open-source libraries: CCXT, NumPy, Matplotlib, and SciPy and ChatGPT \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyllvar%2Fbrownian-market-maker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyllvar%2Fbrownian-market-maker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyllvar%2Fbrownian-market-maker/lists"}