erlang bitcoin exchange

The Secure, Shared Bitcoin WalletSecure your bitcoin with the open source, ‑multisignature wallet from BitPay.Get CopayCopay is a true bitcoin wallet, not an account service.Secure your personal funds with multiple signatures, or just one.Take security into your own hands and avoid trusting third parties with your savings.Like a joint-checking account, your Copay wallet can have multiple users.To send money, the group approves each transaction.Manage shared funds with friends and coworkers.Share a wallet with your child and introduce them to bitcoin.Copay makes sharing a wallet simple and secure.No more tedious address management.The Copay app securely stores multiple, distinct bitcoin wallets, allowing both business and privacy-conscious users to keep funds carefully separated.Manage personal, business, and testnet wallets easily, all without leaving the app.Copay uses hierarchical-deterministic (HD) wallets, allowing for secure in-app wallet generation and backup.Press that send button with confidence.Copay is one of the first bitcoin wallets to support the full Bitcoin Payment Protocol (BIP 0070-0073).

When you send money to a Payment Protocol-enabled merchant, Copay securely verifies that your payment will go to the right place.The first bitcoin wallet to bring testnet support to both iOS and Windows Phone.Copay includes native support for the Bitcoin Testnet, perfect for testing new bitcoin applications across multiple platforms.With multisignature (P2SH) and multiple wallet support, Copay makes it simple for developers to test and demo bitcoin applications without fumbling between other mobile apps.Not only is the Copay app open source, the server is too.Enterprise and power users can take full control of their finances by deploying their own version of the Copay apps and Bitcore Wallet Service.Dozens of bitcoin developers have already contributed to Copay, and we're not finished yet.Every part of Copay, wallet and server, is available to be reviewed, improved, and developed by the community.You can follow along, discuss improvements, and join in on GitHub at bitpay/copay and bitpay/bitcore-wallet-service.Get the Copay Bitcoin WalletFind it on theiOS App StoreGet it onGoogle PlayDownload fromWindows Store Get theChrome AppAvailable forMac OS XDownload forWindowsGet it forLinux Download the latest source code from GitHub ›Prices In
150 Currencies
Multi-Language Support
HD Wallet
Backups
Convenient Payment Proposal Flow

Welcome to GDAX trader and developer documentation.These documents outline exchange functionality, market details, and APIs.APIs are separated into two categories: trading and feed.Trading APIs require authentication and provide access to placing orders and other account information.Feed APIs provide market data and are public.Market overview and general information.
erster bitcoin automatGDAX operates a continuous first-come, first-serve order book.
bitcoin wallet eigene adresseOrders are executed in price-time priority as received by the matching engine.
bitcoin easy calculatorSelf-trading is not allowed on GDAX.Two orders from the same user will not fill one another.When placing an order, you can specify the self-trade prevention behavior.

The default behavior is decrement and cancel.When two orders from the same user cross, the smaller order will be canceled and the larger order size will be decremented by the smaller order size.If the two orders are the same size, both will be canceled.Cancel the older (resting) order in full.The new order continues to execute.Cancel the newer (taking) order in full.The old resting order remains on the order book.When a market order using dc self-trade prevention encounters an open limit order, the behavior depends on which fields for the market order message were specified.If funds and size are specified for a buy order, then size for the market order will be decremented internally within the matching engine and funds will remain unchanged.The intent is to offset your target size without limiting your buying power.If size is not specified, then funds will be decremented.For a market sell, the size will be decremented when encountering existing limit orders.Orders are matched against existing order book orders at the price of the order on the book, not at the price of the taker order.

User A places a Buy order for 1 BTC at 100 USD.User B then wishes to sell 1 BTC at 80 USD.Because User A’s order was first to the trading engine, they will have price priority and the trade will occur at 100 USD.Valid orders sent to the matching engine are confirmed immediately and are in the received state.If an order executes against another order immediately, the order is considered done.An order can execute in part or whole.Any part of the order not filled immediately, will be considered open.Orders will stay in the open state until canceled or subsequently filled by new orders.Orders that are no longer eligible for matching (filled or canceled) are in the done state.GDAX operates a maker-taker model.Orders which provide liquidity are charged different fees from orders taking liquidity.The fee is assessed as a percentage of the match amount (price * size).A 0.25% taker fee is collected on each trade during the day.At the end of the day (UTC 00:00), a rebate is calculated and issued.

