GuidesAPI Reference
DocumentationLog In

Connectivity

How to connect to the Prime FIX protocol

FIX (Financial Information eXchange) is a standard protocol that can be used to enter orders, submit cancel requests, and receive fills. FIX API users typically have existing software that runs FIX for order management. Users who are not familiar with FIX should consider using the REST API.

πŸ“˜

FIX API Endpoint URL

tcp+ssl://fix.prime.coinbase.com:4198

❗

️ Resend requests are not supported

Connections that do not reset sequence numbers are rejected. Every connection establishes a new session and a new set of session sequence numbers.

Connecting

Before logging onto a FIX session, clients must establish a secure connection to the FIX gateway (fix.prime.coinbase.com:4198).

TCP SSL

If your FIX implementation does not support establishing a native TCP SSL connection, you must setup a local proxy such as stunnel to establish a secure connection to the FIX gateway. See the SSL Tunnels section for more details and examples.

πŸ“˜

Sessions are forcibly logged out every day between 5pm ET and 5:05pm ET for a maintenance window. All users are required to restart their sessions during this time and reset sequence numbers to 0.

Rate Limiting

Requests are limited to 50 calls per second/FIX session. We allow up to 7 sessions/portfolio but only 1 per API Key. For more, see Rate Limits.

SSL Tunnels

fix.prime.coinbase.com:4198 only accepts TCP connections secured by SSL. If your FIX client library cannot establish an SSL connection natively, you must run a local proxy that establishes a secure connection and allow unencrypted local connections.

Certificate pinning is no longer supported.

Configure Stunnel

Example of stunnel configuration (stunnel.conf):

foreground = yes
debug = info

[Coinbase]
client = yes
accept = 4198
connect = fix.prime.coinbase.com:4198
verify = 4
CAfile = resources/fix-prime.coinbase.com.pem

Pull Down Prime Certificate

Command to pull down Prime Certificate for CAfile:

openssl s_client -showcerts -connect fix.prime.coinbase.com:4198 < /dev/null | openssl x509 -outform PEM > fix-prime.coinbase.com.pem
   openssl x509 -outform PEM > fix-prime.coinbase.com.pem

Run stunnel.conf

Command to run your stunnel.conf file:

stunnel resources/stunnel.conf

Configure [SESSION]

Sample [Session] Section in FIX configuration file:

[SESSION]
BeginString=FIX.4.2
SenderCompID=3e74e5c7-56a1-556a-b044-19936c5a728a
TargetCompID=COIN
HeartBtInt=30
SocketConnectPort=4198
SocketConnectHost=127.0.0.1
FileStorePath=./Sessions/