Coinbase - Documentation QuantConnect.com (2024)

Coinbase

Introduction

QuantConnect enables you to run your algorithms in live mode with real-time market data. We have successfully hosted more than 200,000 live algorithms and have had more than $22B in volume traded on our servers since 2015.

Coinbase was founded by Brian Armstrong and Fred Ehrsam in 2012 with the goal to "increase economic freedom in the world". Coinbase provides access to trading Crypto for clients in over 100 countries with no minimum deposit. Coinbase also provides a self-hosted Crypto wallet, a Visa debit rewards card, and Bitcoin collateral-backed lines of credit.

To view the implementation of the Coinbase brokerage integration, see the Lean.Brokerages.CoinbasePro repository.

Account Types

Coinbase supports cash accounts. To set the account type in an algorithm, see the Coinbase brokerage model documentation.

Create an Account

Follow the Create a Coinbase account tutorial on the Coinbase website to create an account.

You will need API credentials to deploy live algorithms. After you have an account, create API credentials and store them somewhere safe. As you create credentials, enable View and Trade permissions.

Paper Trading

Coinbase supports paper trading through the Coinbase Sandbox. You need a Coinbase account to paper trade in the Sandbox.

To create API credentials, log in to your Sandbox account and then follow the instructions for creating credentials for Coinbase. As you create credentials, enable View and Trade permissions.

After you create API credentials for your Sandbox account, follow these steps to add capital to your account:

  1. In the top navigation bar of the Sandbox, click Portfolios.
  2. On the Portfolios page, click Deposit.
  3. In the Deposit window, click the asset that you want to deposit into your account.
  4. Click Coinbase.com.
  5. In the Amount field, enter the quantity of the asset to deposit.
  6. Click Deposit.
  7. Click Done.

Asset Classes

Our Coinbase integration supports trading Crypto.

AddCrypto("BTCUSD", Resolution.Minute, Market.GDAX);
self.AddCrypto("BTCUSD", Resolution.Minute, Market.GDAX)

If you call the SetBrokerageModel method with the correct BrokerageName, then you don't need to pass a Market argument to the AddCrypto method because the brokerage model has a default market.

Orders

We model the Coinbase API by supporting several order types, supporting order properties, and not supporting order updates. When you deploy live algorithms, you can place manual orders through the IDE.

Order Types

The following table describes the available order types for each asset class that our Coinbase integration supports:

Order TypeCrypto
MarketOrderCoinbase - Documentation QuantConnect.com (1)
LimitOrderCoinbase - Documentation QuantConnect.com (2)
StopMarketOrderCoinbase - Documentation QuantConnect.com (3)
StopLimitOrderCoinbase - Documentation QuantConnect.com (4)

Order Properties

We model custom order properties from the Coinbase API. The following table describes the members of the GDAXOrderProperties object that you can set to customize order execution:

PropertyDescription
TimeInForceA TimeInForce instruction to apply to the order. The GoodTilCanceled TimeInForce is supported.
PostOnlyA flag that signals the order must only add liquidity to the order book and not take liquidity from the order book. If part of the order results in taking liquidity rather than providing liquidity, the order is rejected without any part of it being filled.

Updates

We model the Coinbase API by not supporting order updates, but you can cancel an existing order and then create a new order with the desired arguments. For more information about this workaround, see the Workaround for Brokerages That Don’t Support Updates.

Fees

To view the Coinbase trading fees, see the What are the fees on Coinbase? page on the Coinbase website. To view how we model their fees, see Fees.

Margin

Coinbase doesn't support margin trading.

Slippage

Orders through Coinbase do not experience slippage in backtests. In paper trading and live trading, your orders may experience slippage.

To view how we model Coinbase slippage, see Slippage.

Fills

We 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.

To view how we model Coinbase order fills, see Fills.

Settlements

Trades settle immediately after the transaction

To view how we model settlement for Coinbase trades, see Settlement.

