Prism is a highly reliable service for access to a variety of cryptocurrency exchanges through a single unified API.
Prism is used by institutional and high-frequency traders, brokers, exchanges and other market participants to incorporate their solutions into cryptocurrency trading. This QuantBrothers's service employs the standardized exchange protocol FIX, that allows clients to use their existing trade platforms with minimum integration expenses. It also provides for the fully-functional RESTful+WebSockets protocol.
In short, Prism is exactly what a program interface for cryptocurrency trading should be!
Difficulties Caused by the Cryptocurrency Market’s Diversity
Thanks to the principles of decentralization and distributed trust, cryptocurrency has made it possible for trading platforms to appear which simultaneously take on the functions of brokers and clearing organizations. It has eliminated the need for setting up a chain of trusted agents and organizing standard interaction protocols. This has led to a growth in the number of various cryptocurrency exchanges with a wide range of trade functions and great diversity in unconventional program interfaces.
The cryptocurrency market’s liquidity is quite high and growing every day along with the number of exchanges. A tremendous amount of work is required in order to ensure good trade volume and to integrate each of the many different alt-coins.
Web and public access
The most common approach to organizing the program interface for cryptocurrency exchanges is WebAPI in the form of separate RESTful protocol requests. As a result, the receipt of market data updates also requires continuous polling by RESTful requests. Push data notifications from WebSockets are only available for a handful of cryptocurrency exchanges. This unavoidably leads to an ever-growing number of requests to the exchange. As a result, exchanges introduce limits to the number of transactions possible within a given period of time. This can add complications to the realization of various sorts of trade algorithms, especially those having to do with arbitrage trades or trades with large volume.
In order to protect from any potential DDoS attacks, the exchanges provide their WebAPI not directly but through request filtering services. Each request passes through an authentication procedure and is routed to the exchange’s processing service. This introduces additional delays in the execution of transactions.
Low fault tolerance
The problem of fault tolerance is worth separate mention, as WebAPI does not add any functionality aimed at supporting transactional integrity. The APIs of cryptocurrency exchanges are vulnerable to all sorts of situations in which a transaction is not accomplished during the execution chain and this makes it extremely difficult to verify its current execution status. For example, if you send a RESTful request to place a new order and - at the same moment the connection is interrupted, you won’t receive a response on the result of that exchange operation’s execution. So the status of your order will be unclear – it may have been placed on the market, or it may not have been accepted by the exchange.
Although most cryptocurrency exchanges operate 24/7 without breaks in clearing, but downtime is not unheard of. Exchanges WebAPI sometimes can be disabled for maintenance or due to market failures.
How Prism solves the issues
Prism employs the unified standardized protocol FIX 4.4 for access to all existing cryptocurrency exchanges. This protocol is the established standard for exchange operations, taking on all the necessary functions for carrying out trade operations.
We provide the full featured implementation of that protocol with the most complete support for different kinds of transactions and types of exchange orders.
The following order types are available through Prism:
- LIMIT — present on the market and visible in the order book until its execution
- HIDDEN — not visible in the order book, and executed only when a cross price appears in the order book
- STOP — executed as soon as the price level reaches the ‘stop’ condition
- MARKET — executed at the present available volume
- IOC — executed either partially or fully if there is a cross price in the order book and is cancelled immediately
- FOK — only executed if the order book contains cross prices of sufficient volume
- Algorithmic orders — Market Order Router, VWAP, Iceberg
For MARKET, IOC or FOK orders, the most liquid market for the given currency pair is chosen automatically if no specific market is set.
If an exchange’s API does not support this or that order type, we take on that work ourselves and carry out an internal emulation.
Prism service provides access to a full range of operations such as PLACE, MOVE and CANCEL. Even if a given exchange doesn’t support MOVE operation, we will safely carry it out within the Prism.
Secure access and high-speed response
A protected channel and a fixed network address are used for access to Prism service. A client’s connection is carried out in an isolated environment, ruling out any additional load from another party.
The FIX protocol is based on the TCP protocol, avoiding HTTP headers. This makes possible to receive data in the form of a stream without periodical requests to the server. There’s no need to undergo authentication for each request to the server, as this is done only once when the connection is established. The geolocation of Prism’s servers is chosen in a way to minimize response time from the most important exchanges.
Requests to exchanges fall into two categories:
Public — to receive of information disregarding user accounts. For example, this could be information on an order book or all of the public trades carried out on the exchange. In order to raise responses, Prism uses the cashing of public requests and moves those requests to the server’s internal proxy. This enables an increase in the number of requests to the exchanges and in the frequency of data updates. Through Prism you can see more up-to-date prices in the order book than if you were using the API of a specific exchange directly.
Private — to perform transactions. For example, working with orders or depositing/withdrawing funds for a deposit. Such requests demands the account holder’s digital signature using the API key provided by the exchange.
Prism doesn’t store private keys to perform account-specific requests. The signing of internal messages to the exchange is performed client-side using open-source software. This excludes any unsolicited operations with the keys and gives clients the ability to retract their keys at any time.
In case when a client is wary of storing private keys on the own side, they can be stored in encrypted form on Prism’s servers. In that case, the transaction signature takes place on the server without the client’s participation. Clients can specify a number of restrictions to operate with these keys; a restriction on currency deposits and withdrawals, for example.
The system’s internal architecture is set up in a such way that if problems arise on one of the exchanges, say, an excess of the maximum number of transactions per second, process is switched to another exchange. With a large number of available exchanges, this minimizes accessibility problems.
The FIX protocol solves recovery problems after malfunctions by resynchronizing messages on reconnect. When the connection was interrupted due to an outside situation, the client on their end can always receive their lost messages. Meanwhile, they can always verify the status of their orders by using their own order identifier
Prism constantly controls order consistency by using a series of algorithms common to all exchanges:
- If the connection with an exchange was interrupted at the moment when a client sent an order, order verification algorithm automatically checks the status of active orders. It detects the appearance of a new order on the exchange using an internal identifier. In the case when the order was successfully placed on the exchange, the client clearly sees this by receiving a confirmation that their order was successfully placed regardless of connection interruption.
- Another algorithm makes it possible to track the internal status of client’s own orders. Clients receive real-time updates about order status – order cancellation, modification, partial or full execution.
- A third algorithm tracks the presence of unsolicited orders (optional). If the list of active orders in a given user’s account contains a LIMIT order that is not in the system, then that order is automatically canceled.
Clients work with Prism service using their own connection. The system runs in an isolated environment using resources specially allocated to client. If one of the exchanges stops responding, transactions are moved to another exchange. Algorithmic orders automatically implement a relocation of requested volumes.
Trading with leverage is available through exchanges that support margin trading. Currently leverage of up to 3x is available on Bitfinex and Poloniex for the most liquid currency pairs. Margin contracts with higher leverage are available on BitMEX exchange over Prism.
Detailed information on transactions carried out through Prism system is fully available in the system. Data can be retrieved through system API, or through requests in the form of text files.
Completed transactions can also be received through the FIX Drop Copy protocol.
We offer two kinds of API – classic exchange API using the FIX 4.4 protocol or WebAPI for clients who have previously worked with cryptocurrency exchanges directly.
List of Supported Exchanges
|Exchange name||Market data||Trading|
|Exchange name||Market data||Trading|