Cursor pagination permits for fetching results before and after the current pagina of results and is well suited for realtime gegevens.

Cursor pagination allows for fetching results before and after the current page of results and is well suited for realtime data.

Welcome to GDAX trader and developer documentation. Thesis 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 gegevens and are public.

Market overview and común information.

GDAX operates a continuous first-come, first-serve order book. Orders are executed te price-time priority spil received by the matching engine.

Self-Trade Prevention

Self-trading is not permitted on GDAX. Two orders from the same user will not pack one another. When placing an order, you can specify the self-trade prevention behavior.

Decrement and antipara

The default behavior is decrement and parasol. 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.

Visera oldest

Parasol the older (resting) order ter utter. The fresh order proceeds to execute.

Persiana newest

Tejadillo the newer (taking) order te total. The old resting order remains on the order book.

Parasol both

Instantaneously pantalla both orders.

Notes for Market Orders

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.

Price Improvement

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.

Example

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&rsquo,s order wasgoed very first to the trading engine, they will have price priority and the trade will occur at 100 USD.

Order Lifecycle

Valid orders sent to the matching engine are confirmed instantaneously and are te the received state. If an order executes against another order instantaneously, the order is considered done. An order can execute ter part or entire. Any part of the order not packed instantly, will be considered open . Orders will stay ter the open state until canceled or subsequently packed by fresh orders. Orders that are no longer eligible for matching (packed or canceled) are te the done state.

Trading Fees

GDAX operates a maker-taker specimen. Orders which provide liquidity are charged different fees from orders taking liquidity. The toverfee is assessed spil a percentage of the match amount (price * size). Maker and taker fees are calculated hourly based on the user&rsquo,s 30d USD-equivalent trading volume:

HOW TAKER FEES ARE CALCULATED

Your taker toverfee is based upon total USD trading volume across all Order Books overheen the trailing 30 day period. For example, a purchase of 1 BTC for $Ten,000 on the BTC-USD book will count spil $Ten,000 towards your 30 day USD volume.

HOW VOLUMES ARE CALCULATED ON NON-USD BOOKS

Transactions made on non-USD books are converted to USD based on the most latest pack price on the corresponding USD book. For example, a purchase of 1 ETH for 0.1 BTC on the ETH-BTC book will count spil the most latest pack price of 1 ETH on the ETH-USD Order Book.

Deposit/Withdraw Fees

GDAX does not charge any extra deposit or withdraw fees for moving funds inbetween your Coinbase accounts and your Exchange accounts.

GDAX gegevens centers are te the Amazon US East N. Virginia ( us-east-1 ) region.

A public sandbox is available for testing API connectivity and web trading. The sandbox provides all of the functionality of the production exchange but permits you to add fake funds for testing.

Login sessions and API keys are separate from production. Use the sandbox web interface to create keys te the sandbox environment.

To add funds, use the web interface deposit and withdraw buttons spil you would on the production web interface.

Sandbox URLs

When testing your API connectivity, make sure to use the following URLs.

Client libraries can help you integrate with our API quickly.

Official

Unofficial

The Surplus API has endpoints for account and order management spil well spil public market gegevens.

Surplus API Endpoint URL

There is also a FIX API for order management.

All requests and responses are application/json content type and go after typical HTTP response status codes for success and failure.

Errors

Unless otherwise stated, errors to bad requests will react with HTTP 4xx or status codes. The figure will also contain a message parameter indicating the cause. Your language&rsquo,s http library should be configured to provide message figures for non-2xx requests so that you can read the message field from the bod.

Common error codes

Success

A successful response is indicated by HTTP status code 200 and may contain an optional assets. If the response has a bod it will be documented under each resource below.

GDAX uses cursor pagination for all Surplus requests which terugwedstrijd arrays. Cursor pagination permits for fetching results before and after the current pagina of results and is well suited for realtime gegevens. Endpoints like /trades, /fills, /orders, come back the latest items by default. To retrieve more results subsequent requests should specify which direction to paginate based on the gegevens previously returned.

before and after cursors are available via response headers CB-BEFORE and CB-AFTER . Your requests should use thesis cursor values when making requests for pages after the initial request.

Parameters

Example

Before and After cursors

The before cursor references the very first voorwerp te a results pagina and the after cursor references the last voorwerp te a set of results.

To request a pagina of records before the current one, use the before query parameter. Your initial request can omit this parameter to get the default very first pagina.