The amount of the rebate issued is calculated on the percentage of total exchange volume, in bitcoin, that a trader has participated in over the past 30 days.There is an existing SELL order for 5 BTC at 100 USD on the order book.You enter a BUY order for 7 BTC at 100 USD.5 BTC of your BUY order are immediately matched and you are charged the taker fee because you are taking liquidity from the order book.The remaining 2 BTC of your order are now sitting on the BID side of the order book.A SELL order for 2 BTC at 100 USD arrives and matches against your 2 BTC BUY order.In this case you provided liquidity and are not charged any fees.If 100 BTC was traded on Coinbase’s USD order book in the last thirty days and you accounted for 1.1 bitcoin, you account for more than 1% of the total volume and receive a rebate of 0.01% that day and pay an effective taker fee of 0.24%.The rebate is issued in the quote currency.GDAX does not charge any additional deposit or withdraw fees for moving funds between your Coinbase accounts and your Exchange accounts.

GDAX primary data sources and servers run in the Amazon US East data center.To minimize latency for API access, we recommend making requests from servers located near the US East data center.A public sandbox is available for testing API connectivity and web trading.The sandbox provides all of the functionality of the production exchange but allows you to add fake funds for testing.Login sessions and API keys are separate from production.Use the sandbox web interface to create keys in the sandbox environment.To add funds, use the web interface deposit and withdraw buttons as you would on the production web interface.When testing your API connectivity, make sure to use the following URLs.When connecting to the FIX API in Sandbox, you must start with an HTTP Upgrade request and set the Upgrade header to fix.After receiving a 101 Switching Protocols response from the server, you may continue using the connection as a regular FIX connection.Remember to use HTTPS for this.Client libraries can help you integrate with our API quickly.

The REST API has endpoints for account and order management as well as public market data.There is also a FIX API for order management.All requests and responses are application/json content type and follow typical HTTP response status codes for success and failure.Unless otherwise stated, errors to bad requests will respond with HTTP 4xx or status codes.The body will also contain a message parameter indicating the cause.Your language’s http library should be configured to provide message bodies for non-2xx requests so that you can read the message field from the body.A successful response is indicated by HTTP status code 200 and may contain an optional body.If the response has a body it will be documented under each resource below.GDAX uses cursor pagination for all REST requests which return arrays.Cursor pagination allows for fetching results before and after the current page of results and is well suited for realtime data.Endpoints like /trades, /fills, /orders, return the latest items by default.