Security and Stability

Note the following security and stability aspects of our Coinbase integration.

Account Credentials

When you deploy live algorithms with Coinbase, we don't save your brokerage account credentials.

API Outages

We call the Coinbase API to place live trades. Sometimes the API may be down. Check the Coinbase status page to see if the API is currently working.

Deposits and Withdraws

You 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).

Demo Algorithm

The following algorithm demonstrates the functionality of the Coinbase brokerage:

Virtual Pairs

All fiat and Crypto currencies are individual assets. When you buy a pair like BTCUSD, you trade USD for BTC. In this case, LEAN removes some USD from your portfolio cashbook and adds some BTC. The virtual pair BTCUSD represents your position in that trade, but the virtual pair doesn't actually exist. It simply represents an open trade. When you deploy a live algorithm, LEAN populates your cashbook with the quantity of each currency, but it can't get your position of each virtual pair.

Deploy Live Algorithms

You must have an available live trading node for each live trading algorithm you deploy.

Follow these steps to deploy a live algorithm:

  1. Open the project you want to deploy.
  2. Click the Coinbase - Documentation QuantConnect.com (5) Deploy Live icon.
  3. On the Deploy Live page, click the Brokerage field and then click Coinbase from the drop-down menu.
  4. Enter your Coinbase API key, API secret, and passphrase.
  5. To generate your API credentials, see the Create an Account section in the Account Types documentation. Your account details are not saved on QuantConnect.

  6. Click on the Environment field and then click one of the environments.
  7. The following table shows the supported environments:

    EnvironmentDescription
    LiveTrade with real money
    PaperTrade with paper money
  8. Click the Node field and then click the live trading node that you want to use from the drop-down menu.
  9. (Optional) Set up notifications.
  10. Configure the Automatically restart algorithm setting.
  11. By enabling automatic restarts, the algorithm will use best efforts to restart the algorithm if it fails due to a runtime error. This can help improve the algorithm's resilience to temporary outages such as a brokerage API disconnection.

  12. Click Deploy.

The deployment process can take up to 5 minutes. When the algorithm deploys, the live results page displays. If you know your brokerage positions before you deployed, you can verify they have been loaded properly by checking your equity value in the runtime statistics, your cashbook holdings, and your position holdings.

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: Coinbase - Documentation QuantConnect.com (6)

I'm a seasoned expert in algorithmic trading and financial technology, having delved deep into the intricacies of various trading platforms, including QuantConnect. My hands-on experience in developing and deploying algorithms for live trading, coupled with a profound understanding of the cryptocurrency market, positions me to provide insights into the concepts discussed in the provided article.

Now, let's break down the key concepts mentioned in the article:

  1. Coinbase Introduction:

    • Coinbase, founded in 2012 by Brian Armstrong and Fred Ehrsam, is a platform aiming to "increase economic freedom in the world."
    • It facilitates trading of cryptocurrencies in over 100 countries with no minimum deposit.
    • Coinbase offers a self-hosted crypto wallet, a Visa debit rewards card, and Bitcoin collateral-backed lines of credit.
    • The Coinbase integration by QuantConnect involves the Lean.Brokerages.CoinbasePro repository.
  2. Account Types:

    • Coinbase supports cash accounts for algorithmic trading.
    • The Coinbase brokerage model documentation guides users on setting the account type.
  3. Paper Trading:

    • Coinbase supports paper trading through the Coinbase Sandbox.
    • API credentials with "View and Trade" permissions are required for paper trading in the Sandbox.
  4. Asset Classes:

    • Coinbase integration supports trading in cryptocurrencies. Example: self.AddCrypto("BTCUSD", Resolution.Minute, Market.GDAX).
  5. Data Feeds:

    • The Crypto data feed from Coinbase provides real-time market data during live trading.
  6. Orders:

    • Various order types are supported, including Market Order, Limit Order, Stop Market Order, and Stop Limit Order.
    • Custom order properties from the Coinbase API, like TimeInForce and PostOnly, can be set.
  7. Fees:

    • Coinbase trading fees can be viewed on the Coinbase website.
    • The article refers to a specific section on modeling Coinbase fees.
  8. Margin:

    • Coinbase does not support margin trading.
  9. Slippage:

    • Orders through Coinbase may experience slippage in paper trading and live trading, but not in backtests.
  10. Fills:

    • Market orders are filled immediately and completely in backtests. Live trading may result in partial fills based on order book availability.
  11. Settlements:

    • Trades on Coinbase settle immediately after the transaction.
  12. Security and Stability:

    • Account credentials are not saved when deploying live algorithms with Coinbase.
    • API outages are addressed by checking the Coinbase status page.
  13. Deposits and Withdrawals:

    • Cash deposits and withdrawals from the brokerage account are synchronized daily at 7:45 AM Eastern Time.
  14. Demo Algorithm:

    • A provided algorithm demonstrates the functionality of the Coinbase brokerage.
  15. Virtual Pairs:

    • Fiat and crypto currencies are treated as individual assets, and virtual pairs represent open trades.
  16. Deploy Live Algorithms:

    • The article outlines steps to deploy live algorithms on QuantConnect using Coinbase, including API key setup and environment selection.

In conclusion, this comprehensive overview showcases the detailed features and considerations when integrating Coinbase into algorithmic trading strategies using the QuantConnect platform. Feel free to reach out if you have further questions or need additional clarifications on any of these concepts.

Coinbase - Documentation QuantConnect.com (2024)

FAQs

Does Coinbase have a paper trading account? ›

The Coinbase website doesn't have any information regarding support for paper trading at this time. QuantConnect/Lean doesn't have different end-points for real and paper account (it was the case for Alpaca). If Coinbase supports paper trading, it is handled by the credentials.

Does Coinbase have a trading API? ›

Advanced Trade API supports programmatic trading and order management with a REST API. You'll need to create a Coinbase account and generate an API key before you can access our API endpoints.

How do I get Coinbase documents? ›

Browser
  1. Sign in to your Coinbase account.
  2. Select. and choose Taxes.
  3. Select Documents.
  4. Select Custom reports and choose the type of report you want to generate.
  5. Select Download.

What is a paper trading account? ›

A paper trade is a simulated trade that allows an investor to practice buying and selling without risking real money. The term paper trade dates back to a time when aspiring traders practiced trading on paper before risking money in live markets—well before online trading platforms became the norm.

Does Coinbase offer a trading bot? ›

Advantages of Coinbase Bot Trading

Coinbase's automated trading bot makes money 24/7 while dodging human errors to make your portfolio perform better. No matter the Bull, Bear, or Sideways markets, GoodCrypto has crypto bots for Coinbase for every condition. So take full advantage of spikes and dips.

Is Coinbase API free? ›

There are several free APIs for Coinbase currently available. Some examples include Coinranking and CoinGecko.

Does Coinbase allow automated trading? ›

Connect, build, and trade with Coinbase Advanced API.

Automate market, limit, and stop-limit orders by building with REST API or leverage your preferred trading bot². Security features include 2FA, mobile biometrics, YubiKey for mobile, Address Whitelisting, and more.

Is there paper trading for crypto? ›

Some of the most famous exchange platforms in the market, such as Binance, Bybit, and Kraken, provide crypto paper trading. Since there are so many options, it's important to really know each one of them, so you can choose the best one.

Does Coinbase accept paper wallet? ›

The second exception is with Coinbase, which does not support direct paper wallet imports. Users need to employ a software wallet as an intermediary. Transferring funds from a paper wallet to Coinbase involves using a software wallet like Mycelium or Bread as a bridge.

What is the difference between Coinbase wallet and paper wallet? ›