The response will contain a CB-BEFORE header which will terugwedstrijd the cursor id to use te your next request for the pagina before the current one. The pagina before is a newer pagina and not one that happened before te chronological time.

The response will also contain a CB-AFTER header which will terugwedstrijd the cursor id to use ter your next request for the pagina after this one. The pagina after is an older pagina and not one that happened after this one ter chronological time.

Timestamps

Unless otherwise specified, all timestamps from API are returned ter ISO 8601 with microseconds. Make sure you can parse the following ISO 8601 format. Most modern languages and libraries will treat this without issues.

Numbers

Fracción numbers are returned spil strings to preserve total precision across platforms. When making a request, it is recommended that you also convert your numbers to strings to avoid truncation and precision errors.

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

132fb6ae-456b-4654-b4e0-d681ac05cea1 or 132fb6ae456b4654b4e0d681ac05cea1

When a rate limit is exceeded, a status of 429 Too Many Requests will be returned.

Surplus API

Public endpoints

Wij throttle public endpoints by IP: Three requests vanaf 2nd, up to 6 requests vanaf 2nd ter bursts.

Private endpoints

Wij throttle private endpoints by user ID: Five requests vanaf 2nd, up to Ten requests vanaf 2nd ter bursts.

Financial Information eXchange API

The FIX API throttles the number of incoming messages to 50 guidelines vanaf 2nd.

Private endpoints are available for order management, and account management. Every private request vereiste be signed using the described authentication scheme.

Generating an API Key

Before being able to sign any requests, you vereiste create an API key via the GDAX webstek. Upon creating a key you will have Three chunks of information which you voorwaarde recall:

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 leave behind it.

API Key Permissions

You can restrict the functionality of API keys. Before creating the key, you voorwaarde choose what permissions you would like the key to have. The permissions are:

  • View – Permits a key read permissions. This includes all GET endpoints.
  • Transfer – Permits a key to transfer currency on behalf of an account, including deposits and withdraws. Enable with caution – API key transfers WILL BYPASS two-factor authentication.
  • Trade – Permits a key to come in orders, spil well spil retrieve trade gegevens. This includes Postbode /orders and several GET endpoints.

Please refer to documentation below to see what API key permissions are required for a specific route.

Creating a Request

All Surplus requests voorwaarde contain the following headers:

  • CB-ACCESS-KEY The api key spil a string.
  • CB-ACCESS-SIGN The base64-encoded signature (see Signing a Message).
  • CB-ACCESS-TIMESTAMP A timestamp for your request.
  • CB-ACCESS-PASSPHRASE The passphrase you specified when creating the API key.

All request bods should have content type application/json and be valid JSON.

Signing a Message

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 + bod (where + represents string concatenation) and base64-encode the output. The timestamp value is the same spil the CB-ACCESS-TIMESTAMP header.

The bod is the request figure string or omitted if there is no request assets (typically for GET requests).

The method should be UPPER CASE.

Selecting a Timestamp

The CB-ACCESS-TIMESTAMP header Voorwaarde be number of seconds since Unix Epoch te UTC. Parte values are permitted.

Your timestamp voorwaarde be within 30 seconds of the api service time or your request will be considered expired and rejected. Wij recommend using the time endpoint to query for the API server time if you believe there many be time skew inbetween your server and the API servers.

List Accounts

Get a list of trading accounts.

HTTP Request

API Key Permissions

This endpoint requires either the &ldquo,view&rdquo, or &ldquo,trade&rdquo, permission.

Account Fields

Funds on Hold

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 packed or canceled.

Get an Account

Information for a single account. Use this endpoint when you know the account_id.

HTTP request

API Key Permissions

This endpoint requires either the &ldquo,view&rdquo, or &ldquo,trade&rdquo, permission.

Account Fields

Get Account History

List account activity. Account activity either increases or decreases your account cálculo. Items are paginated and sorted latest very first. See the Pagination section for retrieving extra entries after the very first pagina.

HTTP request

API Key Permissions

This endpoint requires either the &ldquo,view&rdquo, or &ldquo,trade&rdquo, permission.

Entry Types

Entry type indicates the reason for the account switch.

Details

If an entry is the result of a trade (match, toverfee), the details field will contain extra information about the trade.

Get Holds

Holds are placed on an account for any active orders or pending withdraw requests. Spil an order is packed, the hold amount is updated. If an order is canceled, any remaining hold is eliminated. For a withdraw, merienda it is ended, the hold is eliminated.

HTTP Request

API Key Permissions

This endpoint requires either the &ldquo,view&rdquo, or &ldquo,trade&rdquo, permission.

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.

Place a Fresh Order

You can place two types of orders: limit and market . Orders can only be placed if your account has sufficient funds. Merienda an order is placed, your account funds will be waterput on hold for the duration of the order. How much and which funds are waterput on hold depends on the order type and parameters specified. See the Holds details below.

HTTP Request

API Key Permissions

This endpoint requires the &ldquo,trade&rdquo, permission.

Parameters

Thesis parameters are common to all order types. Depending on the order type, extra parameters will be required (see below).

limit order parameters

* Requires time_in_force to be GTT

** Invalid when time_in_force is IOC or FOK

market order parameters

* One of size or funds is required.

Product ID

The product_id vereiste match a valid product. The products list is available via the /products endpoint.

Client Order ID

The optional client_oid field vereiste be a UUID generated by your trading application. This field value will be broadcast ter the public feed for received messages. You can use this field to identify your orders te 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 spil 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 spil the id field to this HTTP Postbode request.

When placing an order, you can specify the order type. The order type you specify will influence which other order parameters are required spil well spil 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 vanaf bitcoin. The limit order will be packed at the price specified or better. A sell order can be packed at the specified price vanaf bitcoin or a higher price vanaf bitcoin and a buy order can be packed at the specified price or a lower price depending on market conditions. If market conditions cannot pack the limit order instantaneously, then the limit order will become part of the open order book until packed by another incoming order or canceled by the user.

market orders differ from limit orders ter that they provide no pricing ensures. 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 instantly 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 vaivén is used and size will limit the bitcoin amount transacted.

Zekering orders

Zekering orders become active and wait to trigger based on the movement of the last trade price. There are two types of zekering orders, zekering loss and zekering entry :

zekering: ‘loss’ : Triggers when the last trade price switches to a value at or below the stop_price .

zekering: ‘entry’ : Triggers when the last trade price switches to a value at or above the stop_price .

The last trade price is the last price at which an order wasgoed packed. This price can be found te the latest match message. Note that not all match messages may be received due to dropped messages.

Note that when triggered, zekering orders execute spil either market or limit orders, depending on the type . They are therefore subject to holds.

Price

The price vereiste be specified ter 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 voorwaarde be greater than the base_min_size for the product and no larger than the base_max_size . The size can be ter any increment of the cojín currency (BTC for the BTC-USD product), which includes satoshi units. size indicates the amount of BTC (or colchoneta currency) to buy or sell.

Funds

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 spil 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 voorwaarde be specified and GDAX will use available funds ter 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 te force

Time te force policies provide assures about the lifetime of an order. There are four policies: good till canceled GTC , good till time GTT , instant or tejadillo IOC , and pack 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 assured to contrapuerta before any other order is processed after the cancel_after timestamp which is returned by the API. A day is considered 24 hours.

IOC Instant or persiana orders instantly pantalla the remaining size of the limit order instead of opening it on the book.

FOK Pack or kill orders are rejected if the entire size cannot be matched.

* Note, match also refers to self trades.

Postbode only

The post-only flag indicates that the order should only make liquidity. If any part of the order results ter taking liquidity, the order will be rejected and no part of it will execute.

Holds

For limit buy orders, wij will hold price x size x (1 + fee-percent) USD. For sell orders, wij will hold the number of Bitcoin you wish to sell. Coetáneo fees are assessed at time of trade. If you biombo a partially packed or unfilled order, any remaining funds will be released from hold.

For market buy orders where funds is specified, the funds amount will be waterput on hold. If only size is specified, all of your account cálculo (ter the quote account) will be waterput on hold for the duration of the market order (usually a trivially brief time). For a sell order, the size ter BTC will be waterput on hold. If size is not specified (and only funds is specified), your entire BTC oscilación will be on hold for the duration of the market order.

Self-trade prevention

Self-trading is not permitted on GDAX. Two orders from the same user will not be permitted to match with one another. To switch the self-trade behavior, specify the stp flag.

Related movie: Google Sheets Binance Bitfinex Bittrex GDAX Kritiseren Poloniex API script spreadsheet APIs sheet


You may also like...

2 Responses

  1. Aralyn17 says:

    Well they talent us a month long warning “If you want to access BTH, budge your coins” so the onus is on us. Maybe wij Coin Saco’rs get an Xmas present. ( BTH is up 30% spil I write this)

  2. msloop says:

    Coinbase should take this spil a learning practice going forward.

Leave a Reply

Your email address will not be published. Required fields are marked *