To retrieve more results subsequent requests should specify which direction to paginate based on the data previously returned.before and after cursors are available via response headers CB-BEFORE and CB-AFTER.Your requests should use these cursor values when making requests for pages after the initial request.The before cursor references the first item in a results page and the `after cursor references the last item in a set of results.To request a page of records before the current one, use the before query parameter.Your initial request can omit this parameter to get the default first page.The response will contain a CB-BEFORE header which will return the cursor id to use in your next request for the page before the current one.The page before is a newer page and not one that happened before in chronological time.The response will also contain a CB-AFTER header which will return the cursor id to use in your next request for the page after this one.The page after is an older page and not one that happened after this one in chronological time.

Unless otherwise specified, all timestamps from API are returned in ISO 8601 with microseconds.Make sure you can parse the following ISO 8601 format.Most modern languages and libraries will handle this without issues.Decimal numbers are returned as strings to preserve full precision across platforms.When making a request, it is recommended that you also convert your numbers to strings to avoid truncation and precision errors.Integer numbers (like trade id and sequence) are unquoted.Most identifiers are UUID unless otherwise specified.When making a request which requires a UUID, both forms (with and without dashes) are accepted.When a rate limit is exceeded, a status of 429 Too Many Requests will be returned.We throttle public endpoints by IP: 3 requests per second, up to 6 requests per second in bursts.We throttle private endpoints by user ID: 5 requests per second, up to 10 requests per second in bursts.The FIX API throttles each command type (eg.: NewOrderSingle, OrderCancelRequest) to 30 commands per second.

GDAX offers margin trading.To trade with margin you must use a sub account we call a margin profile.The margin profile is completely separate from the default/standard profile and can only be used on a single product.To trade with margin on multiple products you must use a different profile for each product.Margin profiles still enforce self trade prevention.Self trade prevention is enforced at the user level.This means your margin profiles and your standard profile cannot trade against each other.Note, you will need the manage permission to be able to transfer funds to and from your margin profile.With the margin profile’s api key you can now deposit funds from the standard profile to the margin profile.With some margin in the margin profile’s balance you can place orders that draw funding.You can draw upto 2x your margin.Your margin is your equity in the margin profile.[Your margin] = [value of margin profile's balances] - [value of funding] When you place an order that draws funding, a funding record is created.

A funding record must be repaid after 27 days and 22 hours or we will rebalance your profile to repay the funding.While trading you can monitor your margin profile by subscribing to the authenticated websocket feed and querying GET /position.Private endpoints are available for order management, and account management.Every private request must be signed using the described authentication scheme.Before being able to sign any requests, you must create an API key via the GDAX website.If you are eligible for margin you may select to generate an API key for either your default profile, or your margin profile.Upon creating a key you will have 3 pieces of information which you must remember: The Key and Secret will be randomly generated and provided by GDAX; the Passphrase will be provided by you to further secure your API access.GDAX stores the salted hash of your passphrase for verification, but cannot recover the passphrase if you forget it.All REST requests must contain the following headers: All request bodies should have content type application/json and be valid JSON.

The CB-ACCESS-SIGN header is generated by creating a sha256 HMAC using the base64-decoded secret key on the prehash string timestamp + method + requestPath + body (where + represents string concatenation) and base64-encode the output.The timestamp value is the same as the CB-ACCESS-TIMESTAMP header.The body is the request body string or omitted if there is no request body (typically for GET requests).The method should be UPPER CASE.The CB-ACCESS-TIMESTAMP header MUST be number of seconds since Unix Epoch in UTC.Decimal values are allowed.Your timestamp must be within 30 seconds of the api service time or your request will be considered expired and rejected.We recommend using the time endpoint to query for the API server time if you believe there many be time skew between your server and the API servers.Get a list of trading accounts.* Only applicable to non margin accounts.Withdraws on margin accounts are subject to other restrictions.When you place an order, the funds for the order are placed on hold.

They cannot be used for other orders or withdrawn.Funds will remain on hold until the order is filled or canceled.Information for a single account.Use this endpoint when you know the account_id.Account activity either increases or decreases your account balance.Items are paginated and sorted latest first.See the Pagination section for retrieving additional entries after the first page.Entry type indicates the reason for the account change.If an entry is the result of a trade (match, fee), the details field will contain additional information about the trade.Holds are placed on an account for any active orders or pending withdraw requests.As an order is filled, the hold amount is updated.If an order is canceled, any remaining hold is removed.For a withdraw, once it is completed, the hold is removed.The type of the hold will indicate why the hold exists.The hold type is order for holds related to open orders and transfer for holds related to a withdraw.The ref field contains the id of the order or transfer which created the hold.

You can place different types of orders: limit, market, and stop.Orders can only be placed if your account has sufficient funds.Once an order is placed, your account funds will be put on hold for the duration of the order.How much and which funds are put on hold depends on the order type and parameters specified.See the Holds details below.These parameters are common to all order types.Depending on the order type, additional parameters will be required (see below).* Requires time_in_force to be GTT ** Invalid when time_in_force is IOC or FOK * One of size or funds is required.* One of size or funds is required.* Margin can be used to receive funding by specifying either overdraft_enabled or funding_amount.The product_id must match a valid product.The products list is available via the /products endpoint.The optional client_oid field must be a UUID generated by your trading application.This field value will be broadcast in the public feed for received messages.You can use this field to identify your orders in the public feed.

The client_oid is different than the server-assigned order id.If you are consuming the public feed and see a received message with your client_oid, you should record the server-assigned order_id as it will be used for future order status updates.The client_oid will NOT be used after the received message is sent.The server-assigned order id is also returned as the id field to this HTTP POST request.When placing an order, you can specify the order type.The order type you specify will influence which other order parameters are required as well as how your order will be executed by the matching engine.If type is not specified, the order will default to a limit order.limit orders are both the default and basic order type.A limit order requires specifying a price and size.The size is the number of bitcoin to buy or sell, and the price is the price per bitcoin.The limit order will be filled at the price specified or better.A sell order can be filled at the specified price per bitcoin or a higher price per bitcoin and a buy order can be filled at the specified price or a lower price depending on market conditions.

If market conditions cannot fill the limit order immediately, then the limit order will become part of the open order book until filled by another incoming order or canceled by the user.market orders differ from limit orders in that they provide no pricing guarantees.They however do provide a way to buy or sell specific amounts of bitcoin or fiat without having to specify the price.Market orders execute immediately and no part of the market order will go on the open order book.Market orders are always considered takers and incur taker fees.When placing a market order you can specify funds and/or size.Funds will limit how much of your quote currency account balance is used and size will limit the bitcoin amount transacted.stop orders become active and wait to trigger based on the movement of the last trade price.There are two types of stop orders, sell stop and buy stop.The side parameter is important: side: 'sell': Place a sell stop order, which triggers when the last trade price changes to a value at or below the price.

side: 'buy': Place a buy stop order, which triggers when the last trade price changes to a value at or above price.The last trade price is the last price at which an order was filled.This price can be found in the latest match message.Note that not all match messages may be received due to dropped messages.Note that when triggered, stop orders execute as market orders and are therefore subject to market order holds.The price must be specified in quote_increment product units.The quote increment is the smallest unit of price.For the BTC-USD product, the quote increment is 0.01 or 1 penny.Prices less than 1 penny will not be accepted, and no fractional penny prices will be accepted.Not required for market orders.The size must be greater than the base_min_size for the product and no larger than the base_max_size.The size can be in any increment of the base currency (BTC for the BTC-USD product), which includes satoshi units.size indicates the amount of BTC (or base currency) to buy or sell.

The funds field is optionally used for market orders.When specified it indicates how much of the product quote currency to buy or sell.For example, a market buy for BTC-USD with funds specified as 150.00 will spend 150 USD to buy BTC (including any fees).If the funds field is not specified for a market buy order, size must be specified and GDAX will use available funds in your account to buy bitcoin.A market sell order can also specify the funds.If funds is specified, it will limit the sell to the amount of funds specified.You can use funds with sell orders to limit the amount of quote currency funds received.Time in force policies provide guarantees about the lifetime of an order.There are four policies: good till canceled GTC, good till time GTT, immediate or cancel IOC, and fill or kill FOK.GTC Good till canceled orders remain open on the book until canceled.This is the default behavior if no policy is specified.GTT Good till time orders remain open on the book until canceled or the allotted cancel_after is depleted on the matching engine.

GTT orders are guaranteed to cancel before any other order is processed after the cancel_after timestamp which is returned by the API.A day is considered 24 hours.IOC Immediate or cancel orders instantly cancel the remaining size of the limit order instead of opening it on the book.FOK Fill or kill orders are rejected if the entire size cannot be matched.* Note, match also refers to self trades.The post-only flag indicates that the order should only make liquidity.If any part of the order results in taking liquidity, the order will be rejected and no part of it will execute.For limit buy orders, we will hold price x size x (1 + fee-percent) USD.For sell orders, we will hold the number of Bitcoin you wish to sell.Actual fees are assessed at time of trade.If you cancel a partially filled or unfilled order, any remaining funds will be released from hold.For market buy orders where funds is specified, the funds amount will be put on hold.If only size is specified, all of your account balance (in the quote account) will be put on hold for the duration of the market order (usually a trivially short time).

For a sell order, the size in BTC will be put on hold.If size is not specified (and only funds is specified), your entire BTC balance will be on hold for the duration of the market order.Two orders from the same user will not be allowed to match with one another.To change the self-trade behavior, specify the stp flag.See the self-trade prevention documentation for details about these fields.Orders placed with a margin profile can draw funding by either specifing funding_amount or setting overdraft_enabled to true.Funding can be drawn as long as the margin profile’s margin ratio remains above the intial margin ratio and your oustanding funds remain below your profile’s cap.This is the amount of funding that you wish to be credited to your account at the time of order placement.For buy orders this value is denominated in the quote currency and for sell orders it is denominated in the base currency.On the BTC-USD product this would be USD for buy orders and BTC for sell orders.The funding amount cannot be larger than the cost of the order.

If set to true we will automatically determine funding_amount such that you can place the order.If you have enough funds to cover the order in your account, funding_amount will be 0.If you do not have enough funds to cover the order’s cost, we will set funding_amount to be the difference.For example if you have 100 USD in your margin account and place a post only limit order to buy 2 BTC @ 800 USD, we will set funding_amount to be 2 * 800 - 100 = 1500 USD.The HTTP Request will respond when an order is either rejected (insufficient funds, invalid parameters, etc) or received (accepted by the matching engine).A 200 response indicates that the order was received and is active.Active orders may execute immediately (depending on price and market conditions) either partially or fully.A partial execution will put the remaining size of the order in the open state.An order that is filled completely, will go into the done state.Users listening to streaming market data are encouraged to use the client_oid field to identify their received messages in the feed.

The REST response with a server order_id may come after the received message in the public data feed.A successful order will be assigned an order id.A successful order is defined as one that has been accepted by the matching engine.Cancel a previously placed order.If the order had no matches during its lifetime its record may be purged.This means the order details will not be available with GET /orders/
.If the order could not be canceled (already filled or previously canceled, etc), then an error response will indicate the reason in the message field.With best effort, cancel all open orders.The response is a list of ids of the canceled orders.List your current open orders.Only open or un-settled orders are returned.As soon as an order is no longer open and settled, it will no longer appear in the default request.To specify multiple statuses, use the status query argument multiple times: /orders?status=done&status=pending.Orders which are no longer resting on the order book, will be marked with the done status.

There is a small window between an order being done and settled.An order is settled when all of the fills have settled and the remaining holds (if any) have been removed.For high-volume trading it is strongly recommended that you maintain your own list of open orders and use one of the streaming market data feeds to keep it updated.You should poll the open orders endpoint once when you start trading to obtain the current state of any open orders.executed_value is the cumulative match size * price and is only present for orders placed after 2016-05-20.Get a single order by order id.If the order is canceled the response may have status code 404 if the order had no matches.Get a list of recent fills.You can request fills for specific orders or products using query parameters.Fees are recorded in two stages.Immediately after the matching engine completes a match, the fill is inserted into our datastore.Once the fill is recorded, a settlement process will settle the fill and credit both trading counterparties.

The fee field indicates the fees charged for this individual fill.The liquidity field indicates if the fill was the result of a liquidity provider or liquidity taker.M indicates Maker and T indicates Taker.Fills are returned sorted by descending trade_id from the largest trade_id to the smallest trade_id.The CB-BEFORE header will have this first trade id so that future requests using the cb-before parameter will fetch fills with a greater trade id (newer fills).Every order placed with a margin profile that draws funding will create a funding record.Repays the older funding records first.Transfer funds between your standard/default profile and a margin profile.A deposit will transfer funds from the default profile into the margin profile.A withdraw will transfer funds from the margin profile to the default profile.Withdraws will fail if they would set your margin ratio below the initial margin ratio requirement.To get your margin profile id you can query GET /position with your margin profile’s API key.

An overview of your profile.The status of the profile.If active, the profile can be used for trading.If pending, the profile is currently being created.If locked, the profile is undergoing a rebalance.If default, you were not able repay funding after a margin call or expired funding and now have a default.Holds details about the open/outstanding fundings taken out in the margin profile.funding_value is the value of all outstanding fundings in USD.This value is updated every time you draw or repay funding.max_funding_value is maximum value of fundings in USD that you can have oustanding.This value can restrict you from drawing more funding.oldest_outstanding is the oldest funding record you have outstanding.This is important as funding can only remain outstanding for 27 days and 22 hours before being automatically closed and settled.It is recommended that you manually settle or claim the funding before it expires.The accounts in the profile indexed by their currency.Holds details about the resting margin call.

To attempt to ensure you can repay funding we place a hidden stop like order on the book.When the last trade price hits or goes past price the margin call will trigger issuing a market order to rebalance your profile so each account has enough funds to repay all outstanding funding records.If each account’s balance is large enough to repay the its funded_amount, active will be false signifying your profile does not have a resting margin call.Deposit funds from a payment method.See the Payment Methods section for retrieving your payment methods.Deposit funds from a coinbase account.You can move funds between your Coinbase accounts and your GDAX trading accounts within your daily limits.Moving funds between Coinbase and GDAX is instant and free.See the Coinbase Accounts section for retrieving your Coinbase accounts.Withdraw funds to a payment method.Withdraw funds to a coinbase account.Withdraws funds to a crypto address.Get a list of your payment methods.Get a list of your coinbase accounts.

Visit the Coinbase accounts API for more information.Reports provide batches of historic information about your account in various human and machine readable forms.The report will be generated when resources are available.Report status can be queried via the /reports/:report_id endpoint.The file_url field will be available once the report has successfully been created and is available for download.Reports are only available for download for a few days after being created.Once a report expires, the report is no longer available for download and is deleted.Once a report request has been accepted for processing, the status is available by polling the report resource endpoint.The final report will be uploaded and available at file_url once the status indicates ready This request will return your 30-day trailing volume for all products.This is a cached value that’s calculated every day at midnight UTC.The Market Data API is an unauthenticated set of endpoints for retrieving market data.

These endpoints provide snapshots of market data.Get a list of available currency pairs for trading.The base_min_size and base_max_size fields define the min and max order size.The quote_increment field specifies the min order price as well as the price increment.The order price must be a multiple of this increment (i.e.if the increment is 0.01, order prices of 0.001 or 0.021 would be rejected).Example Response for /products/BTC-USD/book Only the best bid and ask is returned.Get a list of open orders for a product.The amount of detail shown can be customized with the level parameter.By default, only the inside (i.e.best) bid and ask are returned.This is equivalent to a book depth of 1 level.If you would like to see a larger order book, specify the level query parameter.If a level is not aggregated, then all of the orders at each price will be returned.Aggregated levels return only one size for each active price (as if there was only a single order for that size at the level).

Levels 1 and 2 are aggregated and return the number of orders at each level.Level 3 is non-aggregated and returns the entire order book.Snapshot information about the last trade (tick), best bid/ask and 24h volume.Polling is discouraged in favor of connecting via the websocket stream and listening for match messages.List the latest trades for a product.The trade side indicates the maker order side.The maker order is the order that was open on the order book.buy side indicates a down-tick because the maker was a buy order and their order was removed.Conversely, sell side indicates an up-tick.Historic rates for a product.Rates are returned in grouped buckets based on requested granularity.Each bucket is an array of the following information: Get 24 hr stats for the product.volume is in base currency units.open, high, low are in quote currency units.Currency codes will conform to the ISO 4217 standard where possible.Currencies which have or had no representation in ISO 4217 may use a custom code.

Get the API server time.The epoch field represents decimal seconds since Unix Epoch The websocket feed provides real-time market data updates for orders and trades.Real-time market data updates provide the fastest insight into order flow and trades.This however means that You are responsible for reading the message stream and using the message relevant for your needs which can include building real-time order books or tracking real-time trades.The websocket feed is publicly available, but connection to it are rate-limited to 1 per 4 seconds per IP.It is possible to authenticate yourself when subscribing to the websocket feed.Authentication will result in a couple of benefits: /users/self.Here’s an example of an authenticated subscribe request: To get the necessary parameters, you would go through the same process as you do to make authenticated calls to the API.The easiest way to connect to an authenticated feed is to use our gdax-node library.Each feed message contains a sequence number.

Sequence numbers are increasing integer values with every new message being exactly 1 sequence number than the one before it.If you see a sequence number that is more than one value from the previous, it means a message has been dropped.A sequence number less than one you have seen can be ignored or has arrived out-of-order.In both situations you may need to perform logic to make sure your system is in the correct state.To begin receiving feed messages, you must first send a subscribe message to the server indicating which product feed messages to receive.This is the only message you will need to send.This message must be JSON-encoded.Any other messages, or a mal-formed message, will result in your connection being terminated.To receive private details and feed messages you can subscribe to the authenticated feed.Here the signature is the same as signed request to GET /users/self.To receive heartbeat messages once a second, you must first send a message turning heartbeat on.You can turn off heartbeat messages by sending a message where on is false.

The websocket feed provides real-time updates on orders and trades.These updates can be applied on to a level 2 or 3 order book snapshot to maintain an accurate and up-to-date copy of the exchange order book.An algorithm to maintain an up-to-date order book is described below: The following messages are sent over the websocket stream in JSON format.A valid order has been received and is now active.This message is emitted for every single valid order as soon as the matching engine receives it whether it fills immediately or not.The received message does not indicate a resting order on the order book.It simply indicates a new incoming order which as been accepted by the matching engine for processing.Received orders may cause match message to follow if they are able to begin being filled (taker behavior).Self-trade prevention may also trigger change messages to follow if the order size needs to be adjusted.Orders which are not fully filled or canceled due to self-trade prevention result in an open message and become resting orders on the order book.

Market orders (indicated by the order_type field) may have an optional funds field which indicates how much quote currency will be used to buy or sell.For example, a funds field of 100.00 for the BTC-USD product would indicate a purchase of up to 100.00 USD worth of bitcoin.The order is now open on the order book.This message will only be sent for orders which are not fully filled immediately.remaining_size will indicate how much of the order is unfilled and going on the book.The order is no longer on the order book.Sent for all orders for which there was a received message.This message can result from an order being canceled or filled.There will be no more messages for this order_id after a done message.remaining_size indicates how much of the order went unfilled; this will be 0 for filled orders.market orders will not have a remaining_size or price field as they are never on the open order book at a given price.A trade occurred between two orders.The aggressor or taker order is the one executing immediately after being received and the maker order is a resting order on the book.

The side field indicates the maker order side.If the side is sell this indicates the maker was a sell order and the match is considered an up-tick.A buy side match is a down-tick.If authenticated, and you were the taker, the message would also have the following fields: An order has changed.This is the result of self-trade prevention adjusting the order size or available funds.Orders can only decrease in size or funds.change messages are sent anytime an order changes in size; this includes resting orders (open) as well as received but not yet open.change messages are also sent when a new market order goes through self trade prevention and the funds for the market order have changed.This feed message will only be received if you are authenticated with a margin profile.A message sent once a second when heartbeat is turned on.If you send a message that is not recognized or an error occurs, the error message will be sent and you will be disconnected.FIX (Financial Information eXchange) is a standard protocol which can be used to enter orders, submit cancel requests, and receive fills.

Users of the FIX API will typically have existing software using FIX for order management.Users who are not familiar with FIX should first consider using the REST API.If your FIX implementation does not support establishing a TCP SSL connection natively, you will need to 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.The baseline specification for this API is FIX 4.2.There are additional tags from later versions of FIX, and custom tags in the high number range as allowed by the standard.A standard header must be present at the start of every message in both directions.Sent by the client to initiate a session, and by the server as an acknowledgement.Only one session may exist per connection; sending a Logon message within an established session is an error.The Logon message sent by the client must be signed for security.The signing method is described in Signing a Message.The prehash string is the following fields joined by the FIX field separator (ASCII code 1): SendingTime, MsgType, MsgSeqNum, SenderCompID, TargetCompID, Password.

There is no trailing separator.The RawData field should be a base64 encoding of the HMAC signature.Sent by either side to initiate session termination.The side which receives this message first should reply with the same message type to confirm session termination.Closing a connection without logging out of the session first is an error.Sent by the client to enter an order.If an order is decremented due to self-trade prevention, an Execution Report will be sent to the client with ExecType=D indicating unsolicited OrderQty reduction (i.e.See the self-trade prevention documentation for more details about this field.The post-only flag (P) indicates that the order should only make liquidity.Open Post-Only orders will be treated as Good Till Cancel.See the time in force documentation for more details about these values.If a trading error occurs (e.g.user has insufficient funds), an ExecutionReport with ExecType=8 is sent back, signifying that the order was rejected.Sent by the client to cancel an order.

Use of the ClOrdID is not available after reconnecting or starting a new session.You should use the OrderID obtained via the ExecutionReport once available.Sent by the client to obtain information about pending orders.The response to an Order Status Request is a series of ExecutionReports with ExecType=I, each representing one open order belonging to the user.If the user has no open orders, a single ExecutionReport is sent back with OrderID=0.Sent by the server when an order is accepted, rejected, filled, or canceled.Also sent when the user sends an OrderStatusRequest.Sent by the server when an Order Cancel Request cannot be satisfied, e.g.because the order is already canceled or completely filled.Cancel requests for invalid or unknown order IDs may result in Reject messages instead.Sent by either side upon receipt of a message which cannot be processed, e.g.due to missing fields or an unsupported message type.The following values can be sent by the server.Sent by both sides if no messages have been sent for HeartBtInt seconds as agreed during logon.

May also be sent in response to a Test Request.May be sent at any time by either side.:4198 only accepts TCP connections secured by SSL.If your FIX client library cannot establish an SSL connection natively, you will need to run a local proxy that will establish a secure connection and allow unencrypted local connections.This is an example configuration file for stunnel to listen on a port locally and proxy unencrypted TCP connections to the encrypted SSL connection.The service name (Coinbase) and the accept port (4197) may be changed to any suitable values.When stunnel is started with the above configuration file, it will run in the background.On Unix-like systems the option foreground = yes may be specified at the top of the file to avoid running in the background.For testing it may be easier to use foreground mode, or to specify the top-level output option as a file path where stunnel will write log messages.If your system has OpenSSL installed, you can run this command to download the certificate: :.pem