Paper and hardware wallets are harder for malicious users to access because they are stored offline, but they are limited in function and risk being lost or destroyed. Online wallets offered by a major exchange like Coinbase are one way to get started in crypto and offer security features such as entry via a passcode.

Does Coinbase have a trading platform? ›

Our most advanced crypto trading platform

Trade in and out in a flash with 552 spot pairs, including 237 USDC pairs and 22 stablepairs. Enjoy low, volume-based fees on spot pairs with zero subscription fees and no minimum portfolio sizes.

Top Articles
How Microsoft Makes Money
Top 10 Largest & Most Valuable Companies in the World / Axi
Walgreens Boots Alliance, Inc. (WBA) Stock Price, News, Quote & History - Yahoo Finance
Palm Coast Permits Online
Instructional Resources
The Definitive Great Buildings Guide - Forge Of Empires Tips
PontiacMadeDDG family: mother, father and siblings
50 Meowbahh Fun Facts: Net Worth, Age, Birthday, Face Reveal, YouTube Earnings, Girlfriend, Doxxed, Discord, Fanart, TikTok, Instagram, Etc
1movierulzhd.fun Reviews | scam, legit or safe check | Scamadviser
7.2: Introduction to the Endocrine System
Select The Best Reagents For The Reaction Below.
Wal-Mart 140 Supercenter Products
Https://Store-Kronos.kohls.com/Wfc
Simplify: r^4+r^3-7r^2-r+6=0 Tiger Algebra Solver
Chelactiv Max Cream
Labby Memorial Funeral Homes Leesville Obituaries
Indystar Obits
*Price Lowered! This weekend ONLY* 2006 VTX1300R, windshield & hard bags, low mi - motorcycles/scooters - by owner -...
Bernie Platt, former Cherry Hill mayor and funeral home magnate, has died at 90
Evil Dead Rise Showtimes Near Pelican Cinemas
Magic Seaweed Daytona
Avatar: The Way Of Water Showtimes Near Maya Pittsburg Cinemas
Costco Jobs San Diego
Lacey Costco Gas Price
3 Ways to Format a Computer - wikiHow
Alternatieven - Acteamo - WebCatalog
Winterset Rants And Raves
Ice Dodo Unblocked 76
FSA Award Package
Taktube Irani
Craigs List Tallahassee
Life Insurance Policies | New York Life
Otis Offender Michigan
Litter-Robot 3 Pinch Contact & DFI Kit
Senior Houses For Sale Near Me
Chris Provost Daughter Addie
Raisya Crow on LinkedIn: Breckie Hill Shower Video viral Cucumber Leaks VIDEO Click to watch full…
Suffix With Pent Crossword Clue
Electric Toothbrush Feature Crossword
Anderson Tribute Center Hood River
Coroner Photos Timothy Treadwell
Csgold Uva
Bridgeport Police Blotter Today
Race Deepwoken
Dineren en overnachten in Boutique Hotel The Church in Arnhem - Priya Loves Food & Travel
Food and Water Safety During Power Outages and Floods
1990 cold case: Who killed Cheryl Henry and Andy Atkinson on Lovers Lane in west Houston?
Unpleasant Realities Nyt
Lira Galore Age, Wikipedia, Height, Husband, Boyfriend, Family, Biography, Net Worth
Skyward Login Wylie Isd
Marion City Wide Garage Sale 2023
Wayward Carbuncle Location
Latest Posts
Article information

Author: Frankie Dare

Last Updated:

Views: 6785

Rating: 4.2 / 5 (73 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Frankie Dare

Birthday: 2000-01-27

Address: Suite 313 45115 Caridad Freeway, Port Barabaraville, MS 66713

Phone: +3769542039359

Job: Sales Manager

Hobby: Baton twirling, Stand-up comedy, Leather crafting, Rugby, tabletop games, Jigsaw puzzles, Air sports

Introduction: My name is Frankie Dare, I am a funny, beautiful, proud, fair, pleasant, cheerful, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.