{"id":19553592,"url":"https://github.com/quantconnect/lean.brokerages.coinbase","last_synced_at":"2025-07-05T06:34:46.927Z","repository":{"id":58473480,"uuid":"472838340","full_name":"QuantConnect/Lean.Brokerages.Coinbase","owner":"QuantConnect","description":"Coinbase Pro brokerage template","archived":false,"fork":false,"pushed_at":"2025-04-03T21:24:15.000Z","size":195,"stargazers_count":4,"open_issues_count":6,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-04T18:01:45.029Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/QuantConnect.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2022-03-22T16:01:12.000Z","updated_at":"2024-12-19T17:05:30.000Z","dependencies_parsed_at":"2024-02-08T22:03:54.753Z","dependency_job_id":"a13ac63c-7a18-46c2-9fc3-dea8dec0c758","html_url":"https://github.com/QuantConnect/Lean.Brokerages.Coinbase","commit_stats":null,"previous_names":["quantconnect/lean.brokerages.coinbase"],"tags_count":1466,"template":false,"template_full_name":"QuantConnect/Lean.Brokerages.Template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantConnect%2FLean.Brokerages.Coinbase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantConnect%2FLean.Brokerages.Coinbase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantConnect%2FLean.Brokerages.Coinbase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantConnect%2FLean.Brokerages.Coinbase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QuantConnect","download_url":"https://codeload.github.com/QuantConnect/Lean.Brokerages.Coinbase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251051552,"owners_count":21528788,"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":[],"created_at":"2024-11-11T04:23:58.061Z","updated_at":"2025-04-26T20:32:07.376Z","avatar_url":"https://github.com/QuantConnect.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"![header-cheetah](https://user-images.githubusercontent.com/79997186/184224088-de4f3003-0c22-4a17-8cc7-b341b8e5b55d.png)\n\n\u0026nbsp;\n\u0026nbsp;\n\u0026nbsp;\n\n## Introduction\n\nThis repository hosts the CoinbasePro Brokerage Plugin Integration with the QuantConnect LEAN Algorithmic Trading Engine. LEAN is a brokerage agnostic operating system for quantitative finance. Thanks to open-source plugins such as this [LEAN](https://github.com/QuantConnect/Lean) can route strategies to almost any market.\n\n[LEAN](https://github.com/QuantConnect/Lean) is maintained primarily by [QuantConnect](https://www.quantconnect.com), a US based technology company hosting a cloud algorithmic trading platform. QuantConnect has successfully hosted more than 200,000 live algorithms since 2015, and trades more than $1B volume per month.\n\n### About Coinbase Pro\n\n\u003cp align=\"center\"\u003e\n\u003cpicture \u003e\n \u003csource srcset=\"https://user-images.githubusercontent.com/79997186/188237467-b952a56a-c97c-4b55-b36c-290b560c61f1.png\"\u003e\n \u003cimg alt=\"coinbase\" width=\"30%\"\u003e\n\u003c/picture\u003e\n\u003cp\u003e\n\n[Coinbase](https://www.coinbase.com/) was founded by Brian Armstrong and Fred Ehrsam in 2012 with the goal to \"increase economic freedom in the world\". Coinbase Pro provides access to trading Crypto for clients in over [100 countries](https://www.coinbase.com/places) with no minimum deposit. Coinbase Pro also provides a self-hosted Crypto wallet, a Visa debit rewards card, and Bitcoin collateral-backed lines of credit.\n\nFor more information about the Coinbase Pro brokerage, see the [QuantConnect-Coinbase Pro Integration Page](https://www.quantconnect.com/docs/v2/our-platform/live-trading/brokerages/coinbase-pro).\n\n\n## Using the Brokerage Plugin\n  \n### Deploying Coinbase Pro with VSCode User Interace\n\n  You can deploy using a visual interface in the QuantConnect Cloud. For more information see the [QuantConnect-CoinbasePro Integration Page](https://www.quantconnect.com/brokerages/coinbasepro).\n\n ![deploy-coinbase](https://user-images.githubusercontent.com/38889814/188244653-4feb1f60-d693-4dde-b47b-009dc3295a27.gif)\n \n  In the QuantConnect Cloud Platform you can harness the QuantConnect Live Data Feed. For most users this is substantially cheaper and easier than self-hosting.\n  \n### Deploying Coinbase Pro with LEAN CLI\n\nFollow these steps to start local live trading with the Coinbase Pro brokerage:\n\n1.  Open a terminal in your [CLI root directory](https://www.quantconnect.com/docs/v2/lean-cli/initialization/directory-structure#02-lean-init).\n2.  Run `lean live \"\u003cprojectName\u003e`\" to start a live deployment wizard for the project in ./`\u003cprojectName\u003e` and then enter the brokerage number.\n\n    ```\n    $ lean live 'My Project'\n     \n    Select a brokerage:\n    1. Paper Trading\n    2. Interactive Brokers\n    3. Tradier\n    4. OANDA\n    5. Bitfinex\n    6. Coinbase Pro\n    7. Binance\n    8. Zerodha\n    9. Samco\n    10. Terminal Link\n    11. Atreyu\n    12. Trading Technologies\n    13. Kraken\n    14. FTX\n    Enter an option: \n    ```\n  \n3.  Enter the number of the organization that has a subscription for the Coinbase Pro module.\n\n    ```\n    $ lean live \"My Project\"\n\n    Select the organization with the Coinbase Pro module subscription:\n    1. Organization 1\n    2. Organization 2\n    3. Organization 3\n       Enter an option: 1\n    ```\n\n4.  Enter the environment to use.\n\n    ```\n    $ lean live \"My Project\"\n\n    Use sandbox? (live, paper): live\n    ```\n\n5.  Enter your API key, API secret.\n\n    ``` \n    $ lean live \"My Project\"\n\n    API key: 6d3ef5ca2d2fa52e4ee55624b0471261\n    API secret: ****************************************************************************************\n    ```\n\n    To create new API credentials, see the [API settings page](https://pro.coinbase.com/profile/api) on the Coinbase Pro website.\n\n\n6.  Enter the number of the data feed to use and then follow the steps required for the data connection.\n\n    ``` \n    $ lean live 'My Project'\n\n    Select a data feed:\n    1. Interactive Brokers\n    2. Tradier\n    3. Oanda\n    4. Bitfinex\n    5. Coinbase Pro\n    6. Binance\n    7. Zerodha\n    8. Samco\n    9. Terminal Link\n    10. Trading Technologies\n    11. Kraken\n    12. FTX\n    13. IQFeed\n    14. Polygon Data Feed\n    15. Custom Data Only\n  \n        To enter multiple options, separate them with comma:\n    ```\n\nIf you select Polygon Data Feed, see [Polygon](https://www.quantconnect.com/docs/v2/lean-cli/live-trading/other-data-feeds/polygon) for set up instructions.\n\n1. View the result in the `\u003cprojectName\u003elive\u003ctimestamp\u003e` directory. Results are stored in real-time in JSON format. You can save results to a different directory by providing the `--output \u003cpath\u003e` option in step 2.\n\nIf you already have a live environment configured in your [Lean configuration file](https://www.quantconnect.com/docs/v2/lean-cli/initialization/configuration#03-Lean-Configuration), you can skip the interactive wizard by providing the `--environment \u003cvalue\u003e` option in step 2. The value of this option must be the name of an environment which has `live-mode` set to true.\n\n## Account Types\n\nCoinbase Pro supports cash accounts.\n\n## Order Types and Asset Classes\n\nCoinbase Pro supports trading crypto and the following order types:\n\n- Market Order\n- Limit Order\n- Stop-Limit Order\n\n\n## Downloading Data\n\nFor local deployment, the algorithm needs to download the following dataset:\n\n[Coinbase Pro Crypto Price Data](https://www.quantconnect.com/datasets/coinbase-pro-crypto-price-data)  \n\n\n## Brokerage Model\n\nLean models the brokerage behavior for backtesting purposes. The margin model is used in live trading to avoid placing orders that will be rejected due to insufficient buying power.\n\nYou can set the Brokerage Model with the following statements\n\n    SetBrokerageModel(BrokerageName.Coinbase, AccountType.Cash);\n\n[Read Documentation](https://www.quantconnect.com/docs/v2/our-platform/live-trading/brokerages/coinbase-pro)\n\n### Fees\n\nWe model the order fees of Coinbase Pro at the $50K-100K pricing tier for all Crypto pairs, which is a 0.60% maker and taker 0.80% fee for most pairs. The following table shows the Coinbase Pro Stable Pairs, which charge a 0% maker fee and a 0.001% taker fee:\n|||||\n|:----:|:----:|:----:|:----:|\n|DAIUSDC|DAIUSD|GYENUSD|PAXUSD|\n|PAXUSDT|MUSDUSD|USDCEUR|USDCGBP|\n|USDTEUR|USDTGBP|USDTUSD|USDTUSDC|\n|USTEUR|USTUSD|USTUSDT|WBTCBTC|\n\nIf you add liquidity to the order book by placing a limit order that doesn't cross the spread, you pay maker fees. If you remove liquidity from the order book by placing an order that crosses the spread, you pay taker fees. Coinbase Pro adjusts your fees based on your 30-day trading volume, but we don't currently model trading volume to adjust fees.\n\nWe model the adjustments Coinbase Pro has made to their fees over time. The following table shows the fees for each time period:\n|Time Period (UTC)|Maker Fee (%)|Taker Fee (%)|\n|----:|----:|----:|\n|Time \u003c 3/23/2019 1:30AM|0|0.3|\n|3/23/2019 1:30AM \u003c= Time \u003c 10/8/2019 12:30AM|0.15|0.25|\n|10/8/2019 12:30AM \u003c= Time \u003c 12/21/2023 1:00 AM|0.5|0.5|\n|12/21/2023 1:00 AM \u003c= Time|0.6|0.8|\n\nTo check the latest fees at all the fee levels, see the [What are the fees on Coinbase Pro?](https://help.coinbase.com/en/pro/trading-and-funding/trading-rules-and-fees/fees) page on the Coinbase Pro website.\n\n### Margin\n\nCoinbase Pro does not support margin trading.\n\n### Slippage\n\nOrders through Coinbase Pro do not experience slippage in backtests. In live trading, your orders may experience slippage.\n\n### Fills\n\nWe fill market orders immediately and completely in backtests. In live trading, if the quantity of your market orders exceeds the quantity available at the top of the order book, your orders are filled according to what is available in the order book.\n\n### Settlements\n\nTrades settle immediately after the transaction.\n\n### Deposits and Withdraws\n\nYou can deposit and withdraw cash from your brokerage account while you run an algorithm that's connected to the account. We sync the algorithm's cash holdings with the cash holdings in your brokerage account every day at 7:45 AM Eastern Time (ET).\n\n\u0026nbsp;\n\u0026nbsp;\n\u0026nbsp;\n\n![whats-lean](https://user-images.githubusercontent.com/79997186/184042682-2264a534-74f7-479e-9b88-72531661e35d.png)\n\n\u0026nbsp;\n\u0026nbsp;\n\u0026nbsp;\n\nLEAN Engine is an open-source algorithmic trading engine built for easy strategy research, backtesting, and live trading. We integrate with common data providers and brokerages, so you can quickly deploy algorithmic trading strategies.\n\nThe core of the LEAN Engine is written in C#, but it operates seamlessly on Linux, Mac and Windows operating systems. To use it, you can write algorithms in Python 3.8 or C#. QuantConnect maintains the LEAN project and uses it to drive the web-based algorithmic trading platform on the website.\n\n## Contributions\n\nContributions are warmly very welcomed but we ask you to read the existing code to see how it is formatted, commented and ensure contributions match the existing style. All code submissions must include accompanying tests. Please see the [contributor guide lines](https://github.com/QuantConnect/Lean/blob/master/CONTRIBUTING.md).\n\n## Code of Conduct\n\nWe ask that our users adhere to the community [code of conduct](https://www.quantconnect.com/codeofconduct) to ensure QuantConnect remains a safe, healthy environment for\nhigh quality quantitative trading discussions.\n\n## License Model\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You\nmay obtain a copy of the License at\n\n\u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantconnect%2Flean.brokerages.coinbase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquantconnect%2Flean.brokerages.coinbase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantconnect%2Flean.brokerages.coinbase/lists"}