Coinbase Pro API Review

By XTRD CTO Serg Gulko

Like most people, my first impressions are based on visual appeal. Yes, I realize that it might be the wrong approach to judge a book by it’s cover, but it’s hard to beat human nature.

As part of the crypto exchange integration process at XTRD, we usually familiarize ourselves with the exchange’s provided user interface, support systems, communication channels, public documentation, and so on. I remember that the day we started working on Coinbase Pro, I posted a long and exciting speech in the internal employee group chat about my findings.

After dozens and dozens of clunky, sometimes even absurd GUIs I’ve witnessed, Coinbase Pro was like a breath of fresh air. Everything was so polished, so smooth (no, smooooooth), and worked so intuitively, that I said — “guys, that’s why Coinbase is one of most popular platforms to trade crypto. Yes, fees are high but you enjoy the process. It’s like a switchover from an old Soviet Union “Zhuguli” to Mercedes Benz. Look, they even have a FIX API!”.

Image for post

But then we started working with Conbase’s API. First impressions can be deceiving. Below is the list of things that puzzled us (and which we solved).

Your order is not yours

The FIX protocol defines a special field called ClOrdId (Client Order ID) to carry client-assigned IDs of his/her orders. The client’s OME/EMS (order/execution management system) uses these unique IDs to track each order individually for many reasons. It could be execution, reporting, accounting, or of the above.

When the server receives and accepts the client’s order, it assigns its own ID to the order (transmitted using field OrderID). This is completely reasonable because you can’t rely on a counterparty to track orders. Your system, your rules, your order IDs.

Unfortunately, in Coinbase Pro, a client’s order IDs are not really clients’. In accordance with their rules, the field ClOrdId should contain a UUID string (something like this 58d1f436–6a53–11eb-9439–0242ac130002).

Any attempts to send something different — numbers (1,2,3…), strings (my_super_order_1, cool_order_132) or any other forms of IDs will be rejected. This means that your OMS/EMS should discard the existing methodology of client side ID generation (database IDs, timestamps, random strings, and so on) and start using Coinbase Pro rules. Time to rename ClOrdId to CoinbaseClOrdId!

Wait, UUID is not that bad for ID management, there are several other exchanges that use it. Why not adopt it and stop complaining?

Because there is another surprise with ClOrdIds on Coinbase Pro! Once an order is confirmed and you received the first ExecutionReport with OrderID, you’ll never see your IDs again. Any following update attempts to extract a list of open orders or trading history — everything will contain only the Coinbase-assigned ID.

So there are challenges to solve:

  • adopt your OMS/EMS to use UUIDs or build a mapper between your native IDs and what you send to Coinbase
  • build a matching mechanism that allows identifying orders using only OrderID and links it to ClOrdIds

Needless to say, our clients simply don’t know about the twists and turns of this plot. XTRD’s FIX API is designed in a way that doesn’t limit you or creates additional obstacles to solve. Your system, your orders, your rules.

XTRD allows the assignment of any type of IDs — numbers or strings. Each ExecutionReport (if successful) contains an OrderID (ID in our system, always a number), and an exchange-assigned ID (could be anything) that can be used for cross-checks between internal and exchange systems for a binary, synergistic execution verification and audit.

Image for post

As a final word: Coinbase Pro is a fantastic product and a great exchange to trade on — it’s normal that some parts of a very complex offering have minor rough spots.

XTRD’s job is to ensure that our clients’ awareness of integration difficulties only exists from our complaints in articles!

single_point_of_access_crypto_trading

3 Reasons a Single Point of Access is Hugely Beneficial for Those who Trade Cryptocurrency

Ten years into the crypto revolution and markets are still considered immature. Where traders on mainstream platforms have access to unlimited amounts of liquidity and a vast array of advanced tools to help facilitate their transactions, cryptocurrency traders still function in a sort of technological ‘stone age.’ 

If you want to trade on multiple exchanges, you have to create multiple accounts with different login credentials. Traders have to deal with separate fees and separate slippage, cutting into profits more and more. There is also the counterparty risk which gets multiplied with every exchange you interact with. 

While these problems might not bother small retail traders, it creates tremendous headaches for those looking to trade with larger sums of capital. This is one of many reasons that bigger financial players have yet to enter the cryptocurrency sector in a significant way.  

Thankfully, there is a solution coming. One which allows traders to interact with a single entity and reduce, or eliminate, the hassles and risks associated with trading across multiple exchanges.

How A Single Point of Access Improves Trading

Being able to have a single point of access (SPA) provides traders with the resources they need to function effectively and be successful. While the benefits of trading through a SPA are extensive, here we will focus on three in particular.

1. Ability to Interact with Additional Exchanges

A single point of access gives traders access to multiple exchanges. Why would anyone want such a thing?

The simplest reason is liquidity. In markets as shallow as cryptocurrency, it’s just not possible to transact with very large amounts of capital. It becomes necessary to buy/sell coins on several different exchanges simultaneously. 

Not all exchanges list all coins/tokens or all trading pairs that exist. The token you want may be absent on one exchange, listed in a BTC pair on another exchange, or possibly in a stablecoin pair such as USDC on yet another exchange. If you wanted to trade this hypothetical coin for a stablecoin using fiat, you would have to:

  1. Convert fiat to BTC,
  2. Move the BTC to the exchange with your desired coin, 
  3. Make a trade, 
  4. Move the new coin to another exchange, 
  5. Make another trade

After undergoing these five steps, in which you have racked up hefty fees (and a massive headache), you would finally have finished trading the coin you wanted in the stablecoin pair you were looking for.

2. Reduced Counterparty Risk

Trading anything on any platform comes with some kind of counterparty risk. To some extent, you always have to trust your funds in someone else’s hands for a certain length of time. This results in the possibility of something going wrong on part of the party holding your funds. 

The term “counterparty risk” refers to the risk of someone defaulting on their debt owed to you. In the case of cryptocurrency, some exchanges have mismanaged user funds in the past, resulting in traders losing most or all of their coins. The users in such cases fell victim to the counterparty risk inherent in holding coins on an exchange.

But going through the process described above multiplies counterparty risk to a large and unnecessary degree. Instead of being concerned with the potential of something going wrong at a single point of failure, you now have to endure risk at least three times over. 

3. Reduced Slippage and Fees

As if all the problems described above weren’t enough, you are also losing chunks of capital during this long and drawn out process. Every exchange you use charges its own fees, creates its own slippage (the small losses that result from large buy/sell orders being executed in multiple trades at different prices), and requires a network transaction or miner fee for moving crypto from one wallet to another. 

This can result in a trader incurring losses at the end of the day even if they make a profitable trade.

Being able to use a single point of access allows traders to keep things simple – one account, one trade, one simple and clear fee.

The Future of Crypto Trading Is About To Get Much Simpler

Multiple companies are currently developing a solution, but none has achieved industry-wide success yet. Currently, XTRD is the closest trading company to achieving a single point of access for traders. Very soon, it is likely that the industry will coalesce around a kind of cross-exchange trading mechanism that other financial markets have used for decades. This instrument will allow for improved transactionality, which can lead to not only the maturation of the industry, but to mainstream adoption of blockchain technologies.