Skip to content

Instantly share code, notes, and snippets.

@jgensler8
Last active September 20, 2020 20:50
Show Gist options
  • Save jgensler8/008735b706c32da12ed2765447b041b1 to your computer and use it in GitHub Desktop.
Save jgensler8/008735b706c32da12ed2765447b041b1 to your computer and use it in GitHub Desktop.
coinbase pro swagger yaml
swagger: '2.0'
info:
title: Coinbase Pro API
description: The Coinbase Pro API. See https://docs.pro.coinbase.com/ for more details on rate limiting, sandbox mode, and more.
version: 2.0.0
contact:
name: Jeff Gensler
url: 'http://github.com/jgensler8'
host: api.pro.coinbase.com
schemes:
- https
produces:
- application/json
# TODO: go client doesn't support multiple security headers so set these as parameters
parameters:
Key:
in: header
name: CB-ACCESS-KEY
required: true
type: string
description: The api key as a string.
Sign:
in: header
name: CB-ACCESS-SIGN
required: true
type: string
description: The base64-encoded signature (see Signing a Message).
Timestamp:
in: header
name: CB-ACCESS-TIMESTAMP
required: true
type: string
description: A timestamp for your request.
Passphrase:
in: header
name: CB-ACCESS-PASSPHRASE
required: true
type: string
description: The passphrase you specified when creating the API key.
paths:
/accounts:
get:
summary: List accounts
description: Get a list of trading accounts from the profile of the API key.
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
tags:
- Accounts
responses:
'200':
description: The accounts
schema:
type: array
items:
$ref: '#/definitions/Account'
default: &defaultresponse
description: "error"
schema:
$ref: '#/definitions/ErrorResponse'
/accounts/{account-id}:
get:
summary: Get one account
description: Information for a single account. Use this endpoint when you know the account_id. API key must belong to the same profile as the account.
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
- name: account-id
in: path
required: true
type: string
tags:
- Accounts
responses:
'200':
description: The accounts
schema:
$ref: '#/definitions/Account'
default: *defaultresponse
/accounts/{account-id}/ledger:
get:
summary: Get ledger items
description: List account activity of the API key's profile. 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.
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
- name: account-id
in: path
required: true
type: string
tags:
- Accounts
responses:
'200':
description: The accounts
schema:
type: array
items:
$ref: '#/definitions/LedgerItem'
default: *defaultresponse
/accounts/{account-id}/holds:
get:
summary: Get ledger items
description: List holds of an account that belong to the same profile as the API key. 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.
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
- name: account-id
in: path
required: true
type: string
tags:
- Accounts
responses:
'200':
description: The accounts
schema:
type: array
items:
$ref: '#/definitions/Hold'
default: *defaultresponse
/orders:
get:
summary: list orders
description: "List your current open orders from the profile that the API key belongs to. 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."
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
- name: product_id
in: query
required: false
type: string
tags:
- Orders
responses:
'200':
description: The orders
schema:
type: array
items:
$ref: '#/definitions/Order'
default: *defaultresponse
post:
summary: place a new order
description: "You can place two types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Each profile can have a maximum of 500 open orders on a product. Once reached, the profile will not be able to place any new orders until the total number of open orders is below 500. 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."
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
- name: order
in: body
required: true
schema:
$ref: '#/definitions/OrderRequest'
tags:
- Orders
responses:
'200':
description: The order
schema:
$ref: '#/definitions/Order'
default: *defaultresponse
delete:
summary: cancel all orders
description: With best effort, cancel all open orders from the profile that the API key belongs to. The response is a list of ids of the canceled orders.
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
- name: order
in: body
required: true
schema:
type: array
items:
type: string
example: "144c6f8e-713f-4682-8435-5280fbe8b2b4"
- name: product_id
in: query
required: false
type: string
tags:
- Orders
responses:
200:
description: OK
/orders/{order-id}:
delete:
summary: cancel an order
description: |
Cancel a previously placed order. Order must belong to the profile that the API key belongs to.
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/<id>."
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
- name: order-id
in: path
required: true
type: string
- name: product_id
in: query
required: false
type: string
tags:
- Orders
responses:
'200':
description: The orders
schema:
type: array
items:
$ref: '#/definitions/Order'
default: *defaultresponse
get:
summary: get an order
description: |
Get a single order by order id from the profile that the API key belongs to.
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
- name: order-id
in: path
required: true
type: string
tags:
- Orders
responses:
'200':
description: The order
schema:
$ref: '#/definitions/Order'
default: *defaultresponse
/fills:
get:
summary: list fills
description: "Get a list of recent fills of the API key's profile."
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
- name: order_id
in: query
required: false
type: string
default: "all"
- name: product_id
in: query
required: false
type: string
default: "all"
tags:
- Orders
responses:
'200':
description: The orders
schema:
type: array
items:
$ref: '#/definitions/Fill'
default: *defaultresponse
/users/self/exchange-limits:
get:
summary: list fills
description: "This request will return information on your payment method transfer limits, as well as buy/sell limits per currency."
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
- name: order_id
in: query
required: false
type: string
default: "all"
- name: product_id
in: query
required: false
type: string
default: "all"
tags:
- Limits
responses:
'200':
description: The limits
schema:
type: array
items:
$ref: '#/definitions/LimitResponse'
default: *defaultresponse
## Deposits
# /transfers
# /transfers/{transfer-id}
# /deposits/payment-method
# /deposits/coinbase-account
# /coinbase-accounts{<coinbase-account-id}/addresses
## Withdrawls
# /transfers (different default param)
# /transfers/{transfer-id} (different default param)
# /withdrawals/payment-method
# /withdrawals/coinbase-account
# /withdrawals/crypto
/conversions:
post:
summary: convert to/from stable coins?
description: "Convert $10,000.00 to 10,000.00 USDC."
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
- name: order
in: body
required: true
schema:
$ref: '#/definitions/OrderRequest'
tags:
- Stablecoin Conversions
responses:
'200':
description: The order
schema:
type: array
items:
$ref: '#/definitions/Order'
default: *defaultresponse
## Payment Methods
# /payment-methods
## Coinbase Accounts
# /coinbase-accounts
## Fees
/fees:
get:
summary: your current maker/taker fee rates
description: "This request will return your current maker & taker fee rates, as well as your 30-day trailing volume. Quoted rates are subject to change. More information on fees can found on our support page."
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
tags:
- Fees
responses:
'200':
description: The rates
schema:
type: array
items:
$ref: '#/definitions/FeeRateItem'
default: *defaultresponse
## Reports
# /reports
# /reports/{repord-id}
## Profiles
# /profiles
# /profiles/{profile-id}
# /profiles/transfer
/users/self/trailing-volume:
get:
summary: Trailing Volume
description: |
This endpoint requires either the "view" or "trade" permission.
This request will return your 30-day trailing volume for all products of the API key's profile. This is a cached value that's calculated every day at midnight UTC."
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
tags:
- User Account
responses:
'200':
description: The rates
schema:
type: array
items:
$ref: '#/definitions/VolumeItem'
default: *defaultresponse
## Margin
# /margin/profile_information
# /margin/buying_power
# /margin/withdrawal_power
# /margin/withdrawal_power_all
# /margin/exit_plan
# /margin/liquidation_history
# /margin/position_refresh_amounts
# /margin/status
## Oracle
# /oracle
/products:
get:
summary: Get a list of available currency pairs for trading.
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
tags:
- Products
responses:
'200':
description: The products
schema:
type: array
items:
$ref: '#/definitions/Product'
default: *defaultresponse
/products/{product-id}:
get:
summary: Get market data for a specific currency pair.
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
- name: product-id
in: path
required: true
type: string
tags:
- Products
responses:
'200':
description: The product
schema:
$ref: '#/definitions/Product'
default: *defaultresponse
/products/{product-id}/book:
get:
summary: Get a list of open orders for a product. The amount of detail shown can be customized with the level parameter.
description: |
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).
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
- name: product-id
in: path
required: true
type: string
- name: level
in: query
required: false
type: string
default: "1"
description: |
1: Only the best bid and ask
2: Top 50 bids and asks (aggregated)
3: Full order book (non aggregated)
enum:
- "1"
- "2"
- "3"
tags:
- Products
responses:
'200':
description: The product
schema:
$ref: '#/definitions/Book'
default: *defaultresponse
/products/{product-id}/ticker:
get:
summary: Get Product Ticker
description: Snapshot information about the last trade (tick), best bid/ask and 24h volume.
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
- name: product-id
in: path
required: true
type: string
tags:
- Products
responses:
'200':
description: The ticker
schema:
$ref: '#/definitions/Ticker'
default: *defaultresponse
/products/{product-id}/trades:
get:
summary: Get Trades
description: Snapshot information about the last trade (tick), best bid/ask and 24h volume.
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
- name: product-id
in: path
required: true
type: string
tags:
- Products
responses:
'200':
description: The trades
schema:
type: array
items:
$ref: '#/definitions/Trade'
default: *defaultresponse
/products/{product-id}/candles:
get:
summary: Get Historic Rates
description: |
Historical rate data may be incomplete. No data is published for intervals where there are no ticks.
Historical rates should not be polled frequently. If you need real-time information, use the trade and book endpoints along with the websocket feed.
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
- name: product-id
in: path
required: true
type: string
- name: parameters
in: body
required: true
schema:
$ref: '#/definitions/HistoricRateRequest'
tags:
- Products
responses:
'200':
description: The trades
schema:
type: array
items:
type: array
items:
type: number
description: "this is actually a Candle. [ time, low, high, open, close, volume ]"
example: [ 1415398768, 0.32, 4.2, 0.35, 4.2, 12.3 ]
default: *defaultresponse
/products/{product-id}/stats:
get:
summary: Get 24hr Stats
description: Get 24 hr stats for the product. volume is in base currency units. open, high, low are in quote currency units.
parameters:
- $ref: '#/parameters/Key'
- $ref: '#/parameters/Sign'
- $ref: '#/parameters/Timestamp'
- $ref: '#/parameters/Passphrase'
- name: product-id
in: path
required: true
type: string
tags:
- Products
responses:
'200':
description: The stats
schema:
$ref: '#/definitions/Stats'
default: *defaultresponse
definitions:
ErrorResponse:
type: object
description: 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.
properties:
message:
type: string
Account:
type: object
properties:
id:
type: string
description: Account ID
currency:
type: string
description: the currency of the account
balance:
type: string
description: total funds in the account
holds:
type: string
description: funds on hold (not available for use)
available:
type: boolean
description: funds available to withdraw or trade
trading_enabled:
type: boolean
description: is trading enabled for this account?
LedgerItem:
type: object
properties:
id:
type: string
description: ledger item id?
example: "100"
created_at:
type: string
description: timestamp as string
example: "2014-11-07T08:19:27.028459Z"
amount:
type: string
example: "0.001"
balance:
type: string
example: "239.669"
type:
type: string
example: "fee"
details:
type: object
properties:
order_id:
type: string
description: uuid of order
example: "d50ec984-77a8-460a-b958-66f114b0de9b"
trade_id:
type: string
example: "74"
product_id:
type: string
example: BTC-USD
Hold:
type: object
properties:
id:
type: string
example: "82dcd140-c3c7-4507-8de4-2c529cd1a28f"
account_id:
type: string
example: "e0b3f39a-183d-453e-b754-0c13e5bab0b3"
created_at:
type: string
example: "2014-11-06T10:34:47.123456Z"
updated_at:
type: string
example: "2014-11-06T10:34:47.123456Z"
amount:
type: string
example: "4.23"
type:
type: string
example: "order"
reg:
type: string
example: "0a205de4-dd35-4370-a285-fe8fc375a273"
LimitOrderRequest:
type: object
properties: &limit_order_properties
size:
type: string
example: "0.01"
price:
type: string
example: "0.100"
time_in_force:
type: string
example: "GTC"
enum:
- GTC
- GTT
- IOC
- FOK
cancel_after:
type: string
example: "hour"
enum:
- min
- hour
- day
post_only:
type: boolean
example: false
MarketOrderRequest:
type: object
description: One of size or funds is required.
properties: &market_order_properties
size:
type: string
example: "0.01"
funds:
type: string
example: "1.0"
OrderRequest:
type: object
properties:
client_oid:
type: string
description: Order ID selected by you to identify your order
example: "???"
type:
type: string
example: "limit"
enum:
- limit
- market
side:
type: string
example: "buy"
enum:
- buy
- sell
product_id:
type: string
example: "BTC-USD"
stp:
type: string
description: |
Self-trade prevention flag
dc: Decrease and Cancel (default)
co: Cancel oldest
cn: Cancel newest
cb: Cancel both
example: "dc"
enum:
# Decrease and Cancel (default)
- dc
# Cancel oldest
- co
# Cancel newest
- cn
# Cancel both
- cb
stop:
type: string
example: "loss"
enum:
- loss
- entry
stop_price:
type: string
description: Only if stop is defined. Sets trigger price for stop order.
example: ""
<< : *limit_order_properties
<< : *market_order_properties
Order:
type: object
properties:
id:
type: string
example: "d0c5340b-6d6c-49d9-b567-48c4bfca13d2"
price:
type: string
example: "0.100"
size:
type: string
example: "0.01"
product_id:
type: string
example: "BTC-USD"
side:
type: string
example: "buy"
stp:
type: string
example: "dc"
type:
type: string
example: "limit"
time_in_force:
type: string
example: "GTC"
post_only:
type: boolean
example: false
created_at:
type: string
example: "2016-12-08T20:02:28.53864Z"
fill_fees:
type: string
example: "0.0000000000000000"
filled_size:
type: string
example: "0.00000000"
executed_value:
type: string
example: "0.0000000000000000"
status:
type: string
example: "pending"
settled:
type: boolean
example: false
Fill:
type: object
properties:
trade_id:
type: integer
example: 74
product_id:
type: string
example: "BTC-USD"
price:
type: string
example: "10.00"
size:
type: string
example: "0.01"
order_id:
type: string
example: "d50ec984-77a8-460a-b958-66f114b0de9b"
created_at:
type: string
example: "2014-11-07T22:19:28.578544Z"
liquidity:
type: string
example: "T"
fee:
type: string
example: "0.00025"
settled:
type: boolean
example: true
side:
type: string
example: buy
LimitResponseItem:
type: object
properties:
BAT:
type: object
properties:
max:
type: string
example: "21267.54245368"
remaining:
type: string
example: "21267.54245368"
period_in_days:
type: integer
example: 7
LimitResponse:
type: object
properties:
limit_currency:
type: string
example: "USD"
transfer_limits:
type: object
properties:
ach:
$ref: '#/definitions/LimitResponseItem'
ach_no_balance:
$ref: '#/definitions/LimitResponseItem'
credit_debit_card:
$ref: '#/definitions/LimitResponseItem'
ach_curm:
$ref: '#/definitions/LimitResponseItem'
secure3d_buy:
$ref: '#/definitions/LimitResponseItem'
exchange_withdraw:
$ref: '#/definitions/LimitResponseItem'
exchange_ach:
$ref: '#/definitions/LimitResponseItem'
paypal_withdrawl:
$ref: '#/definitions/LimitResponseItem'
instant_ach_withdrawl:
$ref: '#/definitions/LimitResponseItem'
buy:
$ref: '#/definitions/LimitResponseItem'
sell:
$ref: '#/definitions/LimitResponseItem'
ConversionRequest:
type: object
properties:
from:
type: string
example: "USD"
to:
type: string
example: "USDC"
amount:
type: string
example: "10000.00"
Conversion:
type: object
properties:
id:
type: string
example: "8942caee-f9d5-4600-a894-4811268545db"
amount:
type: string
example: "10000.00"
from_account_id:
type: string
example: "7849cc79-8b01-4793-9345-bc6b5f08acce"
to_account_id:
type: string
example: "105c3e58-0898-4106-8283-dc5781cda07b"
from:
type: string
example: "USD"
to:
type: string
example: "USDC"
FeeRateItem:
type: object
properties:
maker_fee_rate:
type: string
example: "0.0015"
taker_fee_rate:
type: string
example: "0.0025"
usd_volume:
type: string
example: "25000.00"
VolumeItem:
type: object
properties:
product_id:
type: string
example: "BTC-USD"
exchange_volume:
type: string
example: "11800.00000000"
volume:
type: string
example: "100.00000000"
recorded_at:
type: string
example: "1973-11-29T00:05:01.123456Z"
Product:
type: object
properties:
id:
type: string
example: "BTC-USD"
display_name:
type: string
example: "BTC/USD"
base_currency:
type: string
example: "BTC"
quote_currency:
type: string
example: "USD"
base_increment:
type: string
example: "0.00000001"
quote_increment:
type: string
example: "0.01000000"
base_min_size:
type: string
example: "0.00100000"
base_max_size:
type: string
example: "280.00000000"
min_market_funds:
type: string
example: "5"
max_market_funds:
type: string
example: "1000000"
status:
type: string
example: "online"
status_message:
type: string
example: ""
cancel_only:
type: boolean
example: false
limit_only:
type: boolean
example: false
post_only:
type: boolean
example: false
trading_disabled:
type: boolean
example: false
BookItem:
type: object
properties:
price:
type: string
example: "295.96"
size:
type: string
example: "4.39088265"
num_orders:
type: integer
example: 2
Book:
type: object
properties:
sequence:
type: string
example: "3"
bids:
type: array
items:
description: This is actually a BookItem
type: array
items: {}
example: [ "295.96", "4.39088265", 2 ]
Ticker:
type: object
properties:
trade_id:
type: integer
example: 4729088
price:
type: string
example: "333.99"
size:
type: string
example: "0.193"
bid:
type: string
example: "333.98"
ask:
type: string
example: "333.99"
volume:
type: string
example: "5957.11914015"
time:
type: string
example: "2015-11-14T20:46:03.511254Z"
Trade:
type: object
properties:
time:
type: string
example: "2014-11-07T22:19:28.578544Z"
trade_id:
type: integer
example: 74
price:
type: string
example: "10.00000000"
size:
type: string
example: "0.01000000"
side:
type: string
example: "buy"
HistoricRateRequest:
type: object
properties:
start:
type: string
description: Start time in ISO 8601
end:
type: string
description: End time in ISO 8601
granularity:
type: string
description: |
The granularity field must be one of the following values: {60, 300, 900, 3600, 21600, 86400}. Otherwise, your request will be rejected. These values correspond to timeslices representing one minute, five minutes, fifteen minutes, one hour, six hours, and one day, respectively.
enum:
- "60"
- "300"
- "900"
- "3600"
- "21600"
- "86400"
Stats:
type: object
properties:
open:
type: string
example: "6745.61000000"
high:
type: string
example: "7292.11000000"
low:
type: string
example: "6650.00000000"
volume:
type: string
example: "26185.51325269"
last:
type: string
example: "6813.19000000"
volume_30day:
type: string
example: "1019451.11188405"
Currency:
type: object
properties:
id:
type: string
example: "USD"
name:
type: string
example: "United States Dollar"
min_size:
type: string
example: "0.01000000"
status:
type: string
example: "online"
status_message:
type: string
example: null
max_precision:
type: string
example: "0.01"
converitble_to:
type: array
items:
type: string
example: ["USDC"]
details:
type: object
example: {}
Candle:
type: object
properties:
time:
type: integer
example: 1415398768
low:
type: number
example: 0.32
high:
type: number
example: 4.2
open:
type: number
example: 0.35
close:
type: number
example: 4.2
volume:
type: number
example: 12.3
WebsocketSubscribe:
type: object
properties:
type:
type: string
default: subscribe
product_ids:
type: array
items:
type: string
channels:
type: array
items: {}
example: ["level2","heartbeat",{"name": "ticker", "product_ids": ["ETH-BTC","ETH-USD"]}]
WebsocketUnsubscribe:
type: object
properties:
type:
type: string
default: unsubscribe
product_ids:
type: array
items:
type: string
example: ["ETH-USD","ETH-EUR"]
channels:
type: array
items:
type: string
example: "ticker"
WebsocketHeartbeat:
type: object
properties:
type:
type: string
default: heartbeat
sequence:
type: integer
example: 90
last_trade_id:
type: integer
example: 20
product_id:
type: string
example: "BTC-USD"
time:
type: string
example: "2014-11-07T08:19:28.464459Z"
WebsocketStatus:
type: object
properties:
type:
type: string
default: "status"
products:
type: array
items:
$ref: '#/definitions/Product'
currencies:
type: array
items:
$ref: '#/definitions/Currency'
WebsocketTicker:
type: object
properties:
type:
type: string
default: ticket
trade_id:
type: integer
example: 20153558
sequence:
type: integer
example: 3262786978
time:
type: string
example: "2017-09-02T17:05:49.250000Z"
product_id:
type: string
example: "BTC-USD"
price:
type: string
example: "4388.01000000"
side:
type: string
example: "buy"
last_size:
type: string
example: "0.03000000"
best_bid:
type: string
example: "4388"
best_ask:
type: string
example: "4388.01"
WebsocketReceived:
type: object
properties:
type:
type: string
default: "received"
time:
type: string
example: "2017-09-02T17:05:49.250000Z"
product_id:
type: string
example: "BTC-USD"
sequence:
type: integer
example: 90
order_id:
type: string
example: "d50ec984-77a8-460a-b958-66f114b0de9b"
side:
type: string
example: "buy"
order_type:
type: string
example: "limit"
# limit order fields
funds:
type: string
example: "3000.234"
# market order fields
size:
type: string
example: "1.34"
price:
type: string
example: "4388.01000000"
WebsocketOpen:
description: |
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.
type: object
properties:
type:
type: string
default: "open"
time:
type: string
example: "2017-09-02T17:05:49.250000Z"
product_id:
type: string
example: "BTC-USD"
sequence:
type: integer
example: 90
order_id:
type: string
example: "d50ec984-77a8-460a-b958-66f114b0de9b"
side:
type: string
example: "buy"
remaining_size:
type: string
example: "1.34"
price:
type: string
example: "4388.01000000"
WebsocketMatch:
type: object
properties:
type:
type: string
default: "match"
trade_id:
type: integer
example: 10
sequence:
type: integer
example: 90
maker_order_id:
type: string
example: "ac928c66-ca53-498f-9c13-a110027a60e8"
taker_order_id:
type: string
example: "132fb6ae-456b-4654-b4e0-d681ac05cea1"
time:
type: string
example: "2017-09-02T17:05:49.250000Z"
product_id:
type: string
example: "BTC-USD"
size:
type: string
example: "1.34"
price:
type: string
example: "4388.01000000"
side:
type: string
example: "sell"
# set if it was your order that was filled
taker_user_id:
type: string
example: "5844eceecf7e803e259d0365"
user_id:
type: string
example: "5844eceecf7e803e259d0365"
taker_profile_id:
type: string
example: "765d1549-9660-4be2-97d4-fa2d65fa3352"
profile_id:
type: string
example: "765d1549-9660-4be2-97d4-fa2d65fa3352"
WebsocketChange:
type: object
properties:
type:
type: string
default: "change"
time:
type: string
example: "2017-09-02T17:05:49.250000Z"
sequence:
type: integer
example: 90
order_id:
type: string
example: "d50ec984-77a8-460a-b958-66f114b0de9b"
product_id:
type: string
example: "BTC-USD"
side:
type: string
example: "sell"
price:
type: string
example: "400.23"
# one type
new_size:
type: string
example: "5.23512"
old_size:
type: string
example: "12.234412"
# other type
new_funds:
type: string
example: "5.23512"
old_funds:
type: string
example: "12.234412"
WebsocketActivate:
type: object
properties:
type:
type: string
default: "activate"
product_id:
type: string
example: "BTC-USD"
timestamp:
type: string
example: "2017-09-02T17:05:49.250000Z"
user_id:
type: string
example: "5844eceecf7e803e259d0365"
profile_id:
type: string
example: "765d1549-9660-4be2-97d4-fa2d65fa3352"
order_id:
type: string
example: "d50ec984-77a8-460a-b958-66f114b0de9b"
stop_type:
type: string
example: "entry"
side:
type: string
example: "buy"
stop_price:
type: string
example: "80"
size:
type: string
example: "2"
funds:
type: string
example: "2"
private:
type: boolean
example: true
WebsocketSnapshot:
type: object
properties:
type:
type: string
default: "snapshot"
product_id:
type: string
example: "BTC-USD"
bids:
type: array
items:
type: array
items:
type: string
example: ["10101.10", "0.45054140"]
asks:
type: array
items:
type: array
items:
type: string
example: ["10102.55", "0.57753524"]
WebsocketL2Update:
type: object
properties:
type:
type: string
default: "l2update"
product_id:
type: string
example: "BTC-USD"
time:
type: string
example: "2017-09-02T17:05:49.250000Z"
changes:
type: array
items:
type: array
items:
type: string
example: ["buy", "10101.80000000", "0.162567"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment