RFQ - Request for Quote
DRFQv2 - REST Endpoints
DRFQv2: [GET] /instruments
/instruments Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v2/drfq/instruments \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ACCESS_KEY'
const headers = {
'Accept': 'application/json',
'Authorization': 'Bearer ACCESS_KEY'
};
fetch('https://api.testnet.paradigm.trade/v2/drfq/instruments',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v2/drfq/instruments
method = 'GET'
path = '/v2/drfq/instruments?venue=DBT&kind=FUTURE&base_currency=BTC'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(
host+path,
headers=headers
)
print(response.status_code)
print(response.text)
package main
import (
"bytes"
"net/https"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer ACCESS_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := https.NewRequest("GET", "https://api.testnet.paradigm.trade/v2/drfq/instruments", data)
req.Header = headers
client := &https.Client{}
resp, err := client.Do(req)
// ...
}
A [GET] /instruments request returns all instruments that are or were tradeable on Paradigm.
- When
state==ACTIVEusers are able to create markets using the instrument. - When
state==EXPIREDusers are NOT able to create markets using the instrument.
To return complete results, users must paginate by providing the response's next key value for the cursor query string parameter in the subsequent request.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | The cursor value used to paginate through pages. The value to use is the next key value from the response. |
| page_size | query | string | false | The number of elements to return per page. |
| state | query | string | false | The present availability of the Instrument. Valid values include ACTIVE, EXPIRED. |
| venue | query | string | false | The underlying settlement venue to return Instruments for. Valid values include DBT, BIT, BYB. |
| kind | query | string | false | The type of contract. Valid values include FUTURE, OPTION. |
| base_currency | query | string | false | The currency the Instrument is exposed to. Valid values include BTC, ETH, SOL, BCH. |
| venue_instrument_name | query | string | false | The name of the Instrument on the underlying settlement venue. |
| margin_kind | query | string | false | The nature of how the contract is margined. Valid values include LINEAR, INVERSE. |
| include_greeks | query | string | false | To include greeks if available for the Instrument from the underlying settlement venue. Valid values include True and False. |
/instruments Response example
{
"count":2424,
"next":"cD0xODUyNzc=",
"results":[
{
"id": 3614,
"name": "ETH-7APR23",
"created_at": 1679644802000,
"expires_at": 1680854400000,
"kind": "FUTURE",
"venue": "DBT",
"option_kind": null,
"strike": null,
"margin_kind": "INVERSE",
"base_currency": "ETH",
"quote_currency": "USD",
"clearing_currency": "USD",
"settlement_currency": "ETH",
"mark_price": "1714.76",
"min_block_size": "100000",
"min_order_size_increment": "1",
"min_tick_size": "0.01",
"product_code": "AZ",
"venue_instrument_name": "ETH-7APR23",
"state": "ACTIVE",
"greeks": null
},
{
"id": 3613,
"name": "BTC-7APR23",
"created_at": 1679644802000,
"expires_at": 1680854400000,
"kind": "FUTURE",
"venue": "DBT",
"option_kind": null,
"strike": null,
"margin_kind": "INVERSE",
"base_currency": "BTC",
"quote_currency": "USD",
"clearing_currency": "USD",
"settlement_currency": "BTC",
"mark_price": "27091.94",
"min_block_size": "200000",
"min_order_size_increment": "10",
"min_tick_size": "0.01",
"product_code": "CF",
"venue_instrument_name": "BTC-7APR23",
"state": "ACTIVE",
"greeks": null
},
{
"id": 3358,
"name": "ETH-29DEC23-9000-P",
"created_at": 1679101560000,
"expires_at": 1703836800000,
"kind": "OPTION",
"venue": "DBT",
"option_kind": "PUT",
"strike": "9000",
"margin_kind": "INVERSE",
"base_currency": "ETH",
"quote_currency": "ETH",
"clearing_currency": "ETH",
"settlement_currency": "ETH",
"mark_price": "4.1669",
"min_block_size": "250",
"min_order_size_increment": "1",
"min_tick_size": "0.0001",
"product_code": "EH",
"venue_instrument_name": "ETH-29DEC23-9000-P",
"state": "ACTIVE",
"greeks": {
"delta": "-0.99534",
"gamma": "1e-05",
"mark_price": "4.1669",
"theta": "-0.02436",
"vega": "0.206",
"last_updated_at": 1679944965844
}
},
{
"id": 3357,
"name": "ETH-29DEC23-9000-C",
"created_at": 1679101560000,
"expires_at": 1703836800000,
"kind": "OPTION",
"venue": "DBT",
"option_kind": "CALL",
"strike": "9000",
"margin_kind": "INVERSE",
"base_currency": "ETH",
"quote_currency": "ETH",
"clearing_currency": "ETH",
"settlement_currency": "ETH",
"mark_price": "0.0007",
"min_block_size": "250",
"min_order_size_increment": "1",
"min_tick_size": "0.0001",
"product_code": "EH",
"venue_instrument_name": "ETH-29DEC23-9000-C",
"state": "ACTIVE",
"greeks": {
"delta": "0.00466",
"gamma": "1e-05",
"mark_price": "0.0007",
"theta": "-0.02436",
"vega": "0.20599",
"last_updated_at": 1679944965848
}
},
{
"id": 11685,
"name": "SOL_USDC-14APR24-148-P",
"created_at": 1712932380351,
"expires_at": 1713081600000,
"kind": "OPTION",
"venue": "DBT",
"option_kind": "PUT",
"strike": "148",
"margin_kind": "LINEAR",
"base_currency": "SOL",
"quote_currency": "USDC",
"clearing_currency": "SOL",
"settlement_currency": "USDC",
"mark_price": null,
"min_block_size": null,
"min_order_size_increment": "10",
"min_tick_size": "0.05",
"product_code": "OS",
"venue_instrument_name": "SOL_USDC-14APR24-148-P",
"state": "ACTIVE",
"min_gross_premium": "2500",
"greeks": null
},
]
}
Response Schema
Status Code: 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | integer | true | The number of elements returned in the response. |
| next | string | true | Cursor string value to use to paginate results. Equal to null if no more pages are available. |
| results | Array of Objects | true | Array of Objects with details related to specific Instruments. |
| > id | integer | true | The Paradigm created unique identifier of the Instrument. |
| > name | string | true | The Paradigm normalized name of the Instrument to be used across Paradigm’s API. |
| > created_at | decimal | true | The time in UNIX milliseconds since the epoch when the Instrument was created on the underlying settlement venue. |
| > expires_at | decimal | true | The time in UNIX nanoseconds since the epoch when the Instrument settles or is expired on the underlying settlement venue. |
| > kind | string | true | The type of contract. Valid values include OPTION, FUTURE. |
| > venue | string | true | The underlying settlement venue of the Instrument. Valid values include DBT, BIT, BYB. |
| > option_kind | string | true | The kind of Option contract. Valid values include CALL and PUT. null if kind ≠ OPTION. |
| > strike | string | true | The strike of the Option contract. null if kind ≠ OPTION. |
| > margin_kind | string | true | The nature of how the contract is margined. Valid values include LINEAR, INVERSE. |
| > base_currency | string | true | The currency the Instrument is exposed to. Valid values include BTC, ETH, SOL. |
| > quote_currency | string | true | The currency of the price of the Instrument. Valid values include BTC, ETH, SOL, USD, USDC. |
| > clearing_currency | string | true | The currency order sizes/quantities are submitted in. Valid values include BTC, ETH, SOL, USD. |
| > settlement_currency | string | true | The currency the Instrument is settled in on the underlying settlement venue. Valid values include BTC, ETH, SOL, USD, USDC. |
| > min_tick_size | string | true | The minimum price increment step the Instrument can be traded in, denominated in the quote_currency. |
| > min_order_size_increment | string | true | The minimum order increment size/quantity can be traded in, denominated in the clearing_currency. |
| > min_block_size | string | true | The minimum order size/quantity the Instrument can be traded in, denominated in the clearing_currency. The value can be null if not aplicable to the instrument. |
| > min_gross_premium | string | true | The minimum order size/quantity the Instrument can be traded in, denominated in the clearing_currency. The main difference from min_block_size is that min_gross_premium is a calculation of quantity (in clearing_currency) multiplied by price. The value can be null if not aplicable to the instrument. |
| > product_code | string | true | The Paradigm created unique two-letter code to represent the specific Instrument. |
| > venue_instrument_name | string | true | The name of the Instrument on the underlying settlement venue. |
| > state | string | true | The availability of the Instrument to be used in RFQs. Valid values include ACTIVE, EXPIRED. |
| > mark_price | string | true | The “Mark Price” from the underlying settlement venue at the time when the data was pulled. |
| > greeks | string | true | An array of variables used to assess the risk & exposure of a derivatives contract. |
| >> last_updated_at | decimal | true | The time in UNIX milliseconds since the epoch when the information was last updated. |
| >> delta | string | false | The delta value of the Instrument. |
| >> theta | string | false | The theta value of the Instrument. |
| >> vega | string | false | The vega value of the Instrument. |
| >> gamma | string | false | The gamma value of the Instrument. |
| >> mark_price | string | false | The “Mark Price” from the underlying settlement venue at the time when the greeks were pulled. Deprecated: please use the top level mark_price |
Error Codes
| HTTP Status Code | Paradigm Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials were not provided." | You did not provide authentication credentials. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
| 400 | 3005 | "Invalid filter parameter" | You provided invalid value to one or more filter parameters. |
DRFQv2: [GET] /instruments/{instrument_id}
/instruments/{instrument_id} Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v2/drfq/instruments/123 \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ACCESS_KEY'
const headers = {
'Accept': 'application/json',
'Authorization': 'Bearer ACCESS_KEY'
};
fetch('https://api.testnet.paradigm.trade/v2/drfq/instruments/123',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v2/drfq/instruments/{instrument_id}
method = 'GET'
path = '/v2/drfq/instruments/123'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(
host+path,
headers=headers
)
print(response.status_code)
print(response.text)
package main
import (
"bytes"
"net/https"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer ACCESS_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := https.NewRequest("GET", "https://api.testnet.paradigm.trade/isntruments/123", data)
req.Header = headers
client := &https.Client{}
resp, err := client.Do(req)
// ...
}
A [GET] /instruments/{instrument_id} request returns the specific instrument requested in the endpoint.
- When
state==ACTIVEusers are able to create markets using the instrument. - When
state==EXPIREDusers are NOT able to create markets using the instrument.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instrument_id | endpoint | string | true | The Paradigm created unique instrument identifier. |
/instruments/{instrument_id} Response example
200 Response
{
"id": 123,
"name": "ETH-29DEC23-9000-C",
"created_at": 1679101560000,
"expires_at": 1703836800000,
"kind": "OPTION",
"venue": "DBT",
"option_kind": "CALL",
"strike": "9000",
"margin_kind": "INVERSE",
"base_currency": "ETH",
"quote_currency": "ETH",
"clearing_currency": "ETH",
"settlement_currency": "ETH",
"mark_price": "0.0007",
"min_block_size": "250",
"min_gross_premium": null,
"min_order_size_increment": "1",
"min_tick_size": "0.0001",
"product_code": "EH",
"venue_instrument_name": "ETH-29DEC23-9000-C",
"state": "ACTIVE",
"greeks": {
"delta": "0.00466",
"gamma": "1e-05",
"mark_price": "0.0007",
"theta": "-0.02436",
"vega": "0.20599",
"last_updated_at": 1679944965848
}
}
Response Schema
Status Code: 200
| Name | Type | Required | Description |
|---|---|---|---|
| id | integer | true | The Paradigm created unique identifier of the Instrument. |
| name | string | true | The Paradigm normalized name of the Instrument to be used across Paradigm’s API. |
| created_at | decimal | true | The time in UNIX milliseconds since the epoch when the Instrument was created on the underlying settlement venue. |
| expires_at | decimal | true | The time in UNIX milliseconds since the epoch when the Instrument settles or is expired on the underlying settlement venue. |
| kind | string | true | The type of contract. Valid values include OPTION, FUTURE. |
| venue | string | true | The underlying settlement venue of the Instrument. Valid values include DBT, BIT, BYB. |
| option_kind | string | true | The kind of Option contract. Valid values include CALL and PUT. null if kind ≠ OPTION. |
| strike | string | true | The strike of the Option contract. null if kind ≠ OPTION. |
| margin_kind | string | true | The nature of how the contract is margined. Valid values include LINEAR, INVERSE. |
| base_currency | string | true | The currency the Instrument is exposed to. Valid values include BTC, ETH, SOL. |
| quote_currency | string | true | The currency of the price of the Instrument. Valid values include BTC, ETH, SOL, USD, USDC. |
| clearing_currency | string | true | The currency order sizes/quantities are submitted in. Valid values include BTC, ETH, SOL, USD. |
| settlement_currency | string | true | The currency the Instrument is settled in on the underlying settlement venue. Valid values include BTC, ETH, SOL, USD, USDC. |
| min_tick_size | string | true | The minimum price increment step the Instrument can be traded in, denominated in the quote_currency. |
| min_order_size_increment | string | true | The minimum order increment size/quantity can be traded in, denominated in the clearing_currency. |
| min_block_size | string | true | The minimum order size/quantity the Instrument can be traded in, denominated in the clearing_currency. The value can be null if not aplicable to the instrument. |
| min_gross_premium | string | true | The minimum order size/quantity the Instrument can be traded in, denominated in the clearing_currency. The main difference from min_block_size is that min_gross_premium is a calculation of quantity (in clearing_currency) multiplied by price. The value can be null if not aplicable to the instrument. |
| product_code | string | true | The Paradigm created unique two-letter code to represent the specific Instrument. |
| venue_instrument_name | string | true | The name of the Instrument on the underlying settlement venue. |
| state | string | true | The availability of the Instrument to be used in RFQs. Valid values include ACTIVE, EXPIRED. |
| mark_price | string | true | The “Mark Price” from the underlying settlement venue at the time when the data was pulled. |
| greeks | string | true | An array of variables used to assess the risk & exposure of a derivatives contract. |
| > last_updated_at | decimal | false | The time in UNIX milliseconds since the epoch when the information was last updated. |
| > delta | string | false | The delta value of the Instrument. |
| > theta | string | false | The theta value of the Instrument. |
| > vega | string | false | The vega value of the Instrument. |
| > gamma | string | false | The gamma value of the Instrument. |
| > mark_price | string | false | The “Mark Price” from the underlying settlement venue at the time when the greeks were pulled. Deprecated: please use the top level mark_price |
Error Codes
| HTTP Status Code | Paradigm Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials were not provided." | You did not provide authentication credentials. |
| 404 | 3100 | "Unavailable instrument" | Unavailable/invalid instrument id provided in request. |
DRFQv2: [GET] /counterparties
/counterparties Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v2/drfq/counterparties \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ACCESS_KEY'
const headers = {
'Accept': 'application/json',
'Authorization': 'Bearer ACCESS_KEY'
};
fetch('https://api.testnet.paradigm.trade/v2/drfq/counterparties',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v2/drfq/counterparties
method = 'GET'
path = '/v2/drfq/counterparties?group=LP'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(
host+path,
headers=headers
)
print(response.status_code)
print(response.text)
package main
import (
"bytes"
"net/https"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer ACCESS_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := https.NewRequest("GET", "https://api.testnet.paradigm.trade/v2/drfq/counterparties", data)
req.Header = headers
client := &https.Client{}
resp, err := client.Do(req)
// ...
}
A [GET] /counterparties request returns all counterparties the desk is able add as counterparty to an RFQ.
To return complete results, users must paginate by providing the response's next key value for the cursor query string parameter in the subsequent request.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | The cursor value used to paginate through pages. The value to use is the next key value from the response. |
| page_size | query | string | false | The number of elements to return per page. |
| group | query | string | false | The Paradigm created list of the counterparties to return. Valid values include LP. |
| venues | query | string | false | The venues to return counterparties for. You can include multiple venues in a single request by ?venues=DBT,BYB. |
/counterparties Response example
{
"count":548,
"next":"cD0xMjM0",
"results":[
{
"desk_name":"05J2",
"firm_name":"062020",
"groups":[
"FAVORITE"
],
"id": 1,
"venues":[
"DBT"
]
},
{
"desk_name":"05J3",
"firm_name":"062020",
"groups":[
"FAVORITE"
],
"id": 2,
"venues":[
"DBT"
]
},
{
"desk_name":"0729",
"firm_name":"ParadigmShift",
"groups":[
],
"id": 3,
"venues":[
"DBT"
]
},
{
"desk_name":"0817",
"firm_name":"ParadigmShift",
"groups":[
],
"id": 4,
"venues":[
"DBT"
]
},
{
"desk_name":"1234",
"firm_name":"ParadigmShift",
"groups":[
],
"id": 5,
"venues":[
"DBT"
]
}
]
}
Response Schema
Status Code: 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | integer | true | The number of elements returned in the response. |
| next | string | true | Cursor string value to use to paginate results. Equal to null if no more pages are available. |
| results | Array of Objects | true | Array of Objects with details related to specific Counterparties. |
| > firm_name | string | true | The Paradigm created name of the firm of the counterparty. |
| > desk_name | string | true | The Paradigm created name of the desk of the counterparty. |
| > venues | Array of strings | true | The venues the counterparty participates in and you can send RFQs to on Paradigm. |
| > groups | Array of strings | true | The groups the counterparty is a part of. Supported group are Liquidity Providers (LP) and Favorites (FAVORITE). |
| > id | integer | true | The unique identifier for the counterparty. |
Error Codes
| HTTP Status Code | Paradigm Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials were not provided." | You did not provide authentication credentials. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
| 400 | 3005 | "Invalid filter parameter" | You provided invalid value to one or more filter parameters. |
DRFQv2: [GET] /rfqs
/rfqs Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v2/drfq/rfqs \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ACCESS_KEY'
const headers = {
'Accept': 'application/json',
'Authorization': 'Bearer ACCESS_KEY'
};
fetch('https://api.testnet.paradigm.trade/v2/drfq/rfqs',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v2/drfq/rfqs
method = 'GET'
path = '/v2/drfq/rfqs?venue=DBT&state=OPEN'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(
host+path,
headers=headers
)
print(response.status_code)
print(response.text)
package main
import (
"bytes"
"net/https"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer ACCESS_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := https.NewRequest("GET", "https://api.testnet.paradigm.trade/v1/drfq/instruments/", data)
req.Header = headers
client := &https.Client{}
resp, err := client.Do(req)
// ...
}
A [GET] /rfqs request returns all RFQs that are or were actionable.
- When
state==OPENboth the RFQ creator and the specified counterparties are able to action the RFQ. - When
state==CLOSEDboth the RFQ creator and the specified counterparties are NOT able to action the RFQ.
The RFQ creator, denoted by role == TAKER, is able to cancel the RFQ if state == OPEN.
To return complete results, users must paginate by providing the response's next key value for the cursor query string parameter in the subsequent request.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | The cursor value used to paginate through pages. The value to use is the next key value from the response. |
| page_size | query | string | false | The number of elements to return per page. |
| role | query | string | false | The role of the desk in the created RFQ. Valid values include TAKER, MAKER. |
| state | query | string | false | The availability of the RFQ. Valid values include OPEN, CLOSED. |
| venue | query | string | false | The underlying settlement venue to return Instruments for. Valid values include DBT, BIT, BYB. |
| base_currency | query | string | false | The currency the Instrument is exposed to. Valid values include BTC, ETH, SOL. |
| product_codes | query | string | false | The Paradigm created Product Codes of the composite Instruments. The request can contain multiple codes such as ?product_codes=DO,CF. |
/rfqs Response example
{
"count":12239,
"next":"cD0yMDIyLTEyLTA4KzAwJTNBNTglM0EwMC40NDE1MDclMkIwMCUzQTAw",
"results":[
{
"account_name":"ParadigmTestNinetyFive",
"base_currency":"BTC",
"clearing_currency":"BTC",
"closed_reason":"EXPIRED",
"counterparties":[
"DSK94",
"AAT42",
"AAT43",
"AAT44"
],
"created_at":1670461091765.508,
"description":"Call 31 Mar 23 24000",
"expires_at":1670461696044.232,
"id":"r_2IbrOQ3zGMVrOb7RLRKAizy3lgK",
"is_taker_anonymous":true,
"kind":"OPTION",
"label":null,
"last_trade":null,
"last_updated_at":1670461396044.232,
"legs":[
{
"instrument_id":154406,
"instrument_name":"BTC-31MAR23-24000-C",
"product_code":"DO",
"quantity":"25.0000",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"DO"
],
"quantity":"25.0000",
"quote_currency":"BTC",
"role":"TAKER",
"side_layering_limit":1,
"state":"CLOSED",
"strategy_code":"CL",
"strategy_description":"DO_BTC-31MAR23-24000-C",
"group_signature":"891e9830b2dcd30747caea878323e30d52356f0c1b50449ccb666e0e530b296a",
"taker_desk_name":"DSK95",
"venue":"DBT",
"taker_profile": {
"average_taker_fill_rate": "NEW",
},
},
{
"account_name":"ParadigmTestNinetyFive",
"base_currency":"BTC",
"clearing_currency":"BTC",
"closed_reason":"EXPIRED",
"counterparties":[
"DSK94",
"AAT42",
"AAT43",
"AAT44"
],
"created_at":1670461080441.507,
"description":"Cstm +1 Call 30 Jun 23 28000\n +2 Call 8 Dec 22 14000",
"expires_at":1670461681005.817,
"id":"r_2IbrN2Jt8tM8HQG0SHz6JTXaUz0",
"is_taker_anonymous":true,
"kind":"OPTION",
"label":null,
"last_trade":null,
"last_updated_at":1670461381005.817,
"legs":[
{
"instrument_id":154716,
"instrument_name":"BTC-30JUN23-28000-C",
"product_code":"DO",
"quantity":"25.0000",
"ratio":"1",
"side":"BUY"
},
{
"instrument_id":185066,
"instrument_name":"BTC-8DEC22-14000-C",
"product_code":"DO",
"quantity":"50.0000",
"ratio":"2",
"side":"BUY"
}
],
"product_codes":[
"DO"
],
"quantity":"25.0000",
"quote_currency":"BTC",
"role":"TAKER",
"side_layering_limit":1,
"state":"CLOSED",
"strategy_code":"CL",
"strategy_description":"DO_BTC-30JUN23-28000-C_BTC-8DEC22-14000-C",
"group_signature":"891e9830b2dcd30747caea878323e30d52356f0c1b50449ccb666e0e530b296a",
"taker_desk_name":"DSK95",
"venue":"DBT",
"taker_profile": {
"average_taker_fill_rate": "50%",
},
}
]
}
Response Schema
Status Code: 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | integer | true | The number of elements returned in the response. |
| next | string | true | Cursor string value to use to paginate results. Equal to null if no more pages are available. |
| results | Array of Objects | true | Array of Objects with details related to specific Instruments. |
| > id | string | true | The Paradigm created unique identifier of the RFQ. |
| > account_name | string | true | The user given name of the Venue API Credentials on the Client Admin Dashboard. A null value is returned if role == MAKER. |
| > created_at | decimal | true | The time in UNIX milliseconds since the epoch when the RFQ was created. |
| > expires_at | decimal | true | The time in UNIX milliseconds since the epoch when the RFQ expires. |
| > last_updated_at | decimal | true | The time in UNIX milliseconds since the epoch when the RFQ was last updated. |
| > strategy_description | string | true | The standardized description of the RFQ’s composite Instruments. |
| > strategy_code | string | true | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
| > description | string | true | The verbose description of the RFQ’s composite Instruments. |
| > venue | string | true | The underlying settlement venue of the RFQ. Valid values include DBT, BIT, BYB. |
| > kind | string | true | The composite Instrument kinds of the RFQ. Valid values include FUTURE, OPTION, OPTION_FUTURE. |
| > base_currency | string | true | The currency the RFQ is exposed to. Valid values include BTC, ETH, SOL. |
| > quote_currency | string | true | The currency of the price of the RFQ. Valid values include BTC, ETH, SOL, USD, USDC. |
| > clearing_currency | string | true | The currency order sizes/quantities are submitted in. Valid values include BTC, ETH, SOL, USD. |
| > counterparties | Array of strings | true | The Paradigm Desk Names the RFQ was directed towards. An empty array is returned if role == MAKER. |
| > role | string | true | The role of the user to the RFQ. Valid values include TAKER, MAKER. |
| > group_signature | string | true | A hash representing the RFQ structure and its creator. It keeps the taker desk anonymous if the RFQ is defined as such. |
| > taker_desk_name | string | true | The Paradigm Desk Name who created the RFQ. null if role == MAKER and is_taker_anonymous == True. |
| > legs | Array of Objects | true | The composite Instrument legs of the RFQ. |
| >> instrument_id | integer | true | The Paradigm created unique identifier of the Instrument. |
| >> instrument_name | string | true | The Paradigm normalized name of the Instrument to be used across Paradigm’s API. |
| >> product_code | string | true | The Paradigm created unique two-letter code to represent the specific Instrument. |
| >> ratio | string | true | The relative multiplier applied to the quantity of the Instrument’s amount relative to the amount of the RFQ. Maximum of 2 decimal places. |
| >> side | string | true | The direction of the composite leg relative to the RFQ. Valid values include BUY, SELL. |
| >> quantity | string | true | The size of the Instrument leg to the RFQ, denominated in the clearing_currency of the Instrument. |
| >> price | string | false | The price of the Instrument leg to the RFQ, denominated in the quote_currency of the Instrument. null if the Instrument is not a hedge leg. Hedge legs must be kind == FUTURE. |
| > product_codes | Array of strings | true | The Paradigm created Product Codes of the composite Instruments to the RFQ. |
| > quantity | string | true | The total size of the composite Instrument legs, denominated in the clearing_currency. |
| > is_taker_anonymous | boolean | true | If the Taker Desk Name is to be revealed to the counterparties to the RFQ. |
| > label | string | true | RFQ creator label of the RFQ. |
| > side_layering_limit | integer | true | The maximum number of Orders a Maker is able to have either side of an RFQ. |
| > state | string | true | The availability of the RFQ to trade. Valid values include OPEN, CLOSED. |
| > closed_reason | string | true | The reason the RFQ is no longer available. Valid values include CANCELED_BY_CREATOR, EXPIRED, EXECUTION_LIMIT. null if the RFQ’s state == OPEN. |
| > taker_profile | json | false | Taker profile information. Only available for anonymous RFQs and PRIME users. |
| >> average_taker_fill_rate | string | false | Average taker fill rate. Valid values include RARE, NEW, and following buckets: 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100% |
Error Codes
| HTTP Status Code | Paradigm Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials were not provided." | You did not provide authentication credentials. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
| 400 | 3005 | "Invalid filter parameter" | You provided invalid value to one or more filter parameters. |
DRFQv2: [GET] /rfqs/{rfq_id}
/rfqs/{rfq_id} Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v2/drfq/rfqs/123 \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ACCESS_KEY'
const headers = {
'Accept': 'application/json',
'Authorization': 'Bearer ACCESS_KEY'
};
fetch('https://api.testnet.paradigm.trade/v2/drfq/rfqs/123',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v2/drfq/rfqs/{rfq_id}
method = 'GET'
path = '/v2/drfq/rfqs/123'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(
host+path,
headers=headers
)
print(response.status_code)
print(response.text)
package main
import (
"bytes"
"net/https"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer ACCESS_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := https.NewRequest("GET", "https://api.testnet.paradigm.trade/v1/drfq//rfqs/123", data)
req.Header = headers
client := &https.Client{}
resp, err := client.Do(req)
// ...
}
A [GET] /rfqs/{rfq_id} request returns the specific RFQ requested in the endpoint.
- When
state==OPENboth the RFQ creator and the specified counterparties are able to action the RFQ. - When
state==CLOSEDboth the RFQ creator and the specified counterparties are NOT able to action the RFQ.
The RFQ creator, denoted by role == TAKER, is able to cancel the RFQ if state == OPEN.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| rfq_id | endpoint | string | true | The Paradigm created unique RFQ identifier. |
/rfqs/{rfq_id} Response example
{
"account_name":"ParadigmTestNinetyFive",
"base_currency":"BTC",
"clearing_currency":"BTC",
"closed_reason":"EXPIRED",
"counterparties":[
"DSK94",
"AAT42",
"AAT43",
"AAT44"
],
"created_at":1670461091765.508,
"description":"Call 31 Mar 23 24000",
"expires_at":1670461696044.232,
"id":"r_2IbrOQ3zGMVrOb7RLRKAizy3lgK",
"is_taker_anonymous":true,
"kind":"OPTION",
"label":null,
"last_trade":null,
"last_updated_at":1670461396044.232,
"legs":[
{
"instrument_id":154406,
"instrument_name":"BTC-31MAR23-24000-C",
"product_code":"DO",
"quantity":"25.0000",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"DO"
],
"quantity":"25.0000",
"quote_currency":"BTC",
"role":"TAKER",
"side_layering_limit":1,
"state":"CLOSED",
"strategy_code": "CL",
"strategy_description":"DO_BTC-31MAR23-24000-C",
"group_signature":"891e9830b2dcd30747caea878323e30d52356f0c1b50449ccb666e0e530b296a",
"taker_desk_name":"DSK95",
"venue":"DBT",
"taker_profile": {
"average_taker_fill_rate": "50%",
},
}
Response Schema
Status Code: 200
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | true | The Paradigm created unique identifier of the RFQ. |
| account_name | string | true | The user given name of the Venue API Credentials on the Client Admin Dashboard. A null value is returned if role == MAKER. |
| created_at | decimal | true | The time in UNIX milliseconds since the epoch when the RFQ was created. |
| expires_at | decimal | true | The time in UNIX milliseconds since the epoch when the RFQ expires. |
| last_updated_at | decimal | true | The time in UNIX milliseconds since the epoch when the RFQ was last updated. |
| strategy_code | string | true | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
| strategy_description | string | true | The standardized description of the RFQ’s composite Instruments. |
| description | string | true | The verbose description of the RFQ’s composite Instruments. |
| venue | string | true | The underlying settlement venue of the RFQ. Valid values include DBT, BIT, BYB. |
| kind | string | true | The composite Instrument kinds of the RFQ. Valid values include FUTURE, OPTION, OPTION_FUTURE. |
| base_currency | string | true | The currency the RFQ is exposed to. Valid values include BTC, ETH, SOL. |
| quote_currency | string | true | The currency of the price of the RFQ. Valid values include BTC, ETH, SOL, USD, USDC. |
| clearing_currency | string | true | The currency order sizes/quantities are submitted in. Valid values include BTC, ETH, SOL, USD. |
| counterparties | Array of strings | true | The Paradigm Desk Names the RFQ was directed towards. An empty array is returned if role == MAKER. |
| role | string | true | The role of the user to the RFQ. Valid values include TAKER, MAKER. |
| group_signature | string | true | A hash representing the RFQ structure and its creator. It keeps the taker desk anonymous if the RFQ is defined as such. |
| taker_desk_name | string | true | The Paradigm Desk Name who created the RFQ. null if role == MAKER and is_taker_anonymous == True. |
| legs | Array of Objects | true | The composite Instrument legs of the RFQ. |
| > instrument_id | integer | true | The Paradigm created unique identifier of the Instrument. |
| > instrument_name | string | true | The Paradigm normalized name of the Instrument to be used across Paradigm’s API. |
| > product_code | string | true | The Paradigm created unique two-letter code to represent the specific Instrument. |
| > ratio | string | true | The relative multiplier applied to the quantity of the Instrument’s amount relative to the amount of the RFQ. Maximum of 2 decimal places. |
| > side | string | true | The direction of the composite leg relative to the RFQ. Valid values include BUY, SELL. |
| > quantity | string | true | The size of the Instrument leg to the RFQ, denominated in the clearing_currency of the Instrument. |
| > price | string | false | The price of the Instrument leg to the RFQ, denominated in the quote_currency of the Instrument. null if the Instrument is not a hedge leg. Hedge legs must be kind == FUTURE. |
| product_codes | Array of strings | true | The Paradigm created Product Codes of the composite Instruments to the RFQ. |
| quantity | string | true | The total size of the composite Instrument legs, denominated in the clearing_currency. |
| is_taker_anonymous | boolean | true | If the Taker Desk Name is to be revealed to the counterparties to the RFQ. |
| label | string | true | RFQ creator label of the RFQ. |
| side_layering_limit | integer | true | The maximum number of Orders a Maker is able to have either side of an RFQ. |
| state | string | true | The availability of the RFQ to trade. Valid values include OPEN, CLOSED. |
| closed_reason | string | true | The reason the RFQ is no longer available. Valid values include CANCELED_BY_CREATOR, EXPIRED, EXECUTION_LIMIT. null if the RFQ’s state == OPEN. |
| > taker_profile | json | false | Taker profile information. Only available for anonymous RFQs and PRIME users. |
| >> average_taker_fill_rate | string | false | Average taker fill rate. Valid values include RARE, NEW, and following buckets: 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100% |
Error Codes
| HTTP Status Code | Paradigm Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials were not provided." | You did not provide authentication credentials. |
| 404 | 3300 | "Unavailable RFQ" | Unavailable/invalid RFQ Id provided in request. |
DRFQv2: [POST] /rfqs
/rfqs Request example
# You can also use wget
curl -X POST https://api.testnet.paradigm.trade/v2/drfq/rfqs \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ACCESS_KEY'
const inputBody = `{
"account_name": "ParadigmTestNinetyFive",
"venue": "DBT",
"quantity": "100",
"is_taker_anonymous": true,
"counterparties": ["DSK2", "DSK3", "DSK4"],
"legs": [
{
"instrument_id": 12314,
"ratio": "1",
"side": "SELL"
}
]
}`;
const headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer ACCESS_KEY'
};
fetch('https://api.testnet.paradigm.trade/v2/drfq/rfqs',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# built ins
import base64
import hmac
import time
import json
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# POST /v2/drfq/rfqs
method = 'POST'
path = '/v2/drfq/rfqs'
payload = {
"account_name": "ParadigmTestNinetyFive",
"venue": "DBT",
"quantity": "100",
"is_taker_anonymous": True,
"counterparties": ["DSK2", "DSK3", "DSK4"],
"legs": [
{
"instrument_id": 12314,
"ratio": "1",
"side": "SELL"
}
]
}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.post(
host+path,
headers=headers,
json=payload
)
print(response.status_code)
print(response.text)
package main
import (
"bytes"
"net/https"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer ACCESS_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := https.NewRequest("POST", "https://api.testnet.paradigm.trade/v2/drfq/rfqs", data)
req.Header = headers
client := &https.Client{}
resp, err := client.Do(req)
// ...
}
A [POST] /rfqs request attempts to create an RFQ.
The creator of the RFQ will have the role == TAKER.
Only desks specified as counterparties in the request are able receive the RFQ & return prices. The desks aparty to the RFQ must price the full size requested in the RFQ as no partial fills are possible.
On RFQ creation we validate quantities and, for some instruments, we validate the min_gross_premium, which is a calculation based on quantity (in clearing_currency) * mark_price of the strategy legs instruments. For RFQ create we add a 20% limit on top of the Minimum Gross Premium to reduce the RFQ out of the limit while price changes.
So for example if a specific instrument has min_gross_premium of 2500 on RFQ create we validate at 3000 in clearing_currency amount. On order submission we allow the limit without the 20% increment, in this example 2500.
/rfqs Body parameter example
{
"account_name":"ParadigmTestNinetyFive",
"venue": "DBT",
"quantity": "100",
"is_taker_anonymous": true,
"counterparties": ["DSK2", "DSK3", "DSK4"],
"legs": [
{
"instrument_id": 12314,
"ratio": "1",
"side": "SELL"
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| account_name | body | string | true | The user given name of the Venue API Credentials on the Client Admin Dashboard. |
| venue | body | string | true | The underlying settlement venue of the RFQ. Valid values include DBT, BIT, BYB. |
| quantity | body | string | true | The total size of the composite Instrument legs, denominated in the clearing_currency. |
| is_taker_anonymous | body | boolean | true | If the Taker Desk Name is to be revealed to the counterparties to the RFQ. Required to send RFQ to at least 3 LPs |
| counterparties | body | Array of strings | true | The Paradigm Desk Names or groups aparty to the RFQ. |
| label | body | string | false | User defined label for the RFQ. |
| legs | body | Array of Objects | true | The composite Instruments of the RFQ. |
| > instrument_id | body | integer | true | The Paradigm unique identifier of the Instrument. |
| > ratio | body | string | true | The relative multiplier applied to the quantity of the Instrument’s quantity relative to the quantity of the RFQ. Maximum of 2 decimal places. |
| > side | body | string | true | The direction of the composite leg relative to the RFQ. Valid values include BUY, SELL. |
| > price | body | string | false | The price of the leg, for hedge legs only, in the quote_currency of the Instrument. |
/rfqs Response example
201 Response
{
"id": "12312441241",
"account_name": "ParadigmTestNinetyFive",
"created_at": 1656095317329249937.1,
"expires_at": 1656095317329249938.1,
"last_updated_at": 1656095317329249939.1,
"strategy_code": "PT",
"strategy_description": "DO_BTC-9JUL21-32000-P",
"description": "Put 9 Jul 21 32000",
"venue": "DBT",
"base_currency": "BTC",
"quote_currency": "BTC",
"clearing_currency": "BTC",
"counterparties": ["DSK2", "DSK3"],
"role": "TAKER",
"group_signature":"891e9830b2dcd30747caea878323e30d52356f0c1b50449ccb666e0e530b296a",
"taker_desk_name": "DSK95",
"legs": [
{
"instrument_id": 123213213,
"instrument_name": "BTC-9PUT21-32000-C",
"product_code": "DO"
"ratio": "1",
"side": "SELL",
"amount": "100"
}
],
"product_codes": ["DO"],
"amount": "100",
"is_taker_anonymous": false,
"side_layering_limit": 1,
"state": "ACTIVE"
}
Response Schema
Status Code: 201
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | true | The Paradigm created unique identifier of the RFQ. |
| account_name | string | true | The user given name of the Venue API Credentials on the Client Admin Dashboard. |
| created_at | decimal | true | The time in UNIX milliseconds since the epoch when the RFQ was created. |
| expires_at | decimal | true | The time in UNIX milliseconds since the epoch when the RFQ expires. |
| last_updated_at | decimal | true | The time in UNIX milliseconds since the epoch when the RFQ was last updated. |
| strategy_code | string | true | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
| strategy_description | string | true | The standardized description of the RFQ’s composite Instruments. |
| description | string | true | The verbose description of the RFQ’s composite Instruments. |
| venue | string | true | The underlying settlement venue of the RFQ. Valid values include DBT, BIT, BYB. |
| base_currency | string | true | The currency the RFQ is exposed to. Valid values include BTC, ETH, SOL. |
| quote_currency | string | true | The currency of the price of the RFQ. Valid values include BTC, ETH, SOL, USD, USDC. |
| clearing_currency | string | true | The currency order sizes/quantities are submitted in. Valid values include BTC, ETH, SOL, USD. |
| counterparties | Array of strings | true | The Paradigm Desk Names the RFQ was directed towards. An empty array is returned if role == MAKER. |
| role | string | true | The role of the user to the RFQ. Valid values include TAKER, MAKER. |
| group_signature | string | true | A hash representing the RFQ structure and its creator. It keeps the taker desk anonymous if the RFQ is defined as such. |
| taker_desk_name | string | true | The Paradigm Desk Name who created the RFQ. null if role == MAKER and is_taker_anonymous == True. |
| legs | Array of Objects | true | The composite Instrument legs of the RFQ. |
| > instrument_id | integer | true | The Paradigm created unique identifier of the Instrument. |
| > instrument_name | string | true | The Paradigm normalized name of the Instrument to be used across Paradigm’s API. |
| > product_code | string | true | The Paradigm created unique two-letter code to represent the specific Instrument. |
| > ratio | string | true | The relative multiplier applied to the quantity of the Instrument’s amount relative to the amount of the RFQ. Maximum of 2 decimal places. |
| > side | string | true | The direction of the composite leg relative to the RFQ. Valid values include BUY, SELL. |
| > quantity | string | true | The size of the Instrument leg to the RFQ, denominated in the clearing_currency of the Instrument. |
| > price | string | false | The price of the Instrument leg to the RFQ, denominated in the quote_currency of the Instrument. null if the Instrument is not a hedge leg. Hedge legs must be kind == FUTURE. |
| product_codes | Array of strings | true | The Paradigm created Product Codes of the composite Instruments to the RFQ. |
| quantity | string | true | The total size of the composite Instrument legs, denominated in the clearing_currency. |
| is_taker_anonymous | boolean | true | If the Taker Desk Name is to be revealed to the counterparties to the RFQ. |
| label | string | true | RFQ creator label of the RFQ. |
| side_layering_limit | integer | true | The maximum number of Orders a Maker is able to have either side of an RFQ. |
| state | string | true | The availability of the RFQ to trade. Valid values include OPEN and CLOSED. |
Error Codes
| HTTP Status Code | Paradigm Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials were not provided." | You did not provide authentication credentials. |
| 400 | 100 | "Invalid parameters" | You provided invalid value to one or more parameters. |
| 400 | 1302 | "Invalid account information" | The value provided with the account key should match the name given to the Exchange API key on the Paradigm Client Admin Dashboard. |
| 400 | 1306 | "Invalid instrument" | You provided invalid instrument for one or more legs. |
| 400 | 3001 | "Venue is not currently supported for this product" | Provided venue is not supported. |
| 400 | 3002 | "Invalid leg pricing parameters" | You provided invalid price value for one or more legs. |
| 400 | 3200 | "Invalid RFQ leg configuration" | You provided invalid configuration of legs. |
| 400 | 3203 | "Invalid leg parameters" | You provided invalid value to one or more leg parameters. |
| 400 | 3206 | "An open RFQ for this strategy already exists. Please close that rfq before submitting a new one." | There already exist an open RFQ for the same strategy. |
| 400 | 3401 | "Price is outside bands." | You provided price that is outside of venue's price bands. |
DRFQv2: [DELETE] /rfqs/{rfq_id}
/rfqs/{rfq_id} Request example
# You can also use wget
curl -X DELETE https://api.testnet.paradigm.trade/v2/drfq/rfqs/123 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ACCESS_KEY'
const inputBody = ``;
const headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer ACCESS_KEY'
};
fetch('https://api.testnet.paradigm.trade/v2/drfq/rfqs/123',
{
method: 'DELETE',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# DELETE /v2/drfq/rfqs/{rfq_id}
method = 'DELETE'
path = '/v2/drfq/rfqs/123'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.delete(
host+path,
headers=headers
)
print(response.status_code)
print(response.text)
package main
import (
"bytes"
"net/https"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer ACCESS_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := https.NewRequest("DELETE", "https://api.testnet.paradigm.trade/v2/drfq/rfqs/123", data)
req.Header = headers
client := &https.Client{}
resp, err := client.Do(req)
// ...
}
A [DELETE] /rfqs/{rfq_id} request attempts to cancel a desks' RFQ.
An RFQ's state must equal OPEN for it to be canceled.
Response Schema
Status Code: 204
There is no response payload.
Error Codes
| HTTP Status Code | Paradigm Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials were not provided." | You did not provide authentication credentials. |
| 400 | 3207 | "Too late to cancel RFQ" | RFQ has already expired or been filled. |
| 404 | 3300 | "Unavailable RFQ" | Unavailable/invalid RFQ Id provided in request. |
DRFQv2: [GET] /rfqs/{rfq_id}/orders
/rfqs/{rfq_id}/orders Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v2/drfq/rfqs/123/orders \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ACCESS_KEY'
const headers = {
'Accept': 'application/json',
'Authorization': 'Bearer ACCESS_KEY'
};
fetch('https://api.testnet.paradigm.trade/v2/drfq/rfqs/123/orders',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v2/drfq/rfqs/{rfq_id}/orders
method = 'GET'
path = '/v2/drfq/rfqs/123/orders'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(
host+path,
headers=headers
)
print(response.status_code)
print(response.text)
package main
import (
"bytes"
"net/https"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer ACCESS_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := https.NewRequest("GET", "https://api.testnet.paradigm.trade/v2/drfq/rfqs/123/orders", data)
req.Header = headers
client := &https.Client{}
resp, err := client.Do(req)
// ...
}
A [GET] /rfqs/{rfq_id}/orders request allows you to return all state == OPEN orders upon an RFQ.
Only the desk who created the RFQ, role == TAKER, is able to request this endpoint for the RFQ.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| rfq_id | endpoint | string | true | The Paradigm created unique RFQ identifier. |
/rfqs/{rfq_id}/orders Example response for non-anonymous rfq order
200 Response
{
"id": "12312441241",
"bids": [
{
"price": "0.001",
"quantity": "10.01",
"id": "12321321321",
"desk": "LDGR"
}
],
"asks": []
}
/rfqs/{rfq_id}/orders Example response for anonymous rfq order (desk value will be null)
200 Response
{
"id": "r_2TTnJU8QycV3NJH48awnmRSJqGA",
"asks": [
{
"id": "o_2TTnWgBg0m1UkvcHJy2stTTXe9m",
"price": "0.009",
"quantity": "25",
"desk": null
}
],
"bids": [
{
"id": "o_2TTnWgBFaE4cNcYtxIberH4UcSJ",
"price": "0.0085",
"quantity": "25",
"desk": null
}
]
}
Response Schema
Status Code: 200
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | true | The Paradigm created unique identifier of the RFQ. |
| bids | Array of Objects | true | An array of Order objects offering to BUY the RFQ. |
| > price | string | true | The price of the bid, denominated in the quote_currency of the RFQ. |
| > quantity | string | true | The amount of the bid, denominated in the clearing_currency of the RFQ. |
| > id | string | true | The Paradigm created unique identifier of the Order. |
| > desk | string | true | The Paradigm Desk Name of the creator of the Order. |
| asks | string | true | An array of Order objects offering to SELL the RFQ. |
| > price | string | true | The price of the ask, denominated in the quote_currency of the RFQ. |
| > quantity | string | true | The amount of the ask, denominated in the clearing_currency of the RFQ. |
| > id | string | true | The Paradigm created unique identifier of the Order. |
| > desk | string | true | The Paradigm Desk Name of the creator of the Order. |
Error Codes
| HTTP Status Code | Paradigm Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials were not provided." | You did not provide authentication credentials. |
| 404 | 3300 | "Unavailable RFQ" | Unavailable/invalid RFQ Id provided in request. |
DRFQv2: [GET] /orders
/orders Request examples
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v2/drfq/orders \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ACCESS_KEY'
;
fetch('https://api.testnet.paradigm.trade/v2/drfq/orders',
{
method: 'GET',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v2/drfq/orders
method = 'GET'
path = '/v2/drfq/orders?page_size=50&cursor=12331a'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(
host+path,
headers=headers
)
print(response.status_code)
print(response.text)
package main
import (
"bytes"
"net/https"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer ACCESS_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := https.NewRequest("GET", "https://api.testnet.paradigm.trade/v2/drfq/orders", data)
req.Header = headers
client := &https.Client{}
resp, err := client.Do(req)
// ...
}
A [GET] /orders request allows you to return all of your desks' Orders.
To return complete results, users must paginate by providing the response's next key value for the cursor query string parameter in the subsequent request.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | The cursor value used to paginate through pages. The value to use is the next key value from the response. |
| page_size | query | string | false | The number of elements to return per page. |
| rfq_id | query | string | false | The Paradigm created unique identifier of the associated RFQ. |
| state | query | string | false | The availability of the Order for the user to action. Valid values include OPEN, CLOSED. |
| venue | query | string | false | The underlying settlement venue to return Instruments for. Valid values include DBT, BIT, BYB. |
| base_currency | query | string | false | The currency the Instrument is exposed to. Valid values include BTC, ETH, SOL. |
/orders Example response
200 Response
{
"count":8939,
"next":"cD0yMDIyLTEyLTA4KzAwJTNBNDAlM0E1MS40MDc3OTElMkIwMCUzQTAw",
"results":[
{
"account_name":"ParadigmTestNinetyFive",
"canceled_quantity":"0",
"created_at":1670460131779.387,
"filled_quantity":"50",
"id":"o_2IbpRmLbgT7yUGl3lgGD9GogSQ1",
"label":"mmh",
"last_updated_at":1670460132524.4802,
"pending_fill_quantity":"0",
"price":"0.2397",
"quantity":"50",
"rfq_id":"r_2IbpMsUESAt5bfVEQp7c32SbIDJ",
"role":"TAKER",
"side":"BUY",
"state":"CLOSED",
"time_in_force":"FILL_OR_KILL",
"type":"LIMIT",
"venue":"DBT",
"legs": [
{
"instrument_id": 194874,
"price": "0.2"
}
]
},
{
"account_name":"ParadigmTestNinetyFive",
"canceled_quantity":"0",
"created_at":1670460088632.3892,
"filled_quantity":"0",
"id":"o_2IbpMNIiq6dPAlikmKaMJRmkDpQ",
"label":"mmh",
"last_updated_at":1670460088700.561,
"pending_fill_quantity":"25",
"price":"-0.7927",
"quantity":"25",
"rfq_id":"r_2IbpH63lIEI9UCpHS8uBTEy7h75",
"role":"TAKER",
"side":"BUY",
"state":"CLOSED",
"time_in_force":"FILL_OR_KILL",
"type":"LIMIT",
"venue":"DBT",
"legs": [
{
"instrument_id": 194874,
"price": "0.2"
}
]
},
{
"account_name":"ParadigmTestNinetyFive",
"canceled_quantity":"0",
"created_at":1670460086147.604,
"filled_quantity":"25",
"id":"o_2IbpM7f1EFwm4570NdZARA4IpL2",
"label":"mmh",
"last_updated_at":1670460086613.062,
"pending_fill_quantity":"0",
"price":"0.2724",
"quantity":"25",
"rfq_id":"r_2IbpLUknqWjvjJYJxMpt4uv36Lr",
"role":"TAKER",
"side":"BUY",
"state":"CLOSED",
"time_in_force":"FILL_OR_KILL",
"type":"LIMIT",
"venue":"DBT",
"legs": [
{
"instrument_id": 194874,
"price": "0.2"
}
]
},
{
"account_name":"ParadigmTestNinetyFive",
"canceled_quantity":"25",
"created_at":1670460083979.475,
"filled_quantity":"0",
"id":"o_2IbpLkNx8hRgOfRO9aj40WvbXzR",
"label":"mmh",
"last_updated_at":1670460084428.182,
"pending_fill_quantity":"0",
"price":"-0.7929",
"quantity":"25",
"rfq_id":"r_2IbpH63lIEI9UCpHS8uBTEy7h75",
"role":"TAKER",
"side":"BUY",
"state":"CLOSED",
"time_in_force":"FILL_OR_KILL",
"type":"LIMIT",
"venue":"DBT",
"legs": [
{
"instrument_id": 194874,
"price": "0.2"
}
]
},
{
"account_name":"ParadigmTestNinetyFive",
"canceled_quantity":"0",
"created_at":1670460051407.791,
"filled_quantity":"0",
"id":"o_2IbpHizejRbn6OXzJmsX0geCIxI",
"label":"mmh",
"last_updated_at":1670460051449.946,
"pending_fill_quantity":"250",
"price":"-3.0158",
"quantity":"250",
"rfq_id":"r_2IbpBRNYSQLfTHvyUNtjmxqB9zm",
"role":"TAKER",
"side":"BUY",
"state":"CLOSED",
"time_in_force":"FILL_OR_KILL",
"type":"LIMIT",
"venue":"DBT",
"legs": [
{
"instrument_id": 194874,
"price": "0.2"
}
]
}
]
}
Response Schema
Status Code: 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | integer | true | The number of elements returned in the response. |
| next | string | true | Cursor string value to use to paginate results. Equal to null if no more pages are available. |
| results | Array of Objects | true | Array of Objects with details related to specific Instruments. |
| > id | string | true | The Paradigm created unique identifier of the Order. |
| > rfq_id | string | true | The Paradigm created unique identifier of the associated RFQ. |
| > state | string | true | The availability of the Order for the user to action. Valid values include OPEN, CLOSED. |
| > side | string | true | The direction of the Order. Valid values include BUY, SELL. |
| > type | string | true | The type of Order. Valid values include LIMIT. |
| > time_in_force | string | true | The validity protocol of the Order. Valid values include GOOD_TILL_CANCELED, FILL_OR_KILL. |
| > created_at | decimal | true | The time in UNIX milliseconds since the epoch when the Order was created. |
| > last_updated_at | decimal | true | The time in UNIX milliseconds since the epoch when the Order was last updated. |
| > venue | string | true | The underlying settlement venue associated with the Order & RFQ. Valid values include DBT, BIT, BYB. |
| > quantity | string | true | The size of the Order, denominated in the clearing_currency of the RFQ. |
| > legs | Array of Objects | true | The composite Instrument legs of the Order. |
| >> instrument_id | integer | true | The Paradigm created unique identifier of the Instrument. |
| >> price | string | true | The price of the Instrument leg, denominated in the quote_currency of the RFQ. |
| > price | string | true | The price of the Order, denominated in the quote_currency of the RFQ. |
| > label | string | true | The user created label for the order. |
| > pending_fill_quantity | string | true | The amount of the Order pending settlement on the underlying settlement venue, denominated in the clearing_currency of the RFQ. |
| > filled_quantity | string | true | The amount of the Order which has been successfully settled on the underlying settlement venue, denominated in the clearing_currency of the RFQ. |
| > canceled_quantity | string | true | The amount of the Order which has been canceled, denominated in the clearing_currency of the RFQ. |
| > account_name | string | true | The user given name of the Venue API Credentials on the Client Admin Dashboard. |
| > role | string | true | The role of the user in the RFQ. Valid values include TAKER, MAKER. |
Error Codes
| HTTP Status Code | Paradigm Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials were not provided." | You did not provide authentication credentials. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
| 400 | 3005 | "Invalid filter parameter" | You provided invalid value to one or more filter parameters. |
DRFQv2: [GET] /orders/{order_id}
/orders/{order_id} Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v2/drfq/orders/123 \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ACCESS_KEY'
const headers = {
'Accept': 'application/json',
'Authorization': 'Bearer ACCESS_KEY'
};
fetch('https://api.testnet.paradigm.trade/v2/drfq/orders/123',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v2/drfq/orders/{order_id}
method = 'GET'
path = '/v2/drfq/orders/123'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(
host+path,
headers=headers
)
print(response.status_code)
print(response.text)
package main
import (
"bytes"
"net/https"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer ACCESS_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := https.NewRequest("GET", "https://api.testnet.paradigm.trade/v2/drfq/orders/123", data)
req.Header = headers
client := &https.Client{}
resp, err := client.Do(req)
// ...
}
A [GET] /orders/{order_id} request returns the specified Order in the endpoint.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| order_id | endpoint | string | true | The Paradigm created unique Order identifier. |
/orders/{order_id} Response example
200 Response
{
"account_name":"ParadigmTestNinetyFive",
"canceled_quantity":"0",
"created_at":1670460051407.791,
"filled_quantity":"0",
"id":"o_2IbpHizejRbn6OXzJmsX0geCIxI",
"label":"mmh",
"last_updated_at":1670460051449.946,
"pending_fill_quantity":"250",
"price":"-3.0158",
"quantity":"250",
"rfq_id":"r_2IbpBRNYSQLfTHvyUNtjmxqB9zm",
"role":"TAKER",
"side":"BUY",
"state":"CLOSED",
"time_in_force":"FILL_OR_KILL",
"type":"LIMIT",
"venue":"DBT",
"legs":[
{
"instrument_id": 194874,
"price": "0.1"
}
]
}
Response Schema
Status Code: 200
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | true | The Paradigm created unique identifier of the Order. |
| rfq_id | string | true | The Paradigm created unique identifier of the associated RFQ. |
| state | string | true | The availability of the Order for the user to action. Valid values include OPEN, CLOSED. |
| side | string | true | The direction of the Order. Valid values include BUY, SELL. |
| type | string | true | The type of Order. Valid values include LIMIT. |
| time_in_force | string | true | The validity protocol of the Order. Valid values include GOOD_TILL_CANCELED, FILL_OR_KILL. |
| created_at | decimal | true | The time in UNIX milliseconds since the epoch when the Order was created. |
| last_updated_at | decimal | true | The time in UNIX milliseconds since the epoch when the Order was last updated. |
| venue | string | true | The underlying settlement venue associated with the Order & RFQ. Valid values include DBT, BIT, BYB. |
| quantity | string | true | The size of the Order, denominated in the clearing_currency of the RFQ. |
| legs | Array of Objects | false | The composite Instrument legs of the Order. |
| > instrument_id | integer | true | The Paradigm created unique identifier of the Instrument. |
| > price | string | true | The price of the Instrument leg, denominated in the quote_currency of the RFQ. |
| price | string | true | The price of the Order, denominated in the quote_currency of the RFQ. |
| label | string | true | The user created label for the order. |
| pending_fill_quantity | string | true | The amount of the Order pending settlement on the underlying settlement venue, denominated in the clearing_currency of the RFQ. |
| filled_quantity | string | true | The amount of the Order which has been successfully settled on the underlying settlement venue, denominated in the clearing_currency of the RFQ. |
| canceled_quantity | string | true | The amount of the Order which has been canceled, denominated in the clearing_currency of the RFQ. |
| account_name | string | true | The user given name of the Venue API Credentials on the Client Admin Dashboard. |
| role | string | true | The role of the user in the RFQ. Valid values include TAKER, MAKER. |
Error Codes
| HTTP Status Code | Paradigm Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials were not provided." | You did not provide authentication credentials. |
| 404 | 3500 | "Unavailable order" | Unavailable/invalid Order Id provided in request. |
DRFQv2: [POST] /orders
/orders Request example
# You can also use wget
curl -X POST https://api.testnet.paradigm.trade/v2/drfq/orders \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ACCESS_KEY'
const inputBody = `{
"rfq_id": "12312321321321",
"account_name": "ParadigmTestNinetyFive",
"label": "just for me",
"type": "LIMIT",
"time_in_force": "GOOD_TILL_CANCELED",
"legs": [
{
"instrument_id": 12312312312,
"price": "0.1"
}
],
"quantity": "0.1",
"side": "SELL"
}`;
const headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer ACCESS_KEY'
};
fetch('https://api.testnet.paradigm.trade/v2/drfq/orders',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# built ins
import base64
import hmac
import time
import json
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# POST /v2/drfq/orders
method = 'POST'
path = '/v2/drfq/orders'
payload = {
"rfq_id": "123456",
"account_name": "ParadigmTestNinetyFive",
"label": "just for me",
"type": "LIMIT",
"time_in_force": "GOOD_TILL_CANCELED",
"legs": [
{
"instrument_id": 11434,
"price": "17000"
}
],
"quantity": "250000",
"side": "SELL"
}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.post(
host+path,
headers=headers,
json=payload
)
print(response.status_code)
print(response.text)
package main
import (
"bytes"
"net/https"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer ACCESS_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := https.NewRequest("POST", "https://api.testnet.paradigm.trade/v2/drfq/orders", data)
req.Header = headers
client := &https.Client{}
resp, err := client.Do(req)
// ...
}
A [POST] /orders request attempts to create an Order.
The response, assuming a successful request, will always return with state == PENDING demonstrating that the matching engine is processing the request. From the orders WebSocket Notification channel, a following message with the state == OPEN indicates the Order is actionable by yourself or other counterparties (if you're the Maker). If the Order state == CLOSED it indicates the order is no longer actionable by anyone.
Desks who create the RFQ, role == TAKER, are only able to submit type == LIMIT orders with time_in_force == FILL_OR_KILL to attempt to cross with an existing Order.
Desks who create the RFQ, role == TAKER, should only submit a strategy price value and should NOT include a legs array in the request body.
Desks who are the counterparties to the RFQ, role == MAKER, are only able to submit type == LIMIT orders with time_in_force == GOOD_TILL_CANCELED.
Desks who are the counterparties to the RFQ, role == MAKER, should only submit individual legs price values and NOT a strategy price value.
Desks whose role == MAKER are not able to submit crossing orders. Only desks who are the RFQ creator, role == TAKER, are able to attempt to cross with the existing Orders.
/orders
role==TAKER, Body parameter example
{
"rfq_id": "12312321321321",
"account_name": "ParadigmTestNinetyFive",
"label": "just for me",
"type": "LIMIT",
"time_in_force": "FILL_OR_KILL",
"quantity": "0.1",
"side": "BUY",
"price": "0.1",
}
/orders
role==MAKER, Body parameter example
{
"rfq_id": "12312321321321",
"account_name": "ParadigmTestNinetyFive",
"label": "just for me",
"type": "LIMIT",
"time_in_force": "GOOD_TILL_CANCELED",
"legs": [
{
"instrument_id": 12312312312,
"price": "0.1"
}
],
"quantity": "0.1",
"side": "SELL"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| rfq_id | body | string | true | The Paradigm created unique identifier of the RFQ. |
| account_name | body | string | true | The user given name of the Venue API Credentials on the Client Admin Dashboard. This parameter is optional if role == TAKER. |
| label | body | string | false | The user created label for the order. |
| type | body | string | true | The type of Order. Valid values include LIMIT. |
| time_in_force | body | string | true | The validity protocol of the Order. Valid values include GOOD_TILL_CANCELED, FILL_OR_KILL. |
| legs | body | Array of Objects | false | The composite Instrument legs of the Order. |
| > instrument_id | body | integer | true | The Paradigm created unique identifier of the Instrument. |
| > price | body | string | true | The price of the Instrument leg, denominated in the quote_currency of the RFQ. |
| quantity | body | string | true | The size of the Order, denominated in the clearing_currency of the RFQ. |
| price | body | string | false | The total price of the Order, denominated in the quote_currency of the RFQ. |
| side | body | string | true | The direction of the Order. Valid values include BUY, SELL. |
/orders Response example
201 Response
{
"account_name": "ParadigmTestNinetyFive",
"canceled_quantity": "0",
"created_at": 1675170636837.993,
"filled_quantity": "0",
"id": "o_123123",
"label": "just for me",
"last_updated_at": 1675170636957.032,
"legs": [],
"quantity": "0.1",
"pending_fill_quantity": "0.1",
"price": "0.154",
"rfq_id": "r_12312321321321",
"role": "TAKER",
"side": "SELL",
"state": "PENDING",
"time_in_force": "FILL_OR_KILL",
"type": "LIMIT",
"venue": "DBT"
}
Response Schema
Status Code 201
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | true | The Paradigm created unique identifier of the Order. |
| rfq_id | string | true | The Paradigm created unique identifier of the RFQ. |
| account_name | string | true | The user given name of the Venue API Credentials on the Client Admin Dashboard. |
| label | string | true | The user created label for the order. |
| type | string | true | The type of Order. Valid values include LIMIT. |
| time_in_force | string | true | The validity protocol of the Order. Valid values include GOOD_TILL_CANCELED, FILL_OR_KILL. |
| created_at | integer | true | The time in UNIX nanoseconds since the epoch when the Order was created. |
| quantity | string | true | The total size of the Order, denominated in the clearing_currency of the RFQ. |
| legs | Array of Objects | true | The composite Instrument legs of the RFQ. |
| > instrument_id | integer | false | The Paradigm created unique identifier of the Instrument. |
| > price | string | false | The price of the Instrument leg, denominated in the quote_currency of the RFQ. |
| price | string | true | The total strategy price of the Order, denominated in the quote_currency of the RFQ. |
| side | string | true | The direction of the Order. Valid values include BUY, SELL. |
| state | string | true | The availability of the Order for the user to action. Valid values include PENDING, OPEN, CLOSED |
| role | string | true | The role of the user in the RFQ. Valid values include TAKER, MAKER. |
Error Codes
| HTTP Status Code | Paradigm Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials were not provided." | You did not provide authentication credentials. |
| 400 | 100 | "Invalid parameters" | You provided invalid value to one or more parameters. |
| 400 | 1302 | "Invalid account information" | The value provided with the account key should match the name given to the Exchange API key on the Paradigm Client Admin Dashboard. |
| 400 | 3203 | "Invalid leg parameters" | You provided invalid value to one or more leg parameters. |
| 404 | 3300 | "Unavailable RFQ" | Unavailable/invalid RFQ Id provided in request. |
| 400 | 3401 | "Price is outside bands." | You provided price that is outside of venue's price bands. |
| 400 | 3503 | "An open order for this rfq and side already exists." | There already exist an order for the side and rfq provided in the request. |
DRFQv2: [PUT] /orders/{order_id}
/orders/{order_id} Request example
# You can also use wget
curl -X PUT https://api.testnet.paradigm.trade/v2/drfq/orders/123 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ACCESS_KEY'
const inputBody = `{
"account_name": "ParadigmTestNinetyFive",
"label": "just for me",
"type": "LIMIT",
"time_in_force": "GOOD_TILL_CANCELED",
"legs": [
{
"instrument_id": 12312312312,
"price": "0.1"
}
],
"amount": "0.1",
"side": "BUY",
"rfq_id": "123"
}`;
const headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer ACCESS_KEY'
};
fetch('https://api.testnet.paradigm.trade/v2/drfq/orders/123',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# built ins
import base64
import hmac
import time
import json
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# PUT /v2/drfq/orders/{order_id}
method = 'PUT'
path = '/v2/drfq/orders/123'
payload = {
"account_name": "ParadigmTestNinetyFive",
"label": "just for me",
"type": "LIMIT",
"time_in_force": "GOOD_TILL_CANCELED",
"legs": [
{
"instrument_id": 1234,
"price": "0.1"
}
],
"amount": "0.1",
"side": "BUY",
"rfq_id": "123"
}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.put(
host+path,
headers=headers,
json=payload
)
print(response.status_code)
print(response.text)
package main
import (
"bytes"
"net/https"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer ACCESS_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := https.NewRequest("PUT", "https://api.testnet.paradigm.trade/v2/drfq/orders/123", data)
req.Header = headers
client := &https.Client{}
resp, err := client.Do(req)
// ...
}
A [PUT] /orders/{order_id} request allows a desk to replace an existing state == OPEN Order.
Desks who are the counterparties to the RFQ, role == MAKER, should only submit individual legs price values and NOT a strategy price value.
Upon a successful request, the order will lose it's time priority.
/orders/{order_id}
role==MAKER, Body parameter example
{
"account_name": "ParadigmTestNinetyFive",
"label": "just for me",
"type": "LIMIT",
"time_in_force": "GOOD_TILL_CANCELED",
"legs": [
{
"instrument_id": 12312312312,
"price": "0.1"
}
],
"amount": "0.1",
"side": "BUY",
"rfq_id": "123"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| rfq_id | body | string | false | The Paradigm created unique identifier of the RFQ. It has to match rfq_id of the Order being replaced. |
| account_name | body | string | true | The user given name of the Venue API Credentials on the Client Admin Dashboard. |
| label | body | string | false | The user created label for the order. |
| type | body | string | true | The type of Order. Valid values include LIMIT. |
| time_in_force | body | string | true | The validity protocol of the Order. Valid values include GOOD_TILL_CANCELED, FILL_OR_KILL. |
| legs | body | Array of Objects | false | The composite Instrument legs of the Order. |
| > instrument_id | body | integer | false | The Paradigm created unique identifier of the Instrument. |
| > price | body | string | false | The price of the Instrument leg, denominated in the quote_currency of the RFQ. |
| quantity | body | string | true | The size of the Order, denominated in the clearing_currency of the RFQ. |
| side | body | string | false | The direction of the Order. Valid values include BUY, SELL. It has to match the side of the Order that is being replaced. |
/orders/{order_id} Response example
201 Response
{
"id": "12312312321",
"rfq_id": "12312312312",
"account_name": "ParadigmTestNinetyFive",
"label": "just for me",
"type": "LIMIT",
"time_in_force": "GOOD_TILL_CANCELED",
"created_at": 1656095317329249937,
"quantity": "0.1",
"legs": [
{
"instrument_id": 123123321,
"price": "0.154"
}
],
"price": "0.154",
"side": "SELL",
"state": "PENDING",
"role": "MAKER"
}
Response Schema
Status Code: 201
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | true | The Paradigm created unique identifier of the Order. |
| rfq_id | string | true | The Paradigm created unique identifier of the RFQ. |
| account_name | string | true | The user given name of the Venue API Credentials on the Client Admin Dashboard. |
| label | string | true | The user created label for the order. |
| type | string | true | The type of Order. Valid values include LIMIT. |
| time_in_force | string | true | The validity protocol of the Order. Valid values include GOOD_TILL_CANCELED, FILL_OR_KILL. |
| created_at | decimal | true | The time in UNIX milliseconds since the epoch when the Order was created. |
| quantity | string | true | The total size of the Order, denominated in the clearing_currency of the RFQ. |
| legs | Array of Objects | true | The composite Instrument legs of the RFQ. |
| > instrument_id | integer | false | The Paradigm created unique identifier of the Instrument. |
| > price | string | false | The price of the Instrument leg, denominated in the quote_currency of the RFQ. |
| price | string | true | The total strategy price of the Order, denominated in the quote_currency of the RFQ. |
| side | string | true | The direction of the Order. Valid values include BUY, SELL. |
| state | string | true | The availability of the Order for the user to action. Valid values include PENDING, OPEN, CLOSED |
| role | string | true | The role of the user in the RFQ. Valid values include TAKER, MAKER. |
Error Codes
| HTTP Status Code | Paradigm Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials were not provided." | You did not provide authentication credentials. |
| 400 | 100 | "Invalid parameters" | You provided invalid value to one or more parameters. |
| 400 | 1302 | "Invalid account information" | The value provided with the account key should match the name given to the Exchange API key on the Paradigm Client Admin Dashboard. |
| 400 | 3203 | "Invalid leg parameters" | You provided invalid value to one or more leg parameters. |
| 404 | 3300 | "Unavailable RFQ" | Unavailable/invalid RFQ Id provided in request. |
| 400 | 3401 | "Price is outside bands." | You provided price that is outside of venue's price bands. |
| 404 | 3500 | "Unavailable order" | Unavailable/invalid Order Id provided in request. |
| 400 | 3505 | "Invalid quantity." | You provided invalid value for quantity. |
DRFQv2: [DELETE] /orders
/orders Request example
# You can also use wget
curl -X DELETE https://api.testnet.paradigm.trade/v2/drfq/orders \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ACCESS_KEY'
const headers = {
'Accept': 'application/json',
'Authorization': 'Bearer ACCESS_KEY'
};
fetch('https://api.testnet.paradigm.trade/v2/drfq/orders',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# DELETE /v2/drfq/orders
method = 'DELETE'
path = '/v2/drfq/orders'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.delete(
host+path,
headers=headers
)
print(response.status_code)
print(response.text)
package main
import (
"bytes"
"net/https"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer ACCESS_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := https.NewRequest("DELETE", "https://api.testnet.paradigm.trade/v2/drfq/orders", data)
req.Header = headers
client := &https.Client{}
resp, err := client.Do(req)
// ...
}
A [DELETE] /orders request allows you to attempt to cancel all of your desks' state == OPEN Orders.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| rfq_id | query | string | false | The Paradigm created unique identifier of the RFQ. |
| side | query | string | false | The direction of the Order. Valid values include BUY, SELL. |
| label | query | string | false | The user created label for the order. |
| currency | query | string | false | The exposure or price currency of the RFQ. Valid values include BTC, ETH, SOL, USD, USDC. |
/orders Response example
200 Response
{
"successes": {
"count": 2,
"order_ids": ["152799", "152798"]
},
"failures": {
"count": 0,
"order_ids": []
}
}
Response Schema
Status Code: 200
| Name | Type | Required | Description |
|---|---|---|---|
| successes | Object | true | This object demonstrates the successful cancel operations & associated Order IDs. |
| > count | integer | true | The number of successfully canceled Orders. |
| > order_ids | Array of strings | true | The Paradigm created Order IDs that have been successfully canceled. [] if no Orders are successfully canceled. |
| failures | Object | true | This object demonstrates the failed cancel operations & associated Order IDs. |
| > count | integer | true | The number of failed canceled Order operations. |
| > order_ids | Array of strings | true | The Paradigm created Order IDs that failed to cancel. [] if no Orders fail to cancel. |
Error Codes
| HTTP Status Code | Paradigm Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials were not provided." | You did not provide authentication credentials. |
DRFQv2: [DELETE] /orders/{order_id}
/orders/{order_id} Request example
# You can also use wget
curl -X DELETE https://api.testnet.paradigm.trade/v2/drfq/orders/123 \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ACCESS_KEY'
const headers = {
'Accept': 'application/json',
'Authorization': 'Bearer ACCESS_KEY'
};
fetch('https://api.testnet.paradigm.trade/v2/drfq/orders/123',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# DELETE /v2/drfq/orders/{order_id}
method = 'DELETE'
path = '/v2/drfq/orders/123'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.delete(
host+path,
headers=headers
)
print(response.status_code)
print(response.text)
package main
import (
"bytes"
"net/https"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer ACCESS_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := https.NewRequest("DELETE", "https://api.testnet.paradigm.trade/v2/drfq/orders/123", data)
req.Header = headers
client := &https.Client{}
resp, err := client.Do(req)
// ...
}
A [DELETE] /orders/{order_id} request attempts to cancel the specified state == OPEN Order in the endpoint.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| order_id | endpoint | string | true | The Paradigm created unique Order identifier. |
Response Schema
Status Code: 204
There is no response schema.
Error Codes
| HTTP Status Code | Paradigm Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials were not provided." | You did not provide authentication credentials. |
| 404 | 3500 | "Unavailable order" | Unavailable/invalid Order Id provided in request. |
| 400 | 3502 | "Too late to cancel order" | The requested order_id is already CLOSED or unavailable to cancel. |
DRFQv2: [GET] /trades
/trades Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v2/drfq/trades \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ACCESS_KEY'
const headers = {
'Accept': 'application/json',
'Authorization': 'Bearer ACCESS_KEY'
};
fetch('https://api.testnet.paradigm.trade/v2/drfq/trades',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v2/drfq/trades
method = 'GET'
path = '/v2/drfq/trades'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(
host+path,
headers=headers
)
print(response.status_code)
print(response.text)
package main
import (
"bytes"
"net/https"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer ACCESS_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := https.NewRequest("GET", "https://api.testnet.paradigm.trade/v2/drfq/trades", data)
req.Header = headers
client := &https.Client{}
resp, err := client.Do(req)
// ...
}
A [GET] /trades request returns all trades your desk has been aparty too.
To return complete results, users must paginate by providing the response's next key value for the cursor query string parameter in the subsequent request.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | The cursor value used to paginate through pages. The value to use is the next key value from the response. |
| page_size | query | string | false | The number of elements to return per page. |
| state | query | string | false | The indication if the trade has reached settlement finality. Valid values include PENDING_SETTLEMENT, FILLED, REJECTED. |
| rfq_id | query | string | false | The Paradigm created unique identifier associated with the RFQ. |
| venue | query | string | false | The underlying settlement venue to return Instruments for. Valid values include DBT, BIT, BYB. |
| kind | query | string | false | The contract type of the associated RFQ. Valid values include OPTION, FUTURE, OPTION_FUTURE. |
| role | query | string | false | The role of the user in the Trade. Valid values include TAKER, MAKER. |
| order_id | query | string | false | The Paradigm created unique identifier associated with the Order. |
/trades Response example
200 Response
{
"count":2921,
"next":"cD0yMDIyLTEyLTA4KzAwJTNBMzglM0E1MS4yMTY1NjglMkIwMCUzQTAw",
"results":[
{
"id":"bt_2IbpRmMSOqnQKwPkGEDr2VDZp5e",
"exec_id":"365636",
"order_id":"o_2IbpRmLbgT7yUGl3lgGD9GogSQ1",
"rfq_id":"r_2IbpMsUESAt5bfVEQp7c32SbIDJ",
"venue":"DBT",
"kind":"OPTION",
"state":"COMPLETED",
"role":"TAKER",
"executed_at":1670460131896.015,
"filled_at":1670460132000.0,
"side":"BUY",
"price":"0.2397",
"quantity":"50",
"filled_quantity":"50",
"rejected_quantity":"0",
"rejected_party":null,
"rejected_reason":null,
"index_price":"63021.02",
"account":"ParadigmTestNinetyFive",
"legs":[
{
"instrument_id":154564,
"instrument_name":"BTC-30JUN23-14000-P",
"price":"0.2397",
"product_code":"DO",
"quantity":"50",
"ratio":"1",
"side":"BUY",
"venue_trade_id":"141186632",
"fee_quantity":"0.0075",
"index_price":"63021.02",
"fee_currency":"BTC"
}
],
"strategy_description":"DO_BTC-30JUN23-14000-P",
"description":"Put 30 Jun 23 14000",
"quote_currency":"BTC",
"mark_price":"0.2407"
},
{
"id":"bt_2IbpM7fQWGK1bILTw2OvwPnMc5P",
"exec_id":"365635",
"order_id":"o_2IbpM7f1EFwm4570NdZARA4IpL2",
"rfq_id":"r_2IbpLUknqWjvjJYJxMpt4uv36Lr",
"venue":"DBT",
"kind":"OPTION",
"state":"COMPLETED",
"role":"TAKER",
"executed_at":1670460086203.6682,
"filled_at":1670460086000.0,
"side":"BUY",
"price":"0.2724",
"quantity":"25",
"filled_quantity":"25",
"rejected_quantity":"0",
"rejected_party":null,
"rejected_reason":null,
"account":"ParadigmTestNinetyFive",
"legs":[
{
"instrument_id":182233,
"instrument_name":"BTC-24FEB23-17000-C",
"price":"0.2724",
"product_code":"DO",
"quantity":"25",
"ratio":"1",
"side":"BUY",
"venue_trade_id":"141186570",
"fee_quantity":"0.00375",
"fee_currency":"BTC"
}
],
"strategy_description":"DO_BTC-24FEB23-17000-C",
"description":"Call 24 Feb 23 17000",
"quote_currency":"BTC",
"mark_price":"0.2735"
},
{
"id":"bt_2IbpBwZLazIBOcI24DYsD7ihRoy",
"exec_id":"365634",
"order_id":"o_2IbpBwYpwJEXsKQRnNZi8B6NxSQ",
"rfq_id":"r_2Ibp7AUyp9HTimRTY1TiGqNcI9a",
"venue":"DBT",
"kind":"OPTION",
"state":"COMPLETED",
"role":"TAKER",
"executed_at":1670460005229.808,
"filled_at":1670460005000.0,
"side":"BUY",
"price":"4.4713",
"quantity":"50",
"filled_quantity":"50",
"rejected_quantity":"0",
"rejected_party":null,
"rejected_reason":null,
"account":"ParadigmTestNinetyFive",
"legs":[
{
"instrument_id":153021,
"instrument_name":"BTC-30JUN23-100000-P",
"price":"4.9549",
"product_code":"DO",
"quantity":"50",
"ratio":"1",
"side":"BUY",
"venue_trade_id":"141186463",
"fee_quantity":"0",
"fee_currency":"BTC"
},
{
"instrument_id":153009,
"instrument_name":"BTC-30JUN23-15000-P",
"price":"0.2418",
"product_code":"DO",
"quantity":"100",
"ratio":"2",
"side":"SELL",
"venue_trade_id":"141186462",
"fee_quantity":"0.015",
"fee_currency":"BTC"
}
],
"strategy_description":"DO_BTC-30JUN23-100000-P_BTC-30JUN23-15000-P",
"description":"Cstm +1 Put 30 Jun 23 100000\n -2 Put 30 Jun 23 15000",
"quote_currency":"BTC",
"mark_price":"4.4741"
},
{
"id":"bt_2Ibp2e4vIBlyII2FDG4hcfV4aXr",
"exec_id":"365633",
"order_id":"o_2Ibp2e43lJPzyPW4S3j3NR3SwOV",
"rfq_id":"r_2Ibozkpq0slrvDz93ZPH6u0AHRV",
"venue":"DBT",
"kind":"OPTION",
"state":"COMPLETED",
"role":"TAKER",
"executed_at":1670459931825.164,
"filled_at":1670459932000.0,
"side":"BUY",
"price":"-0.4729",
"quantity":"25",
"filled_quantity":"25",
"rejected_quantity":"0",
"rejected_party":null,
"rejected_reason":null,
"account":"ParadigmTestNinetyFive",
"legs":[
{
"instrument_id":182746,
"instrument_name":"BTC-16DEC22-15000-P",
"price":"0.0092",
"product_code":"DO",
"quantity":"25",
"ratio":"1",
"side":"BUY",
"venue_trade_id":"141186363",
"fee_quantity":"0",
"fee_currency":"BTC"
},
{
"instrument_id":141457,
"instrument_name":"BTC-31MAR23-100000-C",
"price":"0.0007",
"product_code":"DO",
"quantity":"75",
"ratio":"3",
"side":"BUY",
"venue_trade_id":"141186361",
"fee_quantity":"0",
"fee_currency":"BTC"
},
{
"instrument_id":148427,
"instrument_name":"BTC-31MAR23-15000-P",
"price":"0.2421",
"product_code":"DO",
"quantity":"50",
"ratio":"2",
"side":"SELL",
"venue_trade_id":"141186362",
"fee_quantity":"0.0075",
"fee_currency":"BTC"
}
],
"strategy_description":"DO_BTC-16DEC22-15000-P_BTC-31MAR23-100000-C_BTC-31MAR23-15000-P",
"description":"Cstm +1 Put 16 Dec 22 15000\n +3 Call 31 Mar 23 100000\n -2 Put 31 Mar 23 15000",
"quote_currency":"BTC",
"mark_price":"-0.4699"
},
{
"id":"bt_2Ibp2e0R8HNcoCd709gUyVs4zho",
"exec_id":"365632",
"order_id":"o_2Ibp2dzq4zEk6Yu3HcFs45n3NQ4",
"rfq_id":"r_2Ibp1GHnnO13qvmGeJ6pwAyFAfP",
"venue":"DBT",
"kind":"OPTION",
"state":"COMPLETED",
"role":"TAKER",
"executed_at":1670459931216.5679,
"filled_at":1670459931000.0,
"side":"BUY",
"price":"-1.0797",
"quantity":"50",
"filled_quantity":"50",
"rejected_quantity":"0",
"rejected_party":null,
"rejected_reason":null,
"account":"ParadigmTestNinetyFive",
"legs":[
{
"instrument_id":175553,
"instrument_name":"BTC-29SEP23-15000-C",
"price":"0.3751",
"product_code":"DO",
"quantity":"50",
"ratio":"1",
"side":"BUY",
"venue_trade_id":"141186360",
"fee_quantity":"0",
"fee_currency":"BTC"
},
{
"instrument_id":155835,
"instrument_name":"BTC-31MAR23-28000-P",
"price":"0.7274",
"product_code":"DO",
"quantity":"100",
"ratio":"2",
"side":"SELL",
"venue_trade_id":"141186359",
"fee_quantity":"0.015",
"fee_currency":"BTC"
}
],
"strategy_description":"DO_BTC-29SEP23-15000-C_BTC-31MAR23-28000-P",
"description":"Cstm +1 Call 29 Sep 23 15000\n -2 Put 31 Mar 23 28000",
"quote_currency":"BTC",
"mark_price":"-1.0763"
}
]
}
Response Schema
Status Code: 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | integer | true | The number of elements returned in the response. |
| next | string | true | Cursor string value to use to paginate results. Equal to null if no more pages are available. |
| results | Array of Objects | true | Array of Objects with details related to specific Trades. |
| > id | string | true | The Paradigm created unique identifier of the Trade. |
| > exec_id | string | true | The corresponding Block Trade unique identifier created by either the Paradigm or the underlying settlement venue. |
| > order_id | string | true | The Paradigm created unique Order identifier associated with the Trade. |
| > rfq_id | string | true | The Paradigm created unique identifier of the RFQ. |
| > venue | string | true | The underlying settlement venue of the RFQ. Valid values include DBT, BIT, BYB. |
| > kind | string | true | The nature of the strategy traded. Valid values include OPTION, FUTURE, OPTION_FUTURE. |
| > state | string | true | The indication if the trade has reached settlement finality. Valid values include PENDING_SETTLEMENT, FILLED, REJECTED. |
| > role | string | true | The role of the user in the Trade. Valid values include TAKER, MAKER. |
| > executed_at | decimal | true | The time in UNIX milliseconds since the epoch when the trade was executed on Paradigm. |
| > filled_at | decimal | true | The time in UNIX milliseconds since the epoch when trade with either successfully settled or rejected on Paradigm. -1 if the Trade failed to successfully settle. |
| > side | string | true | The direction of the user in the trade. Valid values include BUY , SELL. |
| > price | string | true | The strategy price of the trade, denominated the quote_currency of the RFQ. |
| > quantity | string | true | The amount of the trade, denominated in the clearing_currency of the RFQ. |
| > filled_quantity | string | true | The successfully filled amount of the trade, denominated in the clearing_currency of the RFQ. |
| > rejected_quantity | string | true | The rejected amount of the trade, denominated in the clearing_currency of the RFQ. |
| > rejected_party | string | true | The counterparty responsible for the Trade Rejection. Valid values include USER, COUNTERPARTY. null of Trade successfully settled. |
| > rejected_reason | string | true | The reason for the Trade Rejection. null if Trade successfully settled. |
| > legs | Array of Objects | true | The composite Instrument legs of the Trade. |
| >> instrument_id | integer | true | The Paradigm created unique identifier of the Instrument. |
| >> instrument_name | string | true | The Paradigm normalized name of the Instrument used across Paradigm’s API. |
| >> ratio | string | true | The relative multiplier applied to the quantity of the Instrument’s amount relative to the amount of the RFQ. |
| >> side | string | true | The direction of the composite Instrument to the Trade. Valid values include BUY, SELL. |
| >> price | string | true | The price of the Instrument leg, denominated in the quote_currency of the RFQ. |
| >> product_code | string | true | The Paradigm created unique two-letter code to represent the specific Instrument. |
| >> quantity | string | true | The size of the Instrument leg, denominated in the clearing_currency of the RFQ. |
| >> venue_trade_id | string | true | The corresponding unique trade identifier present on the underlying settlement venue. Value to be -1 if rejected. |
| >> fee_quantity | string | true | The amount of fees paid/earned to execute this leg on the underlying settlement venue, denominated in the fee_currency. |
| >> fee_currency | string | true | The currency the fee_amount is denominated in. |
| > strategy_description | string | true | The standardized description of the Trade’s composite Instruments. |
| > description | string | true | The verbose description of the Trade’s composite Instruments. |
| > quote_currency | string | true | The currency in the price is denominated in, denominated in the quote_currency of the RFQ. |
| > mark_price | string | true | The strategy mark price from the underlying settlement venue of the composite Instruments to the trade. |
| > account | string | true | The user given name of the Venue API Credentials on the Client Admin Dashboard. |
Error Codes
| HTTP Status Code | Paradigm Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials were not provided." | You did not provide authentication credentials. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
| 400 | 3005 | "Invalid filter parameter" | You provided invalid value to one or more filter parameters. |
DRFQv2: [GET] /trades/{trade_id}
/trades/{trade_id} Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v2/drfq/trades/123 \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ACCESS_KEY'
const headers = {
'Accept': 'application/json',
'Authorization': 'Bearer ACCESS_KEY'
};
fetch('https://api.testnet.paradigm.trade/v2/drfq/trades/123',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v2/drfq/trades/{trade_id}
method = 'GET'
path = '/v2/drfq/trades/123'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(
host+path,
headers=headers
)
print(response.status_code)
print(response.text)
package main
import (
"bytes"
"net/https"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer ACCESS_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := https.NewRequest("GET", "https://api.testnet.paradigm.trade/v2/drfq/trades/123", data)
req.Header = headers
client := &https.Client{}
resp, err := client.Do(req)
// ...
}
A [GET] /trades/{trade_id} request returns the trade specified in the endpoint.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| trade_id | endpoint | string | true | The Paradigm created unique Trade identifier. |
/trades/{trade_id} Response example
200 Response
{
"id":"bt_2IbpRmMSOqnQKwPkGEDr2VDZp5e",
"exec_id":"365636",
"order_id":"o_2IbpRmLbgT7yUGl3lgGD9GogSQ1",
"rfq_id":"r_2IbpMsUESAt5bfVEQp7c32SbIDJ",
"venue":"DBT",
"kind":"OPTION",
"state":"COMPLETED",
"role":"TAKER",
"executed_at":1670460131896.015,
"filled_at":1670460132000.0,
"side":"BUY",
"price":"0.2397",
"quantity":"50",
"filled_quantity":"50",
"rejected_quantity":"0",
"rejected_party":null,
"rejected_reason":null,
"account":"ParadigmTestNinetyFive",
"index_price": "63000",
"legs":[
{
"instrument_id":154564,
"instrument_name":"BTC-30JUN23-14000-P",
"price":"0.2397",
"product_code":"DO",
"quantity":"50",
"index_price": "63000",
"ratio":"1",
"side":"BUY",
"venue_trade_id":"141186632",
"fee_quantity":"0.0075",
"fee_currency":"BTC"
}
],
"strategy_description":"DO_BTC-30JUN23-14000-P",
"description":"Put 30 Jun 23 14000",
"quote_currency":"BTC",
"mark_price":"0.2407"
}
Response Schema
Status Code: 200
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | true | The Paradigm created unique identifier of the Trade. |
| exec_id | string | true | The corresponding Block Trade unique identifier created by either the Paradigm or the underlying settlement venue. |
| order_id | string | true | The Paradigm created unique Order identifier associated with the Trade. |
| rfq_id | string | true | The Paradigm created unique identifier of the RFQ. |
| venue | string | true | The underlying settlement venue of the RFQ. Valid values include DBT, BIT, BYB. |
| kind | string | true | The nature of the strategy traded. Valid values include OPTION, FUTURE, OPTION_FUTURE. |
| state | string | true | The indication if the trade has reached settlement finality. Valid values include PENDING_SETTLEMENT, FILLED, REJECTED. |
| role | string | true | The role of the user in the Trade. Valid values include TAKER, MAKER. |
| executed_at | decimal | true | The time in UNIX milliseconds since the epoch when the trade was executed on Paradigm. |
| filled_at | decimal | true | The time in UNIX milliseconds since the epoch when trade with either successfully settled or rejected on Paradigm. -1 if the Trade failed to successfully settle. |
| side | string | true | The direction of the user in the trade. Valid values include BUY, SELL. |
| price | string | true | The strategy price of the trade, denominated the quote_currency of the RFQ. |
| index_price | string | false | The index price average at the moment of execution. |
| quantity | string | true | The amount of the trade, denominated in the clearing_currency of the RFQ. |
| filled_quantity | string | true | The successfully filled amount of the trade, denominated in the clearing_currency of the RFQ. |
| rejected_quantity | string | true | The rejected amount of the trade, denominated in the clearing_currency of the RFQ. |
| rejected_party | string | true | The counterparty responsible for the Trade Rejection. Valid values include USER, COUNTERPARTY. null of Trade successfully settled. |
| rejected_reason | string | true | The reason for the Trade Rejection. null if Trade successfully settled. |
| legs | Array of Objects | true | The composite Instrument legs of the Trade. |
| > instrument_id | integer | true | The Paradigm created unique identifier of the Instrument., |
| > instrument_name | string | true | The Paradigm normalized name of the Instrument used across Paradigm’s API. |
| > ratio | string | true | The relative multiplier applied to the quantity of the Instrument’s amount relative to the amount of the RFQ. |
| > side | string | true | The direction of the composite Instrument to the Trade. Valid values include BUY, SELL. |
| > price | string | true | The price of the Instrument leg, denominated in the quote_currency of the RFQ. |
| > index_price | string | false | The index price of leg instrument at execution. |
| > product_code | string | true | The Paradigm created unique two-letter code to represent the specific Instrument. |
| > quantity | string | true | The size of the Instrument leg, denominated in the clearing_currency of the RFQ. |
| > venue_trade_id | string | true | The corresponding unique trade identifier present on the underlying settlement venue. |
| > fee_quantity | string | true | The amount of fees paid/earned to execute this leg on the underlying settlement venue, denominated in the fee_currency. |
| > fee_currency | string | true | The currency the fee_amount is denominated in. |
| strategy_description | string | true | The standardized description of the Trade’s composite Instruments. |
| description | string | true | The verbose description of the Trade’s composite Instruments. |
| quote_currency | string | true | The currency in the price is denominated in, denominated in the quote_currency of the RFQ. |
| mark_price | string | true | The strategy mark price from the underlying settlement venue of the composite Instruments to the trade. |
| account | string | true | The user given name of the Venue API Credentials on the Client Admin Dashboard. |
Error Codes
| HTTP Status Code | Paradigm Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials were not provided." | You did not provide authentication credentials. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
| 404 | 3406 | "Unavailable trade" | Unavailable/invalid trade id provided in request. |
DRFQv2: [GET] /trade_tape
/trade_tape Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v2/drfq/trade_tape \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ACCESS_KEY'
const headers = {
'Accept': 'application/json',
'Authorization': 'Bearer ACCESS_KEY'
};
fetch('https://api.testnet.paradigm.trade/v2/drfq/trade_tape',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v2/drfq/trade_tape
method = 'GET'
path = '/v2/drfq/trade_tape'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(
host+path,
headers=headers
)
print(response.status_code)
print(response.text)
package main
import (
"bytes"
"net/https"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer ACCESS_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := https.NewRequest("GET", "https://api.testnet.paradigm.trade/v2/drfq/trade_tape", data)
req.Header = headers
client := &https.Client{}
resp, err := client.Do(req)
// ...
}
A [GET] /trade_tape request returns all successfully cleared trades.
To return complete results, users must paginate by providing the response's next key value for the cursor query string parameter in the subsequent request.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | The cursor value used to paginate through pages. The value to use is the next key value from the response. |
| page_size | query | string | false | The number of elements to return per page. |
| rfq_id | query | string | false | The Paradigm created unique identifier associated with the RFQ. |
| venue | query | string | false | The underlying settlement venue to return Instruments for. Valid values include DBT, BIT, BYB. |
| product_codes | query | string | false | The Paradigm created Product Codes of the composite Instruments. The request can contain multiple codes such as ?product_codes=DO,CF. |
| strategies | query | string | false | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
/trade_tape Response example
200 Response
{
"count":2921,
"next":"cD0yMDIyLTEyLTA4KzAwJTNBMzglM0E1MS4yMTY1NjglMkIwMCUzQTAw",
"results":[
{
"id":"bt_2IbpRmMSOqnQKwPkGEDr2VDZp5e",
"rfq_id":"r_2IbpMsUESAt5bfVEQp7c32SbIDJ",
"venue":"DBT",
"kind":"OPTION",
"state":"FILLED",
"executed_at":1670460131896.015,
"filled_at":1670460132000.0,
"side":"SELL",
"price":"0.2397",
"quantity":"50",
"legs":[
{
"instrument_id":154564,
"instrument_name":"BTC-30JUN23-14000-P",
"ratio":"1",
"side":"BUY",
"price":"0.2397",
"product_code":"DO",
"quantity":"50"
}
],
"strategy_code":"PT",
"strategy_description":"DO_BTC-30JUN23-14000-P",
"description":"Put 30 Jun 23 14000",
"quote_currency":"BTC",
"mark_price":"0.2407"
},
{
"id":"bt_2IbpM7fQWGK1bILTw2OvwPnMc5P",
"rfq_id":"r_2IbpLUknqWjvjJYJxMpt4uv36Lr",
"venue":"DBT",
"kind":"OPTION",
"state":"FILLED",
"executed_at":1670460086203.6682,
"filled_at":1670460086000.0,
"side":"SELL",
"price":"0.2724",
"quantity":"25",
"legs":[
{
"instrument_id":182233,
"instrument_name":"BTC-24FEB23-17000-C",
"ratio":"1",
"side":"BUY",
"price":"0.2724",
"product_code":"DO",
"quantity":"25"
}
],
"strategy_code":"CL",
"strategy_description":"DO_BTC-24FEB23-17000-C",
"description":"Call 24 Feb 23 17000",
"quote_currency":"BTC",
"mark_price":"0.2735"
},
{
"id":"bt_2IbpBwZLazIBOcI24DYsD7ihRoy",
"rfq_id":"r_2Ibp7AUyp9HTimRTY1TiGqNcI9a",
"venue":"DBT",
"kind":"OPTION",
"state":"FILLED",
"executed_at":1670460005229.808,
"filled_at":1670460005000.0,
"side":"SELL",
"price":"4.4713",
"quantity":"50",
"legs":[
{
"instrument_id":153021,
"instrument_name":"BTC-30JUN23-100000-P",
"ratio":"1",
"side":"BUY",
"price":"4.9549",
"product_code":"DO",
"quantity":"50"
},
{
"instrument_id":153009,
"instrument_name":"BTC-30JUN23-15000-P",
"ratio":"2",
"side":"SELL",
"price":"0.2418",
"product_code":"DO",
"quantity":"100"
}
],
"strategy_code":"CM",
"strategy_description":"DO_BTC-30JUN23-100000-P_BTC-30JUN23-15000-P",
"description":"Cstm +1 Put 30 Jun 23 100000\n -2 Put 30 Jun 23 15000",
"quote_currency":"BTC",
"mark_price":"4.4741"
},
{
"id":"bt_2Ibp2e4vIBlyII2FDG4hcfV4aXr",
"rfq_id":"r_2Ibozkpq0slrvDz93ZPH6u0AHRV",
"venue":"DBT",
"kind":"OPTION",
"state":"FILLED",
"executed_at":1670459931825.164,
"filled_at":1670459932000.0,
"side":"SELL",
"price":"-0.4729",
"quantity":"25",
"legs":[
{
"instrument_id":182746,
"instrument_name":"BTC-16DEC22-15000-P",
"ratio":"1",
"side":"BUY",
"price":"0.0092",
"product_code":"DO",
"quantity":"25"
},
{
"instrument_id":141457,
"instrument_name":"BTC-31MAR23-100000-C",
"ratio":"3",
"side":"BUY",
"price":"0.0007",
"product_code":"DO",
"quantity":"75"
},
{
"instrument_id":148427,
"instrument_name":"BTC-31MAR23-15000-P",
"ratio":"2",
"side":"SELL",
"price":"0.2421",
"product_code":"DO",
"quantity":"50"
}
],
"strategy_code":"CM",
"strategy_description":"DO_BTC-16DEC22-15000-P_BTC-31MAR23-100000-C_BTC-31MAR23-15000-P",
"description":"Cstm +1 Put 16 Dec 22 15000\n +3 Call 31 Mar 23 100000\n -2 Put 31 Mar 23 15000",
"quote_currency":"BTC",
"mark_price":"-0.4699"
},
{
"id":"bt_2Ibp2e0R8HNcoCd709gUyVs4zho",
"rfq_id":"r_2Ibp1GHnnO13qvmGeJ6pwAyFAfP",
"venue":"DBT",
"kind":"OPTION",
"state":"FILLED",
"executed_at":1670459931216.5679,
"filled_at":1670459931000.0,
"side":"SELL",
"price":"-1.0797",
"quantity":"50",
"legs":[
{
"instrument_id":175553,
"instrument_name":"BTC-29SEP23-15000-C",
"ratio":"1",
"side":"BUY",
"price":"0.3751",
"product_code":"DO",
"quantity":"50"
},
{
"instrument_id":155835,
"instrument_name":"BTC-31MAR23-28000-P",
"ratio":"2",
"side":"SELL",
"price":"0.7274",
"product_code":"DO",
"quantity":"100"
}
],
"strategy_code":"CM",
"strategy_description":"DO_BTC-29SEP23-15000-C_BTC-31MAR23-28000-P",
"description":"Cstm +1 Call 29 Sep 23 15000\n -2 Put 31 Mar 23 28000",
"quote_currency":"BTC",
"mark_price":"-1.0763"
}
]
}
Response Schema
Status Code: 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | integer | true | The number of elements returned in the response. |
| next | string | true | Cursor string value to use to paginate results. Equal to null if no more pages are available. |
| results | Array of Objects | true | Array of Objects with details related to specific Trades. |
| > id | string | true | The Paradigm created unique identifier of the Trade. |
| > rfq_id | string | true | The Paradigm created unique identifier of the RFQ. |
| > venue | string | true | The underlying settlement venue of the RFQ. Valid values include DBT, BIT, BYB. |
| > kind | string | true | The nature of the strategy traded. Valid values include OPTION, FUTURE, OPTION_FUTURE. |
| > state | string | true | The indication if the trade has reached settlement finality. Valid values include FILLED. |
| > executed_at | decimal | true | The time in UNIX milliseconds since the epoch when the trade was executed on Paradigm. |
| > filled_at | decimal | true | The time in UNIX milliseconds since the epoch when trade with either successfully settled or rejected on Paradigm. |
| > side | string | true | The direction of the user in the trade. Valid values include BUY, SELL. |
| > price | string | true | The strategy price of the trade, denominated the quote_currency of the RFQ. |
| > quantity | string | true | The amount of the trade, denominated in the clearing_currency of the RFQ. |
| > legs | string | true | The composite Instrument legs of the Trade. |
| >> instrument_id | integer | true | The Paradigm created unique identifier of the Instrument. |
| >> instrument_name | string | true | The Paradigm normalized name of the Instrument to be used across Paradigm’s API. |
| >> ratio | string | true | The relative multiplier applied to the quantity of the Instrument’s amount relative to the amount of the RFQ. |
| >> side | string | true | The direction of the composite Instrument to the Trade. Valid values include BUY, SELL. |
| >> price | string | true | The price of the Instrument leg, denominated in the quote_currency of the RFQ. |
| >> product_code | string | true | The Paradigm created unique two-letter code to represent the specific Instrument. |
| >> quantity | string | true | The size of the Instrument leg, denominated in the clearing_currency of the RFQ. |
| > strategy_code | string | true | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
| > strategy_description | string | true | The standardized description of the Trade’s composite Instruments. |
| > description | string | true | The verbose description of the Trade’s composite Instruments. |
| > quote_currency | string | true | The currency the price is denominated in. |
| > mark_price | string | true | The strategy mark price from the underlying settlement venue of the composite Instruments to the trade. |
Error Codes
| HTTP Status Code | Paradigm Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials were not provided." | You did not provide authentication credentials. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
| 400 | 100 | "Invalid filter parameter" | You provided invalid value to one or more filter parameters. |
DRFQv2: [POST] /pricing
/pricing Request example
# You can also use wget
curl -X POST https://api.testnet.paradigm.trade/v2/drfq/pricing \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ACCESS_KEY'
const headers = {
'Accept': 'application/json',
'Authorization': 'Bearer ACCESS_KEY'
};
fetch('https://api.testnet.paradigm.trade/v2/drfq/pricing',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# built ins
import base64
import hmac
import time
import json
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# POST /v2/drfq/pricing
method = 'POST'
path = '/v2/drfq/pricing'
payload = {
"bid_price": "7950",
"ask_price": "9600",
"legs": [
{
"instrument_id": 1234,
"ratio": "1",
"side": "BUY"
},
{
"instrument_id": 123,
"ratio": "1",
"side": "SELL"
}
]
}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.post(
host+path,
headers=headers,
json=payload
)
print(response.status_code)
print(response.text)
package main
import (
"bytes"
"net/https"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer ACCESS_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := https.NewRequest("POST", "https://api.testnet.paradigm.trade/v2/drfq/pricing", data)
req.Header = headers
client := &https.Client{}
resp, err := client.Do(req)
// ...
}
A [POST] /pricing request returns the strategy pricing of the specified composite instruments.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| bid_price | body | string | false | The strategy price of the Order from the BUY side direction. |
| ask_price | body | string | false | The strategy price of the Order from the SELL side direction. |
| legs | body | Array of Objects | true | The composite Instrument legs of the RFQ. |
| > instrument_id | body | integer | true | The Paradigm created unique identifier of the Instrument. |
| > ratio | body | string | true | The relative multiplier applied to the quantity of the Instrument’s amount relative to the amount of the RFQ. Maximum of 2 decimal places. |
| > side | body | string | true | The direction of the composite leg relative to the RFQ. Valid values include BUY, SELL. |
/pricing Response example
200 Response
{
"bid_prices": ["32655.32", "24705.32"],
"ask_prices": ["33606.76", "24006.76"]
}
Response Schema
Status Code: 200
| Name | Type | Required | Description |
|---|---|---|---|
| bid_prices | Array of strings | true | Individual leg composite leg prices for the BUY direction. [] if bid_price is not a part of request payload. |
| ask_prices | Array of strings | true | Individual leg composite leg prices for the SELL direction. [] if ask_price is not a part of request payload. |
Error Codes
| HTTP Status Code | Paradigm Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials were not provided." | You did not provide authentication credentials. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
| 400 | 3002 | "Invalid leg pricing parameters" | You provided invalid value to one or more pricing parameters. |
| 400 | 3200 | "Invalid RFQ leg configuration" | You provided invalid legs to the pricing endpoint. |
| 400 | 3304 | "Submitted quote/s were outside venue's price bands" | Provided leg prices were outside of price bands of the underlying venue. |
| 400 | 3310 | "Cannot calculate sensical leg prices." | Leg prices couldn't be calculated. |
| 400 | 3311 | "Cannot calculate leg prices." | Leg prices couldn't be calculated. |
DRFQv2: [GET] /rfqs/{rfq_id}/bbo
/rfqs/bbo/{rfq_id} Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v2/drfq/rfqs/123/bbo \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ACCESS_KEY'
const headers = {
'Accept': 'application/json',
'Authorization': 'Bearer ACCESS_KEY'
};
fetch('https://api.testnet.paradigm.trade/v2/drfq/rfqs/123/bbo',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v2/drfq/rfqs/{rfq_id}/bbo
method = 'GET'
path = '/v2/drfq/rfqs/123/bbo'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(
host+path,
headers=headers
)
print(response.status_code)
print(response.text)
package main
import (
"bytes"
"net/https"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer ACCESS_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := https.NewRequest("GET", "https://api.testnet.paradigm.trade/v2/drfq/rfqs/123/bbo", data)
req.Header = headers
client := &https.Client{}
resp, err := client.Do(req)
// ...
}
A [GET] /rfqs/{rfq_id}/bbo request returns the market data for the RFQ's composite instruments from the underlying settlement venue.
If the best_bid_quantity and best_bid_price or best_ask_quantity and best_ask_price are equal to 0, it means that one of the composite instruments of the market does not have an underlying screen order. We are working to remedy this in due course as so we return null when this occurs.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| rfq_id | endpoint | string | true | The Paradigm created unique identifier of the RFQ. |
/rfqs/bbo/{rfq_id} Response example
200 Response
{
"rfq_id": "123213213",
"min_price": "21000.00",
"max_price": "22000.00",
"mark_price": "21500.00",
"best_bid_price": "0.01",
"best_ask_price": "0.011",
"best_bid_quantity": "10",
"best_ask_quantity": "10",
"created_at": 12321321321321321,
"greeks": {
"delta": "0.00466",
"gamma": "0.00001",
"theta": "-0.02436",
"vega": "0.20599",
},
"legs": [
{
"best_bid_price": "0.01",
"best_ask_price": "0.011",
"best_bid_quantity": "10",
"best_ask_quantity": "10",
"instrument_id": 123231213213,
"instrument_name": "ETH-29DEC23-9000-C",
"mark_price": "21500.00",
"best_bid_iv": null,
"best_ask_iv": null,
"mark_price_iv": null,
"greeks": {
"delta": "0.00466",
"gamma": "0.00001",
"theta": "-0.02436",
"vega": "0.20599",
},
}
]
}
Response Schema
Status Code: 200
| Name | Type | Required | Description |
|---|---|---|---|
| rfq_id | string | true | The Paradigm created unique identifier of the RFQ. |
| min_price | string | true | The minimum allowed price with which the RFQ can trade as per the underlying settlement venue’s trading price bands. Denominated in the quote_currency of the RFQ. |
| max_price | string | true | The maximum allowed price with which the RFQ can trade as per the underlying settlement venue’s trading price bands. Denominated in the quote_currency of the RFQ. |
| mark_price | string | true | The strategy mark price of the RFQ’s composite Instruments from the underlying settlement venue. Denominated in the quote_currency of the RFQ. |
| best_bid_price | string | true | The RFQ’s best bid price from the underlying settlement venue’s Order Books. Denominated in the quote_currency of the RFQ. |
| best_ask_price | string | true | The RFQ’s best ask price from the underlying settlement venue’s Order Books. Denominated in the quote_currency of the RFQ. |
| best_bid_quantity | string | true | The RFQ’s best bid amount from the underlying settlement venue’s Order Books. Denominated in the clearing_currency of the RFQ. |
| best_ask_quantity | string | true | The RFQ’s best bid amount from the underlying settlement venue’s Order Books. Denominated in the clearing_currency of the RFQ. |
| created_at | decimal | true | The time in UNIX milliseconds since the epoch when the market data was received from the underlying venue. |
| greeks | object | false | An object of variables used to assess the risk & exposure of a derivatives contract. |
| > delta | string | true | The delta value of the strategy. |
| > theta | string | true | The theta value of the strategy. |
| > vega | string | true | The vega value of the strategy. |
| > gamma | string | true | The gamma value of the strategy. |
| legs | Array of Objects | true | The composite Instruments of the RFQ. |
| > instrument_id | integer | true | The Paradigm created unique identifier of the Instrument. |
| > instrument_name | string | true | The Paradigm normalized name of the Instrument. |
| > mark_price | string | true | The Instrument’s mark price from the underlying settlement venue, denominated in the quote_currency of the RFQ. |
| > mark_price_iv | string | true | The Instrument’s mark price IV (implied volatility) from the underlying settlement venue. Set to null if the value is not available. |
| > best_bid_iv | string | true | The Instrument’s best bid IV (implied volatility) from the underlying settlement venue’s Order Books. Set to null if the value is not available. |
| > best_ask_iv | string | true | The Instrument’s best ask IV (implied volatility) from the underlying settlement venue’s Order Books. Set to null if the value is not available. |
| > best_bid_price | string | true | The Instrument’s best bid price from the underlying settlement venue’s Order Books. Denominated in the quote_currency of the RFQ. |
| > best_ask_price | string | true | The Instrument’s best ask price from the underlying settlement venue’s Order Books. Denominated in the quote_currency of the RFQ. |
| > best_bid_quantity | string | true | The Instrument’s best bid amount from the underlying settlement venue’s Order Books. Denominated in the clearing_currency of the RFQ. |
| > best_ask_quantity | string | true | The Instrument’s best bid amount from the underlying settlement venue’s Order Books. Denominated in the clearing_currency of the RFQ. |
| > greeks | object | false | An object of variables used to assess the risk & exposure of a derivatives contract. |
| >> delta | string | true | The delta value of the leg's Instrument. |
| >> theta | string | true | The theta value of the leg's Instrument. |
| >> vega | string | true | The vega value of the leg's Instrument. |
| >> gamma | string | true | The gamma value of the leg's Instrument. |
Error Codes
| HTTP Status Code | Paradigm Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials were not provided." | You did not provide authentication credentials. |
| 400 | 3300 | "Unavailable RFQ" | Unavailable/invalid RFQ Id provided in request. |
| 400 | 3202 | "Cannot calculate strategy bbo" | BBO strategy for provider RFQ Id could not be computed. |
DRFQv2: [GET] /mmp/status/
/mmp/status/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v2/drfq/mmp/status/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v2/drfq/mmp/status/
method = 'GET'
path = '/v2/drfq/mmp/status/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/mmp/status/ Response example
{
"rate_limit_hit": false
}
A [GET] /mmp/status/ request returns the desk's Market Maker Protection (MMP) status. MMP Status applies on both DRFQ and GRFQ.
This endpoint takes no parameters as part of the request.
Response Schema
Status Code: 200
| Name | Type | Required | Description |
|---|---|---|---|
| rate_limit_hit | bool | true | A flag indicating if rate limit was hit |
DRFQv2: [PATCH] /mmp/status/
/mmp/status/ Request example
# You can also use wget
curl -X PATCH https://api.testnet.paradigm.trade/v2/drfq/mmp/status/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# PATCH /v2/drfq/mmp/status/
method = 'PATCH'
path = '/v2/drfq/mmp/status/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.patch(host+path,
headers=headers)
print(response.status_code)
print(response.text)
A [PATCH] /mmp/status/ resets the Market Maker Protection (MMP) if triggered and enables the user to create new Quotes. MMP Status applies on both DRFQ and GRFQ.
This endpoint takes no parameters as part of the request.
Response Schema
This request will return an HTTP Status Code of 204 to indicate success of operation.
Status Code 204
DRFQv2: [GET] /platform_state/
/platform_state/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v2/drfq/platform_state/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
method = 'GET'
path = '/v2/drfq/platform_state/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/platform_state/ Response example
{
"platform_state":"AVAILABLE",
"published_at":1652323645414,
"next_platform_state":"UNAVAILABLE",
"next_platform_state_at":1653949623000
}
A [GET] /platform_state request allows the user to return the present market availability state.
The Product and Account Management team will communicate expectations around market availability including the next_platform_state and the timing by the next_platform_state_at response key.
Markets can only be in three market availability states:
AVAILABLE- Normal Trading with no restrictions.UNAVAILABLE- No [POST], [PUT], or [DELETE] requests are allowed. All [GET] requests are allowed. Markets are locked and no trading is able to occur.AVAILABLE_CANCEL_ONLY- No [POST] or [PUT] requests are allowed. All [GET] requests are allowed. Markets are locked and no trading is able to occur.
This endpoint takes no parameters as part of the request.
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| platform_state | string | true | The state of the market. Valid values include AVAILABLE, UNAVAILABLE, AVAILABLE_CANCEL_ONLY. |
| published_at | decimal | true | Time of update in unix milliseconds since the epoch. |
| next_platform_state | string | true | The next expected platform_state. Valid values include AVAILABLE, UNAVAILABLE, AVAILABLE_CANCEL_ONLY. |
| next_platform_state_at | decimal | true | Expected time of the next platform_state update in unix milliseconds since the epoch. |
DRFQv2 - WebSocket Notification Channels
DRFQv2: rfqs
An example, as the RFQ Creator,
role==TAKER, whenstate==OPEN
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"rfqs",
"data":{
"account_name":"ParadigmTestNinetyFive",
"base_currency":"BTC",
"clearing_currency":"USD",
"closed_reason":"None",
"counterparties":[
"DSK4",
"DSK3",
"DSK2"
],
"created_at":1670473243746.937,
"description":"Future 16 Dec 22",
"expires_at":1670473543747.062,
"id":"r_2IcG1WoqoCCtjA0C0EhJxotCSu2",
"is_taker_anonymous":true,
"kind":"FUTURE",
"label":"None",
"last_trade":"None",
"last_updated_at":1670473243747.062,
"legs":[
{
"instrument_id":184255,
"instrument_name":"BTC-16DEC22",
"product_code":"CF",
"quantity":"200000",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"CF"
],
"quantity":"200000",
"quote_currency":"USD",
"role":"TAKER",
"side_layering_limit":1,
"state":"OPEN",
"strategy_code": "FT",
"strategy_description":"CF_BTC-16DEC22",
"group_signature":"891e9830b2dcd30747caea878323e30d52356f0c1b50449ccb666e0e530b296a",
"taker_desk_name":"DSK95",
"venue":"DBT",
"taker_profile": {
"average_taker_fill_rate": "NEW",
},
},
"event":"ADDED",
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example, as the RFQ Creator,
role==TAKER, whenstate==CLOSED
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"rfqs",
"data":{
"account_name":"ParadigmTestNinetyFive",
"base_currency":"BTC",
"clearing_currency":"USD",
"closed_reason":"CANCELED_BY_CREATOR",
"counterparties":[
"DSK4",
"DSK3",
"DSK2"
],
"created_at":1670473243746.937,
"description":"Future 16 Dec 22",
"expires_at":1670473581046.396,
"id":"r_2IcG1WoqoCCtjA0C0EhJxotCSu2",
"is_taker_anonymous":true,
"kind":"FUTURE",
"label":"None",
"last_trade":"None",
"last_updated_at":1670473281046.396,
"legs":[
{
"instrument_id":184255,
"instrument_name":"BTC-16DEC22",
"product_code":"CF",
"quantity":"200000",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"CF"
],
"quantity":"200000",
"quote_currency":"USD",
"role":"TAKER",
"side_layering_limit":1,
"state":"CLOSED",
"strategy_code":"FT",
"strategy_description":"CF_BTC-16DEC22",
"group_signature":"891e9830b2dcd30747caea878323e30d52356f0c1b50449ccb666e0e530b296a",
"taker_desk_name":"DSK95",
"venue":"DBT"
},
"event":"REMOVED",
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example, as an RFQ receiver,
role==MAKER, whenstate==OPEN
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"rfqs",
"data":{
"account_name":null,
"base_currency":"BTC",
"clearing_currency":"USD",
"closed_reason":"None",
"counterparties": [],
"created_at":1670473348810.261,
"description":"Future 16 Dec 22",
"expires_at":1670473648810.403,
"id":"r_2IcGEiv9eQEA1CU4H1hfe9ZogAJ",
"is_taker_anonymous":true,
"kind":"FUTURE",
"label":"None",
"last_trade":"None",
"last_updated_at":1670473348810.403,
"legs":[
{
"instrument_id":184255,
"instrument_name":"BTC-16DEC22",
"product_code":"CF",
"quantity":"200000",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"CF"
],
"quantity":"200000",
"quote_currency":"USD",
"role":"MAKER",
"side_layering_limit":1,
"state":"OPEN",
"strategy_code":"FT",
"strategy_description":"CF_BTC-16DEC22",
"group_signature":"891e9830b2dcd30747caea878323e30d52356f0c1b50449ccb666e0e530b296a",
"taker_desk_name":"None",
"venue":"DBT",
"taker_profile": {
"average_taker_fill_rate": "NEW",
},
},
"event":"ADDED",
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example, as an RFQ receiver,
role==MAKER, whenstate==CLOSED
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"rfqs",
"data":{
"account_name":null,
"base_currency":"BTC",
"clearing_currency":"USD",
"closed_reason":"CANCELED_BY_CREATOR",
"counterparties": [],
"created_at":1670473348810.261,
"description":"Future 16 Dec 22",
"expires_at":1670473663770.951,
"id":"r_2IcGEiv9eQEA1CU4H1hfe9ZogAJ",
"is_taker_anonymous":true,
"kind":"FUTURE",
"label":"None",
"last_trade":"None",
"last_updated_at":1670473363770.951,
"legs":[
{
"instrument_id":184255,
"instrument_name":"BTC-16DEC22",
"product_code":"CF",
"quantity":"200000",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"CF"
],
"quantity":"200000",
"quote_currency":"USD",
"role":"MAKER",
"side_layering_limit":1,
"state":"CLOSED",
"strategy_code":"FT",
"strategy_description":"CF_BTC-16DEC22",
"group_signature":"891e9830b2dcd30747caea878323e30d52356f0c1b50449ccb666e0e530b296a",
"taker_desk_name":"None",
"venue":"DBT"
},
"event":"REMOVED",
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
All updates relating to RFQs are sent through the rfqs WebSocket Notification channel.
This is a private channel and consumable by only those aparty to the RFQ. Those counterparties include the RFQ's creator as well as the specified counterparties to the RFQ.
Updates received through the rfqs WebSocket Notification channel can include RFQs being created, canceled, expired, filled and traded away.
The availability of an RFQ to be actioned by any user is denoted by the state key of the object. When an RFQ has a state == OPEN, it is actionable by both the RFQ creator and those specified as counterparties. When an RFQ has a state == CLOSED it is no longer actionable by either the RFQ creator or the specified counterparties.
Response Schema
| Member | Type | Required | Description |
|---|---|---|---|
| jsonrpc | string | true | Always 2.0. |
| method | string | true | The value will always be subscription to indicate message type. |
| params | object | true | |
| > channel | string | true | The Websocket channel the message was delivered upon. Valid values include rfqs. |
| > event | string | true | The change associated with the message. Valid values include ADDED, REMOVED. |
| > data | object | true | An object containing the update’s information. |
| >> id | string | true | The Paradigm created unique identifier of the RFQ. |
| >> account_name | string | true | The user given name of the Venue API Credentials on the Client Admin Dashboard. A null value is returned if role == MAKER. |
| >> created_at | decimal | true | The time in UNIX milliseconds since the epoch when the RFQ was created. |
| >> expires_at | decimal | true | The time in UNIX milliseconds since the epoch when the RFQ expires. |
| >> last_updated_at | integer | true | The time in UNIX milliseconds since the epoch when the RFQ was last updated. |
| >> strategy_code | string | true | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
| >> strategy_description | string | true | The standardized description of the RFQ’s composite Instruments. |
| >> description | string | true | The verbose description of the RFQ’s composite Instruments. |
| >> venue | string | true | The underlying settlement venue of the RFQ. Valid values include DBT, BIT, BYB. |
| >> kind | string | true | The composite Instrument kinds of the RFQ. Valid values include FUTURE, OPTION, OPTION_FUTURE. |
| >> base_currency | string | true | The currency the RFQ is exposed to. Valid values include BTC, ETH, SOL. |
| >> quote_currency | string | true | The currency of the price of the RFQ. Valid values include BTC, ETH, SOL, USD, USDC. |
| >> clearing_currency | string | true | The currency order sizes/quantities are submitted in. Valid values include BTC, ETH, SOL, USD. |
| >> counterparties | Array of strings | true | The Paradigm Desk Names the RFQ was directed towards. An empty array is returned if role == MAKER. |
| >> role | string | true | The role of the user to the RFQ. Valid values include TAKER, MAKER. |
| >> group_signature | string | true | A hash representing the RFQ structure and its creator. It keeps the taker desk anonymous if the RFQ is defined as such. |
| >> taker_desk_name | string | true | The Paradigm Desk Name who created the RFQ. null if role == MAKER and is_taker_anonymous == True. |
| >> legs | Array of Objects | true | The composite Instrument legs of the RFQ. |
| >>> instrument_id | integer | true | The Paradigm created unique identifier of the Instrument. |
| >>> instrument_name | string | true | The Paradigm normalized name of the Instrument to be used across Paradigm’s API. |
| >>> product_code | string | true | The Paradigm created unique two-letter code to represent the specific Instrument. |
| >>> ratio | string | true | The relative multiplier applied to the quantity of the Instrument’s amount relative to the amount of the RFQ. Maximum of 2 decimal places. |
| >>> side | string | true | The direction of the composite leg relative to the RFQ. Valid values include BUY, SELL. |
| >>> quantity | string | true | The size of the Instrument leg to the RFQ, denominated in the clearing_currency of the Instrument. |
| >>> price | string | false | The price of the Instrument leg to the RFQ, denominated in the quote_currency of the Instrument. null if the Instrument is not a hedge leg. Hedge legs must be kind == FUTURE. |
| >> product_codes | Array of strings | true | The Paradigm created Product Codes of the composite Instruments to the RFQ. |
| >> quantity | string | true | The total size of the composite Instrument legs, denominated in the clearing_currency. |
| >> is_taker_anonymous | boolean | true | If the Taker Desk Name is to be revealed to the counterparties to the RFQ. |
| >> taker_profile | json | false | Taker profile information. Only available for anonymous RFQs and PRIME users. |
| >>> average_taker_fill_rate | string | false | Average taker fill rate. Valid values include RARE, NEW, and following buckets: 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100% |
| >> label | string | true | RFQ creator label of the RFQ. |
| >> side_layering_limit | integer | true | The maximum number of Orders a Maker is able to have either side of an RFQ. |
| >> state | string | true | The availability of the RFQ to trade. Valid values include OPEN, CLOSED. |
| >> closed_reason | string | true | The reason the RFQ is no longer available. Valid values include CANCELED_BY_CREATOR, EXPIRED, EXECUTION_LIMIT. null if the RFQ’s state == OPEN. |
| meta | object | true | |
| > seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. |
| > seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired within seq_group. |
DRFQv2: rfq_orders
An example, as the RFQ Creator, RFQ
role==TAKER,event==ADDED, and taker is not anonymous
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"rfq_orders",
"data":{
"id":"o_2IcGsBLQIwl09jdflpb1iRnUT9B",
"price":"16795",
"quantity":"200000",
"desk":"DSK94",
"rfq_id":"r_2IcGerUAbHtEyTxzCiupnEgxk9Z",
"side":"SELL"
},
"event":"ADDED",
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example, as the RFQ Creator, RFQ
role==TAKER,event==REMOVED, and taker is not anonymous
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"rfq_orders",
"data":{
"id":"o_2IcGsBLQIwl09jdflpb1iRnUT9B",
"price":"16795",
"quantity":"200000",
"desk":"DSK94",
"rfq_id":"r_2IcGerUAbHtEyTxzCiupnEgxk9Z",
"side":"SELL"
},
"event":"REMOVED",
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example, as the RFQ Creator, RFQ
role==TAKER,event==ADDED, and taker is anonymous
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"channel": "rfq_orders",
"data": {
"desk": null,
"id": "o_2TTnjN6Us56KmAS1ayo40fx9Mfv",
"price": "0.0085",
"quantity": "25",
"rfq_id": "r_2TTnJU8QycV3NJH48awnmRSJqGA",
"side": "BUY"
},
"event": "ADDED",
"meta": {
"seq_group": 283518899,
"seq_num": 1201
}
}
}
An example, as the RFQ Creator, RFQ
role==TAKER,event==REMOVED, and taker is anonymous
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"channel": "rfq_orders",
"data": {
"desk": null,
"id": "o_2TTndy1xMhoAKdsjRfzRdqgtU51",
"price": "0.0085",
"quantity": "25",
"rfq_id": "r_2TTnJU8QycV3NJH48awnmRSJqGA",
"side": "BUY"
},
"event": "REMOVED",
"meta": {
"seq_group": 283518899,
"seq_num": 1199
}
}
}
All updates relating to an RFQ's Orders are sent through the rfq_orders WebSocket Notifications channel.
This is a private channel and only available to the creator of the RFQ who has the role == TAKER in the RFQ.
Updates received through the rfq_orders WebSocket Notification channel represent events relating to specific related orders. In terms of thinking, it's extremely similar to processing event updates to that of an Order Book with an L3 depth.
- An RFQ Orders
event==ADDEDmessage indicates that an order is available and actionable by both the creater & the creator of the RFQ. - An RFQ Orders
event==REMOVEDmessage indicates that an order is no longer available and actionable by any user.
Response Schema
| Member | Type | Required | Description |
|---|---|---|---|
| jsonrpc | string | true | Always 2.0. |
| method | string | true | The value will always be subscription to indicate message type. |
| params | object | true | |
| > channel | string | true | The Websocket channel the message was delivered upon. Valid values include rfq_orders. |
| > event | string | true | The change associated with the message. Valid values include ADDED, REMOVED, UPDATED. |
| > data | object | true | An object containing the update’s information. |
| >> rfq_id | string | true | The Paradigm created unique identifier of the RFQ. |
| >> side | string | true | The side of the RFQ. Valid values include BUY, SELL. |
| >> price | string | true | The price of the Order, denominated in the quote_currency of the RFQ. |
| >> quantity | string | true | The size of the Order, denominated in the clearing_currency of the RFQ. |
| >> desk | string | true | The Paradigm Desk Name of the counterparty who created the Order. |
| >> id | string | true | The Paradigm created unique identifier of the Order. |
| meta | object | true | |
| > seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. |
| > seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired within seq_group. |
DRFQv2: orders
An example, when Order has a
state==OPEN
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"orders",
"data":{
"account_name":"ParadigmTestNinetyFour",
"canceled_quantity":"0",
"created_at":1670539033867.91,
"filled_quantity":"0",
"id":"o_2IePNBE9NPXk0xJnPmUNZSrri2G",
"label":"just for me",
"last_updated_at":1670539033868.4849,
"pending_fill_quantity":"0",
"price":"16800",
"quantity":"200000",
"rfq_id":"r_2IePMAohwEdvzcTT2SchQWSC7Wf",
"role":"MAKER",
"side":"SELL",
"state":"OPEN",
"time_in_force":"GOOD_TILL_CANCELED",
"type":"LIMIT",
"venue":"DBT",
"legs": [
{
"instrument_id": 12312312312,
"price": "16800"
}
]
},
"event":"NEW",
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example, when Order has a
state==CLOSED
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"orders",
"data":{
"account_name":"ParadigmTestNinetyFive",
"canceled_quantity":"0",
"created_at":1670473741899.189,
"filled_quantity":"0",
"id":"o_2IcH26wODa1OAPgyCnwcFrJ6EGK",
"label":"just for me",
"last_updated_at":1670473741966.041,
"pending_fill_quantity":"200000",
"price":"16795",
"quantity":"200000",
"rfq_id":"r_2IcGerUAbHtEyTxzCiupnEgxk9Z",
"role":"TAKER",
"side":"BUY",
"state":"CLOSED",
"time_in_force":"FILL_OR_KILL",
"type":"LIMIT",
"venue":"DBT",
"legs": []
},
"event":"PENDING_FILL",
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
All updates relating to a desks' Orders are sent through the orders WebSocket Notifications channel.
This is a private channel and provides updates solely about the desks' Orders.
- An Orders
state==OPENmessage indicates that the order is actionable by any user. - An Orders
state==CLOSEDindicates that the order is no longer actionable by any user.
When the RFQ creator, role == TAKER, submits an order, the first published orders WebSocket Notification channel message will always indicate state == CLOSED due to the Order either successfully crossing or being canceled due it's time_in_force attribute being FILL_OR_KILL.
Response Schema
| Member | Type | Required | Description |
|---|---|---|---|
| jsonrpc | string | true | Always 2.0. |
| method | string | true | The value will always be subscription to indicate message type. |
| params | object | true | |
| > channel | string | true | The Websocket channel the message was delivered upon. Valid values include orders. |
| > event | string | true | The change associated with the message. Valid values include NEW, CANCELED, PENDING_FILL, FILLED. |
| > data | object | true | An object containing the update’s information. |
| >> id | string | true | The Paradigm created unique identifier of the Order. |
| >> rfq_id | string | true | The Paradigm created unique identifier of the associated RFQ. |
| >> state | string | true | The availability of the Order for the user to action. Valid values include OPEN, CLOSED. |
| >> side | string | true | The direction of the Order. Valid values include BUY, SELL. |
| >> type | string | true | The type of Order. Valid values include LIMIT. |
| >> time_in_force | string | true | The validity protocol of the Order. Valid values include GOOD_TILL_CANCELED, FILL_OR_KILL. |
| >> created_at | decimal | true | The time in UNIX milliseconds since the epoch when the Order was created. |
| >> last_updated_at | decimal | true | The time in UNIX milliseconds since the epoch when the Order was last updated. |
| >> venue | string | true | The underlying settlement venue associated with the Order & RFQ. Valid values include DBT, BIT, BYB. |
| >> quantity | string | true | The size of the Order, denominated in the clearing_currency of the RFQ. |
| >> legs | Array of Objects | false | The composite Instrument legs of the Order. |
| >> price | string | true | The price of the Order, denominated in the quote_currency of the RFQ. |
| >> label | string | true | The user created label for the order. |
| >> pending_fill_quantity | string | true | The amount of the Order pending settlement on the underlying settlement venue, denominated in the clearing_currency of the RFQ. |
| >> filled_quantity | string | true | The amount of the Order which has been successfully settled on the underlying settlement venue, denominated in the clearing_currency of the RFQ. |
| >> canceled_quantity | string | true | The amount of the Order which has been canceled, denominated in the clearing_currency of the RFQ. |
| >> account_name | string | true | The user given name of the Venue API Credentials on the Client Admin Dashboard. |
| >> role | string | true | The role of the user in the RFQ. Valid values include TAKER, MAKER. |
| meta | object | true | |
| > seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. |
| > seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired within seq_group. |
DRFQv2: trades
An example, when a trade has a
state==PENDING_SETTLEMENT
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"trades",
"data":{
"id":"bt_2IeNvhjvSS7NanFGaalF2yZWSXm",
"exec_id":"None",
"order_id":"o_2IeNvhjR6zW0iCrkh6Q3T5lOyTn",
"rfq_id":"r_2IeNtwelJ18OKY88ltCjPFg4NVb",
"venue":"DBT",
"kind":"FUTURE",
"state":"PENDING_SETTLEMENT",
"role":"TAKER",
"executed_at":1670538321612.0579,
"filled_at":"None",
"side":"BUY",
"price":"17204",
"quantity":"200000",
"filled_quantity":"0",
"rejected_quantity":"0",
"rejected_party":"None",
"rejected_reason":"None",
"account":"ParadigmTestNinetyFive",
"index_price": "63000",
"legs":[
{
"instrument_id":184255,
"instrument_name":"BTC-16DEC22",
"price":"17204",
"index_price": "63000",
"product_code":"CF",
"quantity":"200000",
"ratio":"1",
"side":"BUY",
"venue_trade_id":"None",
"fee_quantity":"None",
"fee_currency":"BTC"
}
],
"strategy_description":"CF_BTC-16DEC22",
"description":"Future 16 Dec 22",
"quote_currency":"USD",
"mark_price":"17203.49"
},
"event":"PENDING_SETTLEMENT",
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example, when a trade has a
state==FILLED
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"trades",
"data":{
"id":"bt_2IeNvhjvSS7NanFGaalF2yZWSXm",
"exec_id":"366192",
"order_id":"o_2IeNvhjR6zW0iCrkh6Q3T5lOyTn",
"rfq_id":"r_2IeNtwelJ18OKY88ltCjPFg4NVb",
"venue":"DBT",
"kind":"FUTURE",
"state":"FILLED",
"role":"TAKER",
"executed_at":1670538321612.0579,
"filled_at":1670538322000.0,
"side":"BUY",
"price":"17204",
"quantity":"200000",
"filled_quantity":"200000",
"rejected_quantity":"0",
"rejected_party":"None",
"rejected_reason":"None",
"account":"ParadigmTestNinetyFive",
"index_price": "63000",
"legs":[
{
"instrument_id":184255,
"instrument_name":"BTC-16DEC22",
"price":"17204",
"index_price": "63000",
"product_code":"CF",
"quantity":"200000",
"ratio":"1",
"side":"BUY",
"venue_trade_id":"141327736",
"fee_quantity":"0.0116252",
"fee_currency":"BTC"
}
],
"strategy_description":"CF_BTC-16DEC22",
"description":"Future 16 Dec 22",
"quote_currency":"USD",
"mark_price":"17203.49"
},
"event":"FILLED",
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example, when a trade has a
state==REJECTED
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"trades",
"data":{
"id":"bt_2IeOL5d0Bvh32XgJQMFSu7XMyPc",
"exec_id":"None",
"order_id":"o_2IeOL5cYl8HoJHBIAlb1mLWbo13",
"rfq_id":"r_2IeOIha69NSwfkGG1qjJd7U3jEF",
"venue":"DBT",
"kind":"FUTURE",
"state":"REJECTED",
"role":"TAKER",
"executed_at":1670538523874.681,
"filled_at":"None",
"side":"BUY",
"price":"16800",
"quantity":"200000",
"filled_quantity":"0",
"rejected_quantity":"200000",
"rejected_party":"None",
"rejected_reason":"Deribit error: Price for trade is lower than min sell price. Your Ask for Future 16 Dec 22 was CANCELED",
"account":"ParadigmTestNinetyFive",
"index_price": "None",
"legs":[
{
"index_price": "None",
"instrument_id":184255,
"instrument_name":"BTC-16DEC22",
"price":"16800",
"product_code":"CF",
"quantity":"200000",
"ratio":"1",
"side":"BUY",
"venue_trade_id":"None",
"fee_quantity":"None",
"fee_currency":"BTC"
}
],
"strategy_description":"CF_BTC-16DEC22",
"description":"Future 16 Dec 22",
"quote_currency":"USD",
"mark_price":"17189.22"
},
"event":"REJECTED",
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
All updates relating to a desks' Trades are sent through the trades WebSocket Notifications channel.
This is a private channel and provides updates solely about the desks' Trades.
- A Trades
state==PENDING_SETTLEMENTmessage indicates that a desks' order has been successfully matched and is being cleared by the underlying settlement venue. - A Trades
state==FILLEDmessage indicates that the trade has reached finality and be successfully cleared on the underlying settlement venue. - A Trades
state==REJECTEDmessage indicates that the trade has reached finality and has been rejected at clearing by the underlying settlement venue.
Response Schema
| Member | Type | Required | Description |
|---|---|---|---|
| jsonrpc | string | true | Always 2.0. |
| method | string | true | The value will always be subscription to indicate message type. |
| params | object | true | |
| > channel | string | true | The Websocket channel the message was delivered upon. Valid values include trades. |
| > event | string | true | The change associated with the message. Valid values include PENDING_SETTLEMENT, FILLED, REJECTED. |
| > data | object | true | An object containing the update’s information. |
| >> id | string | true | The Paradigm created unique identifier of the Trade. |
| >> exec_id | string | true | The corresponding Block Trade unique identifier created by either the Paradigm or the underlying settlement venue. |
| >> order_id | string | true | The Paradigm created unique Order identifier associated with the Trade. |
| >> rfq_id | string | true | The Paradigm created unique identifier of the RFQ. |
| >> venue | string | true | The underlying settlement venue of the RFQ. Valid values include DBT, BIT, BYB. |
| >> kind | string | true | The nature of the strategy traded. Valid values include OPTION, FUTURE, OPTION_FUTURE. |
| >> state | string | true | The indication if the trade has reached settlement finality. Valid values include PENDING_SETTTLEMENT, FILLED, REJECTED |
| >> role | string | true | The role of the user in the Trade. Valid values include TAKER, MAKER. |
| >> executed_at | decimal | true | The time in UNIX milliseconds since the epoch when the trade was executed on Paradigm. |
| >> filled_at | decimal | true | The time in UNIX milliseconds since the epoch when trade with either successfully settled or rejected on Paradigm. -1 if the Trade failed to successfully settle. |
| >> side | string | true | The direction of the user in the trade. Valid values include BUY , SELL. |
| >> price | string | true | The strategy price of the trade, denominated the quote_currency of the RFQ. |
| >> index_price | string | true | The index price at the time the trade was executed. |
| >> quantity | string | true | The amount of the trade, denominated in the clearing_currency of the RFQ. |
| >> filled_quantity | string | true | The successfully filled amount of the trade, denominated in the clearing_currency of the RFQ. |
| >> rejected_quantity | string | true | The rejected amount of the trade, denominated in the clearing_currency of the RFQ. |
| >> rejected_party | string | true | The counterparty responsible for the Trade Rejection. Valid values include USER, COUNTERPARTY. null If Trade successfully settled. |
| >> rejected_reason | string | true | The reason for the Trade Rejection. null if Trade successfully settled. |
| >> legs | Array of Objects | true | The composite Instrument legs of the Trade. |
| >>> intrument_id | integer | true | The Paradigm created unique identifier of the Instrument., |
| >>> instrument_name | string | true | The Paradigm normalized name of the Instrument used across Paradigm’s API. |
| >>> index_price | string | true | The leg index price at the moment the trade was executed. |
| >>> ratio | string | true | The relative multiplier applied to the quantity of the Instrument’s amount relative to the amount of the RFQ. |
| >>> side | string | true | The direction of the composite Instrument to the Trade. Valid values include BUY, SELL. |
| >>> price | string | true | The price of the Instrument leg, denominated in the quote_currency of the RFQ. |
| >>> quantity | string | true | The size of the Instrument leg, denominated in the clearing_currency of the RFQ. |
| >>> venue_trade_id | string | true | The corresponding unique trade identifier present on the underlying settlement venue. |
| >>> fee_quantity | string | true | The amount of fees paid/earned to execute this leg on the underlying settlement venue, denominated in the fee_currency. |
| >>> fee_currency | string | true | The currency the fee_amount is denominated in. |
| >> strategy_description | string | true | The standardized description of the Trade’s composite Instruments. |
| >> description | string | true | The verbose description of the Trade’s composite Instruments. |
| >> quote_currency | string | true | The currency in the price is denominated in, denominated in the quote_currency of the RFQ. |
| >> mark_price | string | true | The strategy mark price from the underlying settlement venue of the composite Instruments to the trade. |
| >> account | string | true | The user given name of the Venue API Credentials on the Client Admin Dashboard. |
| meta | object | true | |
| > seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. |
| > seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired within seq_group. |
DRFQv2: trade_tape
An example, when a trade has the
state==FILLED
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"trade_tape",
"data":{
"id":"bt_2IeNvhjvSS7NanFGaalF2yZWSXm",
"rfq_id":"r_2IeNtwelJ18OKY88ltCjPFg4NVb",
"venue":"DBT",
"kind":"FUTURE",
"state":"FILLED",
"executed_at":1670538321612.0579,
"filled_at":1670538322000.0,
"side":"SELL",
"price":"17204",
"quantity":"200000",
"legs":[
{
"instrument_id":184255,
"instrument_name":"BTC-16DEC22",
"ratio":"1",
"side":"BUY",
"price":"17204",
"product_code":"CF",
"quantity":"200000"
}
],
"strategy_code":"FT",
"strategy_description":"CF_BTC-16DEC22",
"description":"Future 16 Dec 22",
"quote_currency":"USD",
"mark_price":"17203.49"
},
"event":"FILLED",
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
All successfully cleared Trades on Paradigm are sent through the trade_tape WebSocket Notifications channel.
This is a public channel and consumable by all.
As such, no identifiable information is apart of any messages and only successfully cleared trades upon the underlying settlement venue are published.
Response Schema
| Member | Type | Required | Description |
|---|---|---|---|
| jsonrpc | string | true | Always 2.0. |
| method | string | true | The value will always be subscription to indicate message type. |
| params | object | true | |
| > channel | string | true | The Websocket channel the message was delivered upon. Valid values include trade_tape. |
| > event | string | true | The change associated with the message. Valid values include FILLED. |
| > data | object | true | An object containing the update’s information. |
| >> id | string | true | The Paradigm created unique identifier of the Trade. |
| >> rfq_id | string | true | The Paradigm created unique identifier of the RFQ. |
| >> venue | string | true | The underlying settlement venue of the RFQ. Valid values include DBT, BIT, BYB. |
| >> kind | string | true | The nature of the strategy traded. Valid values include OPTION, FUTURE, OPTION_FUTURE. |
| >> state | string | true | The indication if the trade has reached settlement finality. Valid values include FILLED. |
| >> executed_at | decimal | true | The time in UNIX milliseconds since the epoch when the trade was executed on Paradigm. |
| >> filled_at | decimal | true | The time in UNIX milliseconds since the epoch when trade with either successfully settled or rejected on Paradigm. |
| >> side | string | true | The direction of the user in the trade. Valid values include BUY , SELL. |
| >> price | string | true | The strategy price of the trade, denominated the quote_currency of the RFQ. |
| >> index_price | string | false | The index price at the time the trade was executed. |
| >> quantity | string | true | The amount of the trade, denominated in the clearing_currency of the RFQ. |
| >> legs | string | true | The composite Instrument legs of the Trade. |
| >>> instrument_id | integer | true | The Paradigm created unique identifier of the Instrument. |
| >>> instrument_name | string | true | The composite Instrument legs of the Trade. |
| >>> ratio | string | true | The relative multiplier applied to the quantity of the Instrument’s amount relative to the amount of the RFQ. |
| >>> side | string | true | The direction of the composite Instrument to the Trade. Valid values include BUY, SELL. |
| >>> price | string | true | The price of the Instrument leg, denominated in the quote_currency of the RFQ. |
| >>> quantity | string | true | The size of the Instrument leg, denominated in the clearing_currency of the RFQ. |
| >>> index_price | string | false | The leg index price at the moment the trade was executed. |
| >> strategy_code | string | true | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
| >> strategy_description | string | true | The size of the Instrument leg, denominated in the clearing_currency of the RFQ. |
| >> description | string | true | The verbose description of the Trade’s composite Instruments. |
| >> quote_currency | string | true | The verbose description of the Trade’s composite Instruments. |
| >> mark_price | string | true | The strategy mark price from the underlying settlement venue of the composite Instruments to the trade. |
| meta | object | true | |
| > seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. |
| > seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired within seq_group. |
DRFQv2: bbo.{rfq_id}
An example, of an update message
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"data":{
"rfq_id":"r_2LA8TjDOjWAHtRJ7CeLWzQXf4Ah",
"min_price":"23658.58",
"max_price":"24379.14",
"mark_price":"24019.18",
"best_bid_price":"24017.50",
"best_ask_price":"24018.00",
"best_bid_amount":"342090.0",
"best_ask_amount":"42500.0",
"created_at":1675302554270,
"greeks": {
"delta": "0.00466",
"gamma": "0.00001",
"theta": "-0.02436",
"vega": "0.20599",
}
"legs":[
{
"best_bid_price":"24017.50",
"best_ask_price":"24018.00",
"best_bid_amount":"342090.0",
"best_ask_amount":"42500.0",
"instrument_id":26707,
"instrument_name":"ETH-29DEC23-9000-C",
"mark_price":"24019.18",
"best_bid_iv": null,
"best_ask_iv": null,
"mark_price_iv": null,
"greeks": {
"delta": "0.00466",
"gamma": "0.00001",
"theta": "-0.02436",
"vega": "0.20599",
},
}
]
},
"channel":"bbo",
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
All updates relating to an RFQ's composite instrument & structure market data are sent via the bbo.{rfq_id} WebSocket Notification Channel.
This is a public channel and consumable by all.
This channel publishes real-time updates of the underlying market data from the composite instruments' settlement venue.
Parameters
| Member | Type | Required | Enums | Description |
|---|---|---|---|---|
| rfq_id | string | true | rfq_id |
The Paradigm created rfq_id of the RFQ which has a state == OPEN. |
Response Schema
| Member | Type | Required | Description |
|---|---|---|---|
| jsonrpc | string | true | Always 2.0. |
| method | string | true | The value will always be subscription to indicate message type. |
| params | object | true | |
| > channel | string | true | The Websocket channel the message was delivered upon. Valid values include bbo.{rfq_id}. |
| > event | string | true | The change associated with the message. Valid values include NEW. |
| > data | object | true | An object containing the update’s information. |
| >> id | string | true | The Paradigm created unique identifier of the RFQ. |
| >> min_price | string | true | The minimum allowed price with which the RFQ can trade as per the underlying settlement venue’s trading price bands. Denominated in the quote_currency of the RFQ. |
| >> max_price | string | true | The maximum allowed price with which the RFQ can trade as per the underlying settlement venue’s trading price bands. Denominated in the quote_currency of the RFQ. |
| >> mark_price | string | true | The strategy mark price of the RFQ’s composite Instruments from the underlying settlement venue. Denominated in the quote_currency of the RFQ. |
| >> best_bid_price | string | true | The RFQ’s best bid price from the underlying settlement venue’s Order Books. Denominated in the quote_currency of the RFQ. |
| >> best_ask_price | string | true | The RFQ’s best ask price from the underlying settlement venue’s Order Books. Denominated in the quote_currency of the RFQ. |
| >> best_bid_amount | string | true | The RFQ’s best bid amount from the underlying settlement venue’s Order Books. Denominated in the clearing_currency of the RFQ. |
| >> best_ask_amount | string | true | The RFQ’s best bid amount from the underlying settlement venue’s Order Books. Denominated in the clearing_currency of the RFQ. |
| >> created_at | decimal | true | The time in UNIX milliseconds since the epoch when the message was created by Paradigm. |
| >> greeks | object | false | An object of variables used to assess the risk & exposure of a derivatives contract. |
| >>> delta | string | true | The delta value of the strategy. |
| >>> theta | string | true | The theta value of the strategy. |
| >>> vega | string | true | The vega value of the strategy. |
| >>> gamma | string | true | The gamma value of the strategy. |
| >> legs | Array of Objects | true | The composite Instruments of the RFQ. |
| >>> instrument_id | integer | true | The Paradigm created unique identifier of the Instrument. |
| >>> instrument_name | string | true | The Paradigm normalized name of the Instrument. |
| >>> mark_price | string | true | The Instrument’s mark price from the underlying settlement venue, denominated in the quote_currency of the RFQ. |
| >>> mark_price_iv | string | true | The Instrument’s mark price IV (implied volatility) from the underlying settlement venue. Set to null if the value is not available. |
| >>> best_bid_iv | string | true | The Instrument’s best bid IV (implied volatility) from the underlying settlement venue’s Order Books. Set to null if the value is not available. |
| >>> best_ask_iv | string | true | The Instrument’s best ask IV (implied volatility) from the underlying settlement venue’s Order Books. Set to null if the value is not available. |
| >>> best_bid_price | string | true | The Instrument’s best bid price from the underlying settlement venue’s Order Books. Denominated in the quote_currency of the RFQ. |
| >>> best_ask_price | string | true | The Instrument’s best ask price from the underlying settlement venue’s Order Books. Denominated in the quote_currency of the RFQ. |
| >>> best_bid_amount | string | true | The Instrument’s best bid amount from the underlying settlement venue’s Order Books. Denominated in the clearing_currency of the RFQ. |
| >>> best_ask_amount | string | true | The Instrument’s best bid amount from the underlying settlement venue’s Order Books. Denominated in the clearing_currency of the RFQ. |
| >>> greeks | object | false | An object of variables used to assess the risk & exposure of a derivatives contract. |
| >>>> delta | string | true | The delta value of the leg's Instrument. |
| >>>> theta | string | true | The theta value of the leg's Instrument. |
| >>>> vega | string | true | The vega value of the leg's Instrument. |
| >>>> gamma | string | true | The gamma value of the leg's Instrument. |
| meta | object | true | | | > seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. | | > seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired within seq_group. |
DRFQv2: platform_state
An example when the
platform_state==UNAVAILABLE.
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"platform_state",
"data":{
"platform_state":"UNAVAILABLE",
"published_at":1652323465888,
"next_platform_state":"AVAILABLE_CANCEL_ONLY",
"next_platform_state_at":1652324400000
}
}
}
An example when the
platform_state==AVAILABLE_CANCEL_ONLY.
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"platform_state",
"data":{
"platform_state":"AVAILABLE_CANCEL_ONLY",
"published_at":1652323475415,
"next_platform_state":"AVAILABLE",
"next_platform_state_at":1652324400000
}
}
}
An example when the
platform_state==AVAILABLE.
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"platform_state",
"data":{
"platform_state":"AVAILABLE",
"published_at":1652323494426,
"next_platform_state":"UNAVAILABLE",
"next_platform_state_at":1653966000000
}
}
}
All updates relating to market availability are sent through the platform_state WebSocket Notifications channel.
The Product and Account Management team will communicate expectations around market availability including the next_platform_state and the timing by the next_platform_state_at response key.
Markets can only be in three market availability states:
AVAILABLE- Normal Trading with no restrictions.UNAVAILABLE- No [POST], [PUT], or [DELETE] requests are allowed. All [GET] requests are allowed. Markets are locked and no trading is able to occur.AVAILABLE_CANCEL_ONLY- No [POST] or [PUT] requests are allowed. All [GET] requests are allowed. Markets are locked and no trading is able to occur.
Response Schema
| Member | Type | Required | Description |
|---|---|---|---|
| jsonrpc | string | true | Always 2.0. |
| method | string | true | Value will always be subscription to indicate message type. |
| channel | string | true | Channel the message was delivered upon. |
| data | object | true | Object of information relating to the message received. |
| > platform_state | string | true | The state of the market. Valid values include AVAILABLE, UNAVAILABLE, AVAILABLE_CANCEL_ONLY. |
| > published_at | int | true | Time of update in unix milliseconds since the epoch. |
| > next_platform_state | string | true | The next expected platform_state. Valid values include AVAILABLE, UNAVAILABLE, AVAILABLE_CANCEL_ONLY. |
| > next_platform_state_at | int | true | Expected time of the next platform_state update in unix milliseconds since the epoch. |
DRFQv2: market_maker_protection
An example when the market maker protection has triggered.
{
"jsonrpc": "2.0",
"method": "subscription",
"params":
{
"channel": "market_maker_protection",
"data":
{
"kind": "TRIGGERED"
}
}
}
Market Maker Protection (MMP) is a feature designed to help market makers manage their risk when quoting in a vast range of financial instruments. It assists market makers in controlling the possibility of executing all trades simultaneously, which could potentially overwhelm them.
When triggered, the system will cancel all open quotes and send the above message in this private channel.
One can visit the admin site to view the settings.
Response Schema
| Member | Type | Required | Description |
|---|---|---|---|
| jsonrpc | string | true | Always 2.0. |
| method | string | true | Value will always be subscription to indicate message type. |
| channel | string | true | Channel the message was delivered upon. |
| data | object | true | Object of information relating to the message received. |
| > kind | string | true | The action of the WS Message. Valid values include TRIGGERED. |
Message Sequence Numbers
WebSocket messages contain sequence numbers to help clients identify if
they have missed any messages during temporary disconnections or network errors. The sequence number
is included in the WebSocket messages under the meta field.
Message Structure with Sequence Numbers
WebSocket messages now include an additional meta field that contains the following properties:
| Member | Type | Description |
|---|---|---|
| seq_group | number | Unique identifier for the group of messages |
| seq_num | number | Sequence number of the message within the group |
Here's an example of a WebSocket message with sequence numbers:
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"channel": "rfq",
"data": {
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
OB - Complex Order Books
OBv1 - REST Endpoints
OB: [GET] /instruments/
/instruments/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/ob/instruments/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/ob/v1/instruments/
method = 'GET'
path = '/v1/ob/instruments/?asset=BTC&kind=FUTURE'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/instruments/ Response example
{
"count": 1341,
"next": "cD05NjE0Nw==",
"results": [
{
"expiration": 1680854400000,
"greeks": null,
"base_currency": "ETH",
"margin_kind": "INVERSE",
"kind": "FUTURE",
"mark_price": "1718.3",
"name": "ETH-7APR23",
"option_kind": null,
"product_code": "AZ",
"strike": null,
"venue": "DBT",
"venue_name": "ETH-7APR23"
},
{
"expiration": 1680854400000,
"greeks": null,
"base_currency": "BTC",
"margin_kind": "INVERSE",
"kind": "FUTURE",
"mark_price": "27144.7",
"name": "BTC-7APR23",
"option_kind": null,
"product_code": "CF",
"strike": null,
"venue": "DBT",
"venue_name": "BTC-7APR23"
},
{
"expiration": 1703836800000,
"greeks": {
"delta": "0.46821",
"gamma": "0.00043",
"mark_price": "0.1437",
"theta": "-0.67045",
"vega": "6.03833",
"last_updated_at": 1679945359701
},
"base_currency": "ETH",
"margin_kind": "INVERSE",
"kind": "OPTION",
"mark_price": "0.1437",
"name": "ETH-29DEC23-2100-C",
"option_kind": "CALL",
"product_code": "EH",
"strike": "2100",
"venue": "DBT",
"venue_name": "ETH-29DEC23-2100-C"
},
{
"expiration": 1703836800000,
"greeks": {
"delta": "-0.52159",
"gamma": "2e-05",
"mark_price": "0.3911",
"theta": "-11.79815",
"vega": "95.74543",
"last_updated_at": 1679945357964
},
"base_currency": "BTC",
"margin_kind": "INVERSE",
"kind": "OPTION",
"mark_price": "0.3911",
"name": "BTC-29DEC23-34000-P",
"option_kind": "PUT",
"product_code": "DO",
"strike": "34000",
"venue": "DBT",
"venue_name": "BTC-29DEC23-34000-P"
}
]
}
A [GET] /instruments/ request allows you to return all available Instruments upon Paradigm. Instruments are the legs part of an RFQ.
Instrument names match the naming conventions of the underlying venue.
You must paginate to return the complete results.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | Cursor value used to paginate through pages. |
| asset | query | string | false | Base Currency of Instrument. Valid values include BTC, ETH, BCH, XRP, EOS. |
| ordering | query | string | false | How returned Instruments are sorted. Valid values include creation, expiration, and default. |
| page_size | query | string | false | Number of Instruments returned per pagination. |
| kind | query | string | false | The type of Instrument. Valid values include FUTURE and OPTION. |
| venue | query | string | false | The underlying venue the Instrument is cleared & settled upon. Valid values include DBT, BIT, BYB. |
| name | query | [string] | false | Paradigm Name of Instruments. Example /v1/ob/instruments/?name=BTC-PERPETUAL,ETH-PERPETUAL. |
| include_greeks | query | boolean | false | Include greeks in the response. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | int | true | Total number of Instruments to paginate. |
| next | string | true | Pagination cursor value. |
| results | array of objects | true | |
| > base_currency | string | true | The currency the Instrument is exposed to. Valid values include BCH, BTC, ETH. |
| > margin_kind | string | true | The nature of how the contract is margined. Valid values include LINEAR, INVERSE. |
| > option_kind | string | true | The kind of Option. null if instrument is not an Option. Valid values include CALL, PUT, null. |
| > product_code | string | true | The Paradigm created unique two-letter code to represent the specific Instrument. |
| > name | string | true | The Paradigm standardized name of the Instrument. |
| > strike | string | true | Option Instrument Strike Price. null if kind == FUTURE. |
| > kind | string | true | The type of Instrument. Valid values include FUTURE and OPTION. |
| > venue | string | true | Underlying venue Instrument is cleared & settled upon. Valid values include DBT, BIT, BYB. |
| > expiration | number | true | Instrument expiration timestamp in unix milliseconds since the epoch. null if Instrument does not have an expiration. |
| > venue_name | string | true | The name of the Instrument per the underlying venue's naming conventions. |
| > mark_price | string | true | The mark price of the Instrument. |
| > greeks | object | false | The greeks of the Instrument. |
| >> delta | string | true | The delta of the Instrument. |
| >> gamma | string | true | The gamma of the Instrument. |
| >> theta | string | true | The theta of the Instrument. |
| >> vega | string | true | The vega of the Instrument. |
| >> mark_price | string | true | The mark price of the Instrument. Deprecated: please use the top level mark_price |
| >> last_updated_at | int | true | The timestamp in unix milliseconds since the epoch when the greek values were last updated. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 400 | 3005 | "Invalid filter parameter" | You provided invalid value to one or more filter parameters. |
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
OB: [GET] /instruments/{venue}/{instrument_name}/
/instruments/{venue}/{instrument_name}/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/ob/instruments/DBT/BTC-PERPETUAL/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/ob/instruments/{venue}/{instrument_name}
method = 'GET'
path = '/v1/ob/instruments/DBT/BTC-PERPETUAL/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/instruments/{venue}/{instrument_name}/ Response example
{
"expiration": 1703836800000,
"greeks": {
"delta": "-0.52159",
"gamma": "2e-05",
"mark_price": "0.3911",
"theta": "-11.79815",
"vega": "95.74543",
"last_updated_at": 1679945357964
},
"base_currency": "BTC",
"margin_kind": "INVERSE",
"kind": "OPTION",
"mark_price": "0.3911",
"name": "BTC-29DEC23-34000-P",
"option_kind": "PUT",
"product_code": "DO",
"strike": "34000",
"venue": "DBT",
"venue_name": "BTC-29DEC23-34000-P"
}
A [GET] /instruments/{venue}/{instrument_name}/ allows you to return information about a specific available Instrument.
Instruments are the legs part of an RFQ.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| venue | query | string | true | The underlying venue the Instrument is cleared & settled upon. Valid values include DBT, BIT, BYB. |
| name | query | string | true | Paradigm Instrument Name. |
| include_greeks | query | boolean | false | Include greeks in the response. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | int | true | Total number of Instruments to paginate. |
| next | string | true | Pagination cursor value. |
| results | array of objects | true | |
| > base_currency | string | true | The currency the Instrument is exposed to. Valid values include BCH, BTC, ETH. |
| > margin_kind | string | true | The nature of how the contract is margined. Valid values include LINEAR, INVERSE. |
| > option_kind | string | true | The kind of Option. null if instrument is not an Option. Valid values include CALL, PUT, null. |
| > product_code | string | true | The Paradigm created unique two-letter code to represent the specific Instrument. |
| > name | string | true | The Instrument name per the underlying venue's naming convention. |
| > strike | string | true | Option Instrument Strike Price. null if kind == FUTURE. |
| > kind | string | true | The type of Instrument. Valid values include FUTURE and OPTION. |
| > venue | string | true | Underlying venue Instrument is cleared & settled upon. Valid values include DBT, BIT, BYB. |
| > expiration | number | true | Instrument expiration timestamp in unix milliseconds since the epoch. null if Instrument does not have an expiration. |
| > venue_name | string | true | The name of the Instrument per the underlying venue's naming conventions. |
| > mark_price | string | true | The mark price of the Instrument. |
| > greeks | object | false | The greeks of the Instrument. |
| >> delta | string | true | The delta of the Instrument. |
| >> gamma | string | true | The gamma of the Instrument. |
| >> theta | string | true | The theta of the Instrument. |
| >> vega | string | true | The vega of the Instrument. |
| >> mark_price | string | true | The mark price of the Instrument. Deprecated: please use the top level mark_price |
| >> last_updated_at | int | true | The timestamp in unix milliseconds since the epoch when the greek values were last updated. |
Error Codes
| HTTP Status Code | Message | Meaning |
|---|---|---|
| 401 | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
OB: [GET] /orders/
/orders/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/ob/orders/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/ob/orders/
method = 'GET'
path = '/v1/ob/orders/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/orders/ Response example
{
"count":2,
"next":null,
"results":[
{
"client_order_id":"",
"rfq_id":551,
"id":379,
"filled_quantity":"0",
"filled_average_price":"0",
"limit_price":"0.1645",
"requested_quantity":"25",
"status":"CLOSED",
"side": "BUY",
"venue":"DBT"
},
{
"client_order_id":"",
"rfq_id":551,
"id":378,
"filled_quantity":"0",
"filled_average_price":"0",
"limit_price":"0.0642",
"requested_quantity":"25",
"satus":"CLOSED",
"side": "BUY",
"venue":"DBT"
}
]
}
A [GET] /orders/ request will return all the requesting user's and trading desks' Orders.
Orders are Taker interactions with the Quote Book. Quotes can be Taker & Maker interactions with the Quote Book.
You must paginate to return the complete series of results.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | The pagination cursor value. |
| page_size | query | string | false | Number of orders to return per page. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | int | true | The total number of Orders available from request. |
| next | string | true | The next pagination cursor. This value is null if there are no more pages. |
| results | array of objects | true | |
| > client_order_id | string | true | A unique user created identifier for the Order. |
| > rfq_id | int | true | The Paradigm created unique identifier of the parent RFQ. |
| > id | int | true | The Paradigm created unique identifier of the Order. |
| > filled_quantity | string | true | The amount of the Order cleared & settled in the contract units of the RFQ. |
| > filled_average_price | string | true | The average price of the filled quantity in the Quote Currency of the RFQ. |
| > limit_price | string | true | The price of the submitted Order in the Quote Currency of the RFQ. |
| > requested_quantity | string | true | The size of the Order in contract units of the RFQ. |
| > side | string | true | The direction the Order executed upon the RFQ. Valid values include BUY and SELL. |
| > status | string | true | The current status of the Order. Valid values include CLOSED. |
| > venue | string | true | Underlying venue RFQ is cleared & settled upon. Valid values include DBT, BIT, BYB. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
OB: [GET] /orders/{order_id}/
/orders/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/ob/orders/62/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/ob/orders/{order_id}/
method = 'GET'
path = '/v1/ob/orders/62/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/orders/ Response example
{
"client_order_id":"",
"rfq_id":589,
"id":432,
"filled_quantity":"0",
"filled_average_price":"0",
"limit_price":"2498",
"requested_quantity":"50000000000",
"side":"SELL",
"status":"CLOSED",
"venue":"DBT",
"trades":[
{
"product_code":"CF",
"quantity":"50000000000",
"price":"2498",
"id":479,
"mark_price":"2498.93",
"traded":1625193887212.47,
"action":"SELL",
"quote_currency":"USD",
"quote_id":"q_2Yx3b3pu68Tw7WpQxHCMVSiMo3K",
"api_credential":"ParadigmTestNinetyFive"
}
]
}
A [GET] /orders/{order_id}/ request will one of the requesting user's and trading desks' Orders.
Orders are Taker interactions with the Quote Book. Quotes can be Taker & Maker interactions with the Quote Book.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | endpoint | string | true | The Paradigm created unique identifier of the Order. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| client_order_id | string | true | A unique user created identifier for the trade Order. |
| rfq_id | int | true | The Paradigm created unique identifier of the parent RFQ. |
| id | int | true | The Paradigm created unique identifier of the Order. |
| filled_quantity | string | true | The amount of the Order filled in the contract units of the RFQ. |
| filled_average_price | string | true | The average price of the filled quantity in the Quote Currency of the RFQ. |
| limit_price | string | true | The price of the submitted Order in the Quote Currency of the RFQ. |
| requested_quantity | string | true | The size of the Order in contract units of the RFQ. |
| side | string | true | The execution side of the Order on the RFQ. Valid values include BUY and SELL. |
| status | string | true | The current status of the Order. Valid values include CLOSED. |
| venue | string | true | Underlying venue Instrument is cleared & settled upon. Valid values include DBT, BIT, BYB. |
| trades | array of objects | true | |
| > product_codes | array of strings | true | The Paradigm Product Codes of the Trade. |
| > quantity | string | true | The amount of contracts of the RFQ traded. |
| > price | string | true | The price in the Quote Currency of the RFQ of the Trade. |
| > id | int | true | The Paradigm created unique identifier of the Trade. |
| > mark_price | string | true | The calculated mark price of the RFQ using the Venue's mark prices. |
| > traded | number | true | The time in unix milliseconds since the epoch when the trade was cleared & settled. |
| > action | string | true | The action taken on the Trade. valid values include BUY and SELL. |
| > quote_currency | string | true | The asset which is the Quote Currency of the RFQ. |
| > quote_id | string | true | The Paradigm created unique identifier of the Quote. |
| > api_credential | string | true | The name given the to the Exchange API Key entered on the Paradigm Client Admin dashboard. |
| > status | string | true | The status of the Trade. Valid values include PENDING, COMPLETED, REJECTED. |
Error Codes
| HTTP Status Code | Message | Meaning |
|---|---|---|
| 401 | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
OB: [GET] /quotes/
/quotes/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/ob/quotes/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/ob/quotes/
method = 'GET'
path = '/v1/ob/quotes/?page_size=10&side=BUY'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/quotes/ Response example
{
"count":5755,
"next":"cD0yMDIxLTA3LTI2KzA2JTNBMjMlM0ExOC4xMTc1NDMlMkIwMCUzQTAw",
"results":[
{
"id":"q_2Ym0K4wTjVfLEkditbWH5tFQ9ZW",
"created":1631587522444.227,
"maker":"DSK95",
"price":"0.08",
"remaining_quantity":"0",
"side":"SELL",
"status":"CLOSED",
"client_order_id":"",
"initial_quantity":"25",
"original_quantity":"25",
"filled_quantity":"25",
"rfq_id":2073,
"account":"ParadigmTestNinetyFive"
},
{
"id":"q_2Ym0K4wTjVfLEkditbWH5tFQAzS",
"created":1631587522410.562,
"maker":"DSK95",
"price":"0.0795",
"remaining_quantity":"0",
"side":"BUY",
"status":"CLOSED",
"client_order_id":"",
"initial_quantity":"25",
"original_quantity":"25",
"filled_quantity":"25",
"rfq_id":2073,
"account":"ParadigmTestNinetyFive"
},
{
"id":"q_2Ym0K4wTjVfLEkditbWH5t45Hgz",
"created":1631587470993.799,
"maker":"DSK95",
"price":"0.09",
"remaining_quantity":"24",
"side":"BUY",
"status":"CLOSED",
"client_order_id":"",
"order":{
"id":266218,
"client_order_id":"",
"filled_quantity":"26",
"filled_average_price":"0.0879",
"limit_price":"0.09",
"requested_quantity":"50",
"rfq_id":2073,
"side":"BUY",
"status":"CLOSED",
"venue":"DBT"
},
"initial_quantity":"50",
"original_quantity":"24",
"filled_quantity":"26",
"rfq_id":2073,
"account":"ParadigmTestNinetyFive"
},
{
"id":"q_2Ym0K4wTjVfLEkditbWH51klMn",
"created":1631587437845.888,
"maker":"DSK95",
"price":"0.0879",
"remaining_quantity":"50",
"side":"SELL",
"status":"CLOSED",
"client_order_id":"",
"initial_quantity":"50",
"original_quantity":"50",
"filled_quantity":"0",
"rfq_id":2073,
"account":"ParadigmTestNinetyFive"
}
]
}
A [GET] /quotes/ request will return all the requesting user's and trading desks' Quotes.
You must paginate to return the complete series of results.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | The pagination cursor value. |
| page_size | query | string | false | Number of Quotes to return per page. |
| rfq_id | query | string | false | The Paradigm created unique identifier of the RFQ. |
| side | query | string | false | The direction of the Quotes. Valid values include BUY and SELL. |
| status | query | string | false | The status of the Quotes. Valid values include OPEN and CLOSED. |
| client_order_id | query | string | false | The unique user created identifier for the Quote. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | int | true | The total number of Quotes available to paginate over. |
| next | string | true | The next pagination cursor. This value is null if there are no more pages. |
| results | array of objects | true | |
| > created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| > last_activity | number | true | The time in unix milliseconds since the epoch when the Quote was updated. |
| > id | string | true | The Paradigm created unique identifier of the Quote. |
| > maker | string | true | The Paradigm desk name of the Maker. |
| > price | string | true | The price of the Quote in the Quote Currency of the Strategy. |
| > remaining_quantity | string | true | The total remaining Quote size in contract units of the RFQ. |
| > side | string | true | The direction of the Quote. Valid values include BUY and SELL. |
| > type | string | true | The Quote OrderType. Valid values include LIMIT. |
| > description | string | true | The RFQ strategy description. |
| > product_codes | array of strings | true | The RFQ product codes. |
| > status | string | true | The status of the Quote. Valid values include OPEN and CLOSED. |
| > client_order_id | string | true | A unique user created identifier for the Quote. |
| > order | object | false | Present if Quote crosses the existing market. |
| >> id | int | false | The Paradigm created unique identifier of the Order. |
| >> client_order_id | string | false | A unique user created identifier for the Order. |
| >> filled_quantity | string | false | The filled quantity of the Order in the contract units of the RFQ. |
| >> filled_average_price | string | false | The average filled price of the Order in the quote currency of the RFQ. |
| >> limit_price | string | false | The price of the Order in quote currency of the RFQ. |
| >> requested_quantity | string | false | The requested crossing quantity of the Order. |
| >> rfq_id | int | false | The Paradigm created unique identifier of the RFQ the Order is a child of. |
| >> side | string | false | The direction of the Order. Valid values include BUY and SELL. |
| >> status | string | false | The current status of the Order. Valid values include OPEN and CLOSED. |
| >> venue | string | false | Underlying venue RFQ is cleared & settled upon. Valid values include DBT, BIT, BYB. |
| > rfq_id | int | true | The Paradigm created unique identifier of the RFQ the Quote is a child of. |
| > initial_quantity | string | true | The Quote size in contract units of the RFQ. |
| > original_quantity | string | true | The Quote size in contract units of the RFQ originally rested on the orderbook. |
| > filled_quantity | string | true | The successfully executed size of the Quote in contract units of the RFQ. |
| > account | string | true | The name of the Exchange API Key entered on your Client Admin dashboard. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
OB: [GET] /quotes/{quote_id}/
/quotes/{quote_id}/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/ob/quotes/q_2Yx3b3pu68Tw7WpQxHCMVSiMo3K/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/ob/quotes/{quote_id}/
method = 'GET'
path = '/v1/ob/quotes/152780/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/quotes/{quote_id}/ Response example
{
"id":"q_2Ym0K4wTjVfLEkditbWH5tFQ9ZW",
"created":1631587470993.799,
"maker":"DSK95",
"price":"0.09",
"remaining_quantity":"24",
"side":"BUY",
"status":"CLOSED",
"client_order_id":"",
"order":{
"id":266218,
"client_order_id":"",
"filled_quantity":"26",
"filled_average_price":"0.0879",
"limit_price":"0.09",
"requested_quantity":"50",
"rfq_id":2073,
"side":"BUY",
"status":"CLOSED",
"venue":"DBT"
},
"initial_quantity":"50",
"original_quantity":"24",
"filled_quantity":"26",
"rfq_id":2073,
"canceled":1631587471003.939,
"account":"ParadigmTestNinetyFive"
}
A [GET] /quotes/{quote_id}/ request will return the requesting user's and trading desks' specified Quote.
Orders are Taker interactions with the Quote Book. Quotes can be Taker & Maker interactions with the Quote Book.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | endpoint | string | true | The Paradigm created unique Quote identifier. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| id | string | true | The Paradigm created unique identifier of the Quote. |
| maker | string | true | The Paradigm desk name of the Maker who created the Quote. |
| price | string | true | Price of the Quote in the Quote currency of the RFQ. |
| remaining_quantity | string | true | The total remaining size of the Quote in contract units of the RFQ. |
| side | string | true | The direction of the Quote. Valid values include BUY and SELL. |
| status | string | true | The status of the quote. Valid values include OPEN and CLOSED. |
| client_order_id | string | true | A unique user created identifier for the Quote. |
| order | object | false | Present if Quote crosses the existing market. |
| > id | int | false | The Paradigm created unique identifier of the Order. |
| > client_order_id | string | false | A unique user created identifier for the Order. |
| > filled_quantity | string | false | The filled quantity of the Order in the contract units of the RFQ. |
| > filled_average_price | string | false | The average filled price of the Order in the quote currency of the RFQ. |
| > limit_price | string | false | The price of the Order in quote currency of the RFQ. |
| > requested_quantity | string | false | The requested crossing quantity of the Order. |
| > rfq_id | int | false | The Paradigm created unique identifier of the RFQ the Order is a child of. |
| > side | string | false | The direction of the Order. Valid values include BUY and SELL. |
| > status | string | false | The current status of the Order. Valid values include OPEN and CLOSED. |
| > venue | string | false | Underlying venue RFQ is cleared & settled upon. Valid values include DBT, BIT, BYB. |
| rfq_id | int | true | The Paradigm created unique identifier of the RFQ the Quote is a child of. |
| initial_quantity | string | true | The Quote size in contract units of the RFQ. |
| original_quantity | string | true | The Quote size in contract units of the RFQ originally rested on the orderbook. |
| filled_quantity | string | true | The successfully executed size of the Quote in contract units of the RFQ. |
| canceled | number | true | The time in unix milliseconds since the epoch when the Quote was canceled. null if Quote has not been canceled. |
| account | string | true | The name of the Exchange API Key entered on your Client Admin dashboard. |
Error Codes
| HTTP Status Code | Message | Meaning |
|---|---|---|
| 401 | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
OB: [DELETE] /quotes/
/quotes/ Request example
# You can also use wget
curl -X DELETE https://api.testnet.paradigm.trade/v1/ob/quotes/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# DELETE /v1/ob/quotes/
method = 'DELETE'
path = '/v1/ob/quotes/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.delete(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/quotes/ Response example
{
"action_id": "538da55e-2617-418b-a60f-0fae2413ebdb"
}
A [DELETE] /quotes/ request cancels all active Quotes.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| rfq_id | query | string | false | The Paradigm created unique identifier of the RFQ. |
| side | query | string | false | Cancel all Quotes by side. Valid values include BUY and SELL. Cancels all Quotes regardless of side if not specified. |
| price | query | decimal | false | Cancel all Quotes matching the given price. |
| currency | query | string | false | Cancel all Quotes with exposure or price currency matching the given currency. Valid values include BTC, ETH, SOL, USD, USDC. |
| client_order_id | query | string | false | Cancel all Quotes matching the given client order ID. |
Response Schema
Status Code 202
This request will return an HTTP Status Code of 202 to indicate the cancel quotes request
was accepted. The body contains an action_id, which can be correlated with events on the
quote_status WebSockets channel to asynchronously listen for errors in the Quote Cancel
process. Additionally, CANCELED events will be sent to the quote WS channel for each
cancelled quote, and REMOVED messages will be sent to the public quote_book channel.
Clients should listen to these channels to receive the outcome of a Quote Cancel Request.
| Name | Type | Required | Description |
|---|---|---|---|
| action_id | str | true | The paradigm-generated action_id that correlates API requests with WebSockets events on the quote_status channel |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 400 | 3305 | "Invalid RFQ ID" | Unavailable/Invalid RFQ Id requested. |
| 400 | 3301 | "Invalid quote side. Must either be BUY or SELL." | Requested side query string value must be BUY or SELL. |
OB: [DELETE] /quotes/{quote_id}/
/quotes/{quote_id}/ Request example
# You can also use wget
curl -X DELETE https://api.testnet.paradigm.trade/v1/ob/quotes/15/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# DELETE /v1/ob/quotes/{quote_id}/
method = 'DELETE'
path = '/v1/ob/quotes/q_2Yx3b3pu68Tw7WpQxHCMVSiMo3K/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
response = requests.delete(host+path,
headers=headers)
print(response.status_code)
print(response.text)
A [DELETE] /quotes/{quote_id}/ request cancels an existing OPEN Quote created by the requesting user or user's trading desk.
You cannot cancel multiple Quotes with a single request using this endpoint.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | endpoint | string | true | The Paradigm unique identifier of the Quote the user would like to cancel. |
Response Schema
Status Code 202
This request will return an HTTP Status Code of 202 to indicate the cancel quote request
was accepted. The body contains an action_id, which can be correlated with events on the
quote_status WebSockets channel to asynchronously listen for errors in the Quote Cancel
process. Additionally, CANCELED events will be sent to the quote WS channel for each
cancelled quote, and REMOVED messages will be sent to the public quote_book channel.
Clients should listen to these channels to receive the outcome of a Quote Cancel Request.
| Name | Type | Required | Description |
|---|---|---|---|
| action_id | str | true | The paradigm-generated action_id that correlates API requests with WebSockets events on the quote_status channel |
REST Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 400 | 3308 | "Unavailable quote" | The requested quote_id doesn't match any quote created by your desk. |
WS Error Codes
The following errors are delivered asynchronously via the quote_status WebSockets channel:
| Code | Message | Meaning |
|---|---|---|
| 3306 | "Too late to cancel." | The requested quote_id is already CLOSED or unavailable to cancel. |
OB: [GET] /rfqs/
/rfqs/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/ob/rfqs/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/ob/rfqs/
method = 'GET'
path = '/v1/ob/rfqs/?rfq_id=57'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/rfqs/ Response example
{
"count":13,
"next":null,
"results":[
{
"id":586,
"venue":"DBT",
"created":1625183214149.205,
"description":"Put 9 Jul 21 32000",
"last_trade":null,
"latest_activity":1625183931073.739,
"legs":[
{
"instrument":"BTC-9JUL21-32000-P",
"product_code":"DO",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"DO"
],
"status":"ACTIVE",
"strategy_code": "PT"
},
{
"id":585,
"venue":"DBT",
"created":1625182846124.338,
"description":"PFly 3 Jul 21 32000/33000/34000",
"last_trade":null,
"latest_activity":1625183645052.5972,
"legs":[
{
"instrument":"BTC-3JUL21-32000-P",
"product_code":"DO",
"ratio":"1",
"side":"BUY"
},
{
"instrument":"BTC-3JUL21-33000-P",
"product_code":"DO",
"ratio":"2",
"side":"SELL"
},
{
"instrument":"BTC-3JUL21-34000-P",
"product_code":"DO",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"DO"
],
"status":"ACTIVE",
"strategy_code":"IY"
},
{
"id":583,
"venue":"DBT",
"created":1625181172208.664,
"description":"Call 3 Jul 21 32000",
"last_trade":null,
"latest_activity":1625182827211.0642,
"legs":[
{
"instrument":"BTC-3JUL21-32000-C",
"product_code":"DO",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"DO"
],
"status":"ACTIVE",
"strategy_code":"CL"
},
{
"id":584,
"venue":"DBT",
"created":1625182630789.73,
"description":"Call 16 Jul 21 34000",
"last_trade":null,
"latest_activity":1625182651464.818,
"legs":[
{
"instrument":"BTC-16JUL21-34000-C",
"product_code":"DO",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"DO"
],
"status":"ACTIVE",
"strategy_code":"CL"
},
{
"id":573,
"venue":"DBT",
"created":1625159972983.593,
"description":"Put 16 Jul 21 34000",
"last_trade":null,
"latest_activity":1625182626036.611,
"legs":[
{
"instrument":"BTC-16JUL21-34000-P",
"product_code":"DO",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"DO"
],
"status":"ACTIVE",
"strategy_code":"PT"
},
{
"id":576,
"venue":"DBT",
"created":1625163614843.893,
"description":"CFly 3 Jul 21 31000/32000/33000",
"last_trade":null,
"latest_activity":1625180836165.132,
"legs":[
{
"instrument":"BTC-3JUL21-31000-C",
"product_code":"DO",
"ratio":"1",
"side":"BUY"
},
{
"instrument":"BTC-3JUL21-32000-C",
"product_code":"DO",
"ratio":"2",
"side":"SELL"
},
{
"instrument":"BTC-3JUL21-33000-C",
"product_code":"DO",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"DO"
],
"status":"ACTIVE",
"strategy_code":"IB"
},
{
"id":581,
"venue":"BIT",
"created":1625174242789.779,
"description":"Straddle 3 Jul 21 1900",
"last_trade":null,
"latest_activity":1625180726439.838,
"legs":[
{
"instrument":"ETH-3JUL21-1900-P",
"product_code":"VT",
"ratio":"1",
"side":"BUY"
},
{
"instrument":"ETH-3JUL21-1900-C",
"product_code":"VT",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"VT"
],
"status":"ACTIVE",
"strategy_code":"ID"
},
{
"id":582,
"venue":"DBT",
"created":1625178072216.012,
"description":"Cstm +1 Call 3 Jul 21 32000\n -2 Put 3 Jul 21 33000\n +2 Call 9 Jul 21 34000\n -1 Put 9 Jul 21 35000",
"last_trade":null,
"latest_activity":1625178072216.1091,
"legs":[
{
"instrument":"BTC-3JUL21-32000-C",
"product_code":"DO",
"ratio":"1",
"side":"BUY"
},
{
"instrument":"BTC-3JUL21-33000-P",
"product_code":"DO",
"ratio":"2",
"side":"SELL"
},
{
"instrument":"BTC-9JUL21-34000-C",
"product_code":"DO",
"ratio":"2",
"side":"BUY"
},
{
"instrument":"BTC-9JUL21-35000-P",
"product_code":"DO",
"ratio":"1",
"side":"SELL"
}
],
"product_codes":[
"DO"
],
"status":"ACTIVE",
"strategy_code":"CM"
},
{
"id":575,
"venue":"DBT",
"created":1625160866037.8489,
"description":"Call 9 Jul 21 32000",
"last_trade":null,
"latest_activity":1625173436428.965,
"legs":[
{
"instrument":"BTC-9JUL21-32000-C",
"product_code":"DO",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"DO"
],
"status":"ACTIVE",
"strategy_code":"CL"
},
{
"id":578,
"venue":"DBT",
"created":1625167876394.6099,
"description":"Future 16 Jul 21",
"last_trade":null,
"latest_activity":1625172957461.732,
"legs":[
{
"instrument":"BTC-16JUL21",
"product_code":"CF",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"CF"
],
"status":"ACTIVE",
"strategy_code":"FT"
},
{
"id":580,
"venue":"DBT",
"created":1625172668390.126,
"description":"FSpd 25 Mar 22 / 24 Jun 22",
"last_trade":null,
"latest_activity":1625172668390.178,
"legs":[
{
"instrument":"BTC-25MAR22",
"product_code":"CF",
"ratio":"1",
"side":"SELL"
},
{
"instrument":"BTC-24JUN22",
"product_code":"CF",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"CF"
],
"status":"ACTIVE",
"strategy_code":"FS"
},
{
"id":579,
"venue":"DBT",
"created":1625172652154.217,
"description":"FSpd Perpetual / 24 Jun 22",
"last_trade":null,
"latest_activity":1625172652154.271,
"legs":[
{
"instrument":"BTC-PERPETUAL",
"product_code":"CF",
"ratio":"1",
"side":"SELL"
},
{
"instrument":"BTC-24JUN22",
"product_code":"CF",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"CF"
],
"status":"ACTIVE",
"strategy_code":"FS"
},
{
"id":577,
"venue":"BYB",
"created":1625164847566.429,
"description":"FSpd 24 Sep 21 / 31 Dec 21",
"last_trade":null,
"latest_activity":1625164847566.4849,
"legs":[
{
"instrument":"BTCUSDU21",
"product_code":"BB",
"ratio":"1",
"side":"SELL"
},
{
"instrument":"BTCUSDZ21",
"product_code":"BB",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"BB"
],
"status":"ACTIVE",
"strategy_code":"FS"
}
]
}
A [GET] /rfqs/ request returns information about ACTIVE RFQs.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | Cursor value, from the next key in the response, used to paginate through pages. |
| page_size | query | string | false | Number of RFQs to return per pagination. |
| product_codes | query | string | false | Paradigm Product Codes involved in RFQ. There can be multiple product codes. Example: /v1/ob/rfqs/?product_codes=DO,CF |
| rfq_id | query | string | false | Paradigm created unique identifier for the RFQ. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | int | true | Total number of RFQs to paginate through from request. |
| next | string | true | Pagination cursor value. null if no more pages are available. |
| results | array of objects | true | |
| > id | int | true | The Paradigm created unique identifier of the RFQ. |
| > venue | string | true | The underlying venue the instruments are cleared & settled upon. Valid values include DBT, BIT, BYB. |
| > created | number | true | Time in unix milliseconds since the epoch when the RFQ was created. |
| > description | string | true | The description of the RFQ. |
| > last_trade | object | true | null if RFQ has never been Traded. |
| >> traded | number | false | Time in unix milliseconds since the epoch when the the Trade occurred. |
| >> quantity | string | false | The size of the trade in the contract units of the RFQ. |
| >> price | string | false | The price the RFQ was Traded at in the Quote Currency of the RFQ. |
| > latest_activity | number | true | Time in unix milliseconds since the epoch when the RFQ, it’s quotes and trades were last updated. |
| > legs | array of objects | true | |
| >> instrument | string | true | The Paradigm standardized name of the Instrument. |
| >> venue_instrument | string | true | Instrument name per the underlying venue's naming convention. |
| >> product_code | string | true | Paradigm Product Code of the Instrument. |
| >> ratio | string | true | The multiplier applied to the quantity that the quote applies. |
| >> side | string | true | The direction of the leg. Valid values include BUY and SELL. |
| > price | string | false | Price of Instrument if the Instrument is a hedge leg in RFQ. |
| > product_codes | array of strings | true | Paradigm Product Codes involved in the OB. |
| > status | string | true | Status of the RFQ. Valid values include ACTIVE. |
| > strategy_code | string | true | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
OB: [GET] /rfqs/{rfq_id}/
/rfqs/{rfq_id}/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/ob/rfqs/20/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/ob/rfqs/{rfq_id}/
method = 'GET'
path = '/v1/ob/rfqs/581/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/rfqs/{rfq_id}/ Response example
{
"id":581,
"venue":"BIT",
"created":1625174242789.779,
"description":"Straddle 3 Jul 21 1900",
"last_trade":null,
"latest_activity":1625180726439.838,
"legs":[
{
"instrument":"ETH-3JUL21-1900-P",
"product_code":"VT",
"ratio":"1",
"side":"BUY"
},
{
"instrument":"ETH-3JUL21-1900-C",
"product_code":"VT",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"VT"
],
"status":"ACTIVE"
}
A [GET] /rfqs/{rfq_id}/ request returns information about a specific RFQ.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | endpoint | string | true | The Paradigm created unique identifier of the RFQ. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| id | int | true | The Paradigm created unique identifier of the RFQ. |
| venue | string | true | The underlying venue the instruments are cleared & settled upon. Valid values include DBT, BIT, BYB. |
| created | number | true | Time in unix milliseconds since the epoch when the RFQ was created. |
| description | string | true | The description of the RFQ. |
| last_trade | object | true | null if the RFQ has never been Traded. |
| > traded | number | false | Time in unix milliseconds since the epoch when the the Trade occurred. |
| > quantity | string | false | The size of the trade in the contract units of the RFQ. |
| > price | string | false | The price the RFQ was Traded at. |
| latest_activity | number | true | Time in unix milliseconds since the epoch when the RFQ, it’s quotes and trades were last updated. |
| legs | array of objects | true | |
| > instrument | string | true | The Paradigm standardized name of the Instrument. |
| > venue_instrument | string | true | Instrument name per the underlying venue's naming conventions. |
| > price | string | false | Price of Instrument if the Instrument is a hedge leg in RFQ. |
| > product_code | string | true | Paradigm Product Code of the Instrument. |
| > ratio | string | true | The multiplier applied to the quantity that the quote applies. |
| > side | string | true | The direction of the leg. Valid values include BUY and SELL. |
| product_codes | array of strings | true | Paradigm Product Codes involved in the RFQ. |
| status | string | true | Status of the RFQ. Valid values include ACTIVE and EXPIRED. |
| > strategy_code | string | true | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 400 | 3300 | "Unavailable RFQ" | Unavailable/invalid RFQ Id provided in request. |
OB: [POST] /rfqs/
/rfqs/ Request example
# built ins
import base64
import hmac
import json
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# POST /v1/ob/rfqs/
method = 'POST'
path = '/v1/ob/rfqs/'
payload = {
"venue":"DBT",
"legs":[
{
"instrument":"BTC-PERPETUAL",
"price":23456.01,
"ratio":1,
"side":"BUY"
},
{
"instrument":"BTC-31DEC21",
"ratio":1,
"side":"SELL"
}
]
}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.post(host+path,
headers=headers,
json=payload)
print(response.status_code)
print(response.text)
/rfqs/ Response example
{
"id":588,
"venue":"DBT",
"created":1625187733890.315,
"description":"Cstm +1 Future Perpetual\n -1 Future 31 Dec 21",
"last_trade":null,
"latest_activity":1625187733890.388,
"legs":[
{
"instrument":"BTC-PERPETUAL",
"product_code":"CF",
"ratio":"1",
"side":"BUY"
},
{
"instrument":"BTC-31DEC21",
"product_code":"CF",
"ratio":"1",
"side":"SELL"
}
],
"product_codes":[
"CF"
],
"status":"ACTIVE",
"strategy_code":"CM"
}
A [POST] /rfqs/ request allows a user to create a new RFQ and/or return the RFQ's information if one already exists.
The response schema and response is the same if the requester creates a new RFQ or an RFQ already exists.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| venue | body | string | true | The underlying venue the Instruments in the RFQ are cleared & settled upon. Valid values include DBT, BIT, BYB. |
| legs | body | array of objects | true | The individual legs of the RFQ. |
| > instrument | body | string | true | The name of the Instrument per Paradigm's naming convention. |
| > price | body | string | false | The price of the leg in the Quote Currency of the Instrument if the leg is a hedge leg. |
| > ratio | body | sting | true | The quantity multiplier for the Strategy leg. |
| > side | body | string | true | The direction of the leg. Valid values include BUY and SELL. |
Response Schema
Status Code 201
| Name | Type | Required | Description |
|---|---|---|---|
| id | int | true | The Paradigm created unique identifier of the RFQ. |
| venue | string | true | The underlying RFQ venue the instruments are cleared & settled upon. Valid values include DBT, BIT, and BYB. |
| created | number | true | The time in unix milliseconds since the epoch when the RFQ was created. |
| description | string | true | The description of the RFQ. |
| last_trade | object | true | null if no Trades have occurred on the RFQ. |
| > traded | number | false | Time in unix milliseconds since the epoch when the the Trade occurred. |
| > quantity | string | false | The size of the trade in the contract units of the RFQ. |
| > price | string | false | The price the RFQ was Traded at. |
| latest_activity | number | true | The time in unix milliseconds since the epoch when the RFQ's quotes or trades were last updated. |
| legs | array of objects | true | |
| > instrument | string | true | The Paradigm standardized name of the RFQ leg. |
| > venue_instrument | string | true | The name of the Instrument per the underlying venue's naming convention. |
| > product_code | string | true | The Paradigm created product code of the Instrument in the leg. |
| > ratio | number | true | The multiplier of the quantity of the Instrument in the leg. |
| > side | string | true | The direction of the leg in the strategy. Valid values include BUY and SELL. |
| > price | string | false | The price of the leg in the Quote Currency of the Instrument. Only returned if the leg is a Hedge leg. |
| product_codes | array of strings | true | The Paradigm created product codes of the instrument legs. |
| status | string | true | The status of the RFQ. Valid values include ACTIVE. |
| > strategy_code | string | true | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 403 | N/A | "Your desk is not configured to trade in this venue's products" | Ensure you have the venue key in your request payload. If so, ask Sales to enable the payload for your Desk. |
| 400 | 1306 | "Invalid instrument" | An invalid Instrument name is part of the request. Use the Paradigm standardized instrument key value. |
| 400 | 3203 | "Invalid leg parameters" | There is an invalid leg parameter as part of your request. |
OB: [POST] /rfqs/{rfq_id}/quotes/
/rfqs/{rfq_id}/quotes/ Request example
# built ins
import base64
import hmac
import time
import json
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# POST /v1/ob/rfqs/{rfq_id}/quotes/
method = 'POST'
path = '/v1/ob/rfqs/50126520/quotes/'
payload = {
"rfq_id": 50126520,
"account": "ParadigmTestNinetyFive",
"client_order_id": "a823e52e-9238-4ca2-ac78-13ff96cdd732",
"quantity": "25.30",
"side": "BUY",
"legs": [
{
"instrument": "BTC-30NOV23-35000-C",
"price": "0.053"
}
]
}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.post(host+path,
headers=headers,
json=payload)
print(response.status_code)
print(response.text)
/rfqs/{rfq_id}/quotes/ Response example
{
"id": "q_2YpMiJJRxTl6N66lGF5LOPsTdJY",
"rfq_id": 50126520,
"action_id": "538da55e-2617-418b-a60f-0fae2413ebdb",
"client_order_id": "a823e52e-9238-4ca2-ac78-13ff96cdd732",
"description": "Call 30 Nov 23 35000",
"maker": "PDGM",
"price": "0.053",
"side": "BUY",
"type": "LIMIT",
"product_codes": [
"DO"
],
"created": 1701218193752.5461,
"status": "PENDING",
"account": "ParadigmTestNinetyFive"
}
A [POST] /rfqs/{rfq_id}/quotes/ request creates a Quote upon a specific RFQ.
Takers & Makers use this endpoint to cross the existing market or create a resting Limit Order. Remaining amounts of the Quote remain on the Quote Book in the event of crossing.
If post_only == true and the submitted Quote crosses the existing market, the Quote is canceled in its entirety. This ensures you are always a Maker.
If a user submits a Quote which crosses the existing market, you will receive messages on both the quote and order JSON-RPCoverWebSockets Notification channels.
Takers are only able to execute two times every five seconds due to Paradigm's Market Maker Protection feature.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| rfq_id | endpoint | string | true | The unique Paradigm created identifier of the RFQ. |
| account | body | string | true | The name of the Exchange API Key entered on your Client Admin dashboard. |
| client_order_id | body | string | true | A unique user created identifier for the Quote. |
| legs | body | array of objects | true | Array of objects containing the strategy’s legs' quotes' attributes. |
| > instrument | body | string | true | The Paradigm standardized name of the Instrument. |
| > price | body | string | true | The price of the individual leg's Instrument. |
| quantity | body | string | true | The total quantity of the strategy in contract units of the RFQ. |
| side | body | string | true | The direction of the Quote. Valid values include BUY and SELL. |
| post_only | body | boolean | false | If true, the quote is canceled and never enters the Quote Book if it crosses the existing market. |
| ioc | body | boolean | false | Create Immediate or Cancel (IoC) quote. |
Response Schema
Status Code 202
| Name | Type | Required | Description |
|---|---|---|---|
| id | str | true | The Paradigm created unique identifier of the Quote. |
| rfq_id | int | true | The Paradigm created unique identifier of the RFQ the Quote is a child of. |
| action_id | str | true | The Paradigm created unique identifier for the API request. Referenced in quote_status WS |
| client_order_id | string | true | A unique user created identifier for the Quote. |
| description | string | true | RFQ Description |
| maker | string | true | The Paradigm desk name that created the Quote. |
| price | string | true | The price of the strategy in the Quote Currency of the RFQ. |
| side | string | true | The direction of the Quote. Valid values include BUY and SELL. |
| status | string | true | The status of the Quote. Valid values include PENDING, OPEN,CLOSED`. |
| type | string | true | Quote Type. Valid values: LIMIT |
| created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| product_codes | array of strings | true | The Paradigm created Product Code of in the Instruments involved in the RFQ. |
| account | string | true | The name of the Exchange API Key entered on your Client Admin dashboard. |
API Error Codes
In OBv1, Quote Create API requests perform only non-order book validations, such as invalid account credentials, or invalid tick sizes. For validations against the order book, such as crossing your own bid, or quote limits, errors are returned over WebSockets.
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 400 | 100 | "Invalid parameters" | Invalid parameters in request such as a non-unique client_order_id value. |
| 400 | 1302 | "Invalid account information" | The value provided with the account key should match the name given to the Exchange API key on the Paradigm Client Admin Dashboard. |
| 400 | 3002 | "Leg price must be specified in increments of {min_tick_size}" | Leg price must be in increments of the min tick size provided by the venue. |
| 400 | 3203 | "Invalid leg parameters" | Ensure you are attempting to quote on the correct RFQ. Check your request format is correct. |
| 400 | 3403 | "Quantity must be greater than or equal to {rfq.min_order_size}." | Quantity must be valid within venue's min order size. |
| 400 | 3404 | "The size of this quote exceeds your trading desk's limit of {strategy_max_size} contracts for {product_code}. Please increase the max size limit in your Admin Dashboard before proceeding." | The size exceeds your trading desk's limit. Works for all strategy and hedge_legs of the RFQ |
| 400 | 3405 | "Quote quantity must be in increments of {min_contract_inc}" | Quantity must be in increments of the min contract size provided by the venue. |
WS Error Codes
| Code | Message | Meaning |
|---|---|---|
| 3303 | "Limit of {max_active_quotes} for {BID,ASK}-side quote reached. Please cancel an active quote before submitting a new one." | This error occurs as a result of taker limits being reached |
| 3304 | "{instrument_name}. Bid/Ask price cannot be greater than Ask/Bid Price." | This occurs when the Bid/Ask price of a leg in the submitted Quote is greater than the Ask/Bid price of the same leg in an existing Quote. |
| 3304 | "Your Bid/Ask was canceled. It crossed the available Ask/Bid." | This occurs when you specify post_only == true and the submitted Quote crosses the market or if you cross your own existing Quote. |
| 3400 | "No Quotes available for execution" | For Immediate-or-Cancel (IOC) Quotes. Occurs when there are no crossing quotes to execute. |
| 3401 | "Hedge legs are currently outside of the exchange's price bands. Please try again later." | You provided price that is outside of venue's price bands. |
| 3401 | "Quote price {price} is too far away (</>{price_band} tick(s)) from the mark price." (Maker) | You provided price that is outside of venue's price bands. |
| 3401 | "Limit price {price} is too far away (</>{price_band} tick(s)) from the Mark price." (Taker) | You provided price that is outside of venue's price bands. |
OB: [PUT] /rfqs/{rfq_id}/quotes/{quote_id}/
/rfqs/{rfq_id}/quotes/{quote_id}/ Request example
# built ins
import base64
import hmac
import time
import json
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# PUT /v1/ob/rfqs/{rfq_id}/quotes/{quote_id}/
method = 'PUT'
path = '/v1/ob/rfqs/50126520/quotes/q_2YpMiJJRxTl6N66lGF5LOPsTdJY/'
payload = {
"rfq_id": 50126520,
"account": "ParadigmTestNinetyFive",
"client_order_id": "a823e52e-9238-4ca2-ac78-13ff96cdd732",
"quantity": "25.30",
"side": "BUY",
"legs": [
{
"instrument": "BTC-30NOV23-35000-C",
"price": "0.053"
}
]
}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.put(host+path,
headers=headers,
json=payload)
print(response.status_code)
print(response.text)
/rfqs/{rfq_id}/quotes/{quote_id}/ Response example
{
"id": "q_2YpMiJJRxTl6N66lGF5LOPsTdJY",
"rfq_id": 50126520,
"action_id": "538da55e-2617-418b-a60f-0fae2413ebdb",
"client_order_id": "a823e52e-9238-4ca2-ac78-13ff96cdd732",
"description": "Call 30 Nov 23 35000",
"maker": "PDGM",
"price": "0.053",
"side": "BUY",
"type": "LIMIT",
"product_codes": [
"DO"
],
"created": 1701218193752.5461,
"status": "PENDING",
"account": "ParadigmTestNinetyFive"
}
A [PUT] /rfqs/{rfq_id}/quotes/{quote_id}/ request replaces an existing Quote upon a specific RFQ.
Takers & Makers use this endpoint to cross the existing market or update a resting Limit Order. Remaining amounts of the Quote remain on the Quote Book in the event of crossing.
If post_only == true and the submitted Quote crosses the existing market, the Quote is canceled in its entirety. This ensures you are always a Maker.
If a user submits a Quote which crosses the existing market, you will receive messages on both the quote and order JSON-RPCoverWebSockets Notification channels.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| rfq_id | endpoint | string | true | The unique Paradigm created identifier of the RFQ. |
| quote_id | endpoint | string | true | The unique Paradigm created identifier of the Quote being replaced. |
| account | body | string | true | The name of the Exchange API Key entered on your Client Admin dashboard. |
| client_order_id | body | string | true | A unique user created identifier for the Quote. |
| legs | body | array of objects | true | Array of objects containing the strategy’s legs' quotes' attributes. |
| > instrument | body | string | true | The Paradigm standardized name of the Instrument. |
| > price | body | string | true | The price of the individual leg's Instrument. |
| quantity | body | string | true | The total quantity of the strategy in contract units of the RFQ. |
| side | body | string | true | The direction of the Quote. Valid values include BUY and SELL. |
| post_only | body | boolean | false | If true, the quote is canceled and never enters the Quote Book if it crosses the existing market. |
| ioc | body | boolean | false | Create Immediate or Cancel (IoC) quote. |
Response Schema
Status Code 202
| Name | Type | Required | Description |
|---|---|---|---|
| id | str | true | The Paradigm created unique identifier of the Quote. |
| rfq_id | int | true | The Paradigm created unique identifier of the RFQ the Quote is a child of. |
| action_id | str | true | The Paradigm created unique identifier for the API request. Referenced in quote_status WS |
| client_order_id | string | true | A unique user created identifier for the Quote. |
| description | string | true | RFQ Description |
| maker | string | true | The Paradigm desk name that created the Quote. |
| price | string | true | The price of the strategy in the Quote Currency of the RFQ. |
| side | string | true | The direction of the Quote. Valid values include BUY and SELL. |
| status | string | true | The status of the Quote. Valid values include PENDING, OPEN,CLOSED`. |
| type | string | true | Quote Type. Valid values: LIMIT |
| created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| product_codes | array of strings | true | The Paradigm created Product Code of in the Instruments involved in the RFQ. |
| account | string | true | The name of the Exchange API Key entered on your Client Admin dashboard. |
API Error Codes
In OBv1, Quote Replace API requests perform only non-order book validations, such as invalid account credentials, or invalid tick sizes. For validations against the order book, such as crossing your own bid, or quote limits, errors are returned over WebSockets.
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 400 | 100 | "Invalid parameters" | Invalid parameters in request such as a non-unique client_order_id value. |
| 400 | 1302 | "Invalid account information" | The value provided with the account key should match the name given to the Exchange API key on the Paradigm Client Admin Dashboard. |
| 400 | 3203 | "Invalid leg parameters" | Ensure you are attempting to quote on the correct RFQ. Check your request format is correct. |
WS Error Codes
| Code | Message | Meaning |
|---|---|---|
| 3303 | "Limit of {max_active_quotes} for {BID,ASK}-side quote reached. Please cancel an active quote before submitting a new one." | This error occurs as a result of taker limits being reached |
| 3304 | "{instrument_name}. Bid/Ask price cannot be greater than Ask/Bid Price." | This occurs when the Bid/Ask price of a leg in the submitted Quote is greater than the Ask/Bid price of the same leg in an existing Quote. |
| 3400 | "No Quotes available for execution" | For Immediate-or-Cancel (IOC) Quotes. Occurs when there are no crossing quotes to execute. |
OB: [POST] /pricing/
/pricing/ Request example
# built ins
import base64
import hmac
import time
import json
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# POST /v1/ob/pricing/
method = 'POST'
path = '/v1/ob/pricing/'
payload = {
"venue": "DBT",
"bid_price": "7950",
"ask_price": "9600",
"legs": [
{
"ratio": "1",
"instrument": "BTC-PERPETUAL",
"side": "BUY"
},
{
"ratio": "1",
"instrument": "BTC-31DEC21",
"side": "SELL"
}
]
}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.post(host+path,
headers=headers,
json=payload)
print(response.status_code)
print(response.text)
/pricing/ Response example
{
"bid_prices":[
"32655.32",
"24705.32"
],
"ask_prices":[
"33606.76",
"24006.76"
]
}
A [POST] /pricing/ request will return the individual leg prices of a proposed Quote.
This endpoint does not create a Quote or complete any operation upon the matching engine.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| venue | body | string | true | The underlying venue the Instruments in the RFQ are cleared & settled upon. Valid values include DBT, BIT, and BYB. |
| bid_price | body | string | true | The total price of the Quote when the side is equal to BUY. |
| ask_price | body | string | true | The total price of the Quote when the side is equal to SELL. |
| legs | body | array of objects | true | The individual legs of the RFQ. |
| > ratio | body | string | true | The quantity multiplier for the Strategy leg. |
| > instrument | body | string | true | The name of the leg's Instrument per the underlying venue's naming convention. |
| > side | body | string | true | The direction of the leg. Valid values include BUY and SELL. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| bid_prices | array of numbers | true | The individual leg prices of the BUY sided quote in the order legs proposed in the user’s request. |
| ask_prices | array of numbers | true | The individual leg prices of the SELL sided quote in the order legs proposed in the user’s request. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 400 | 3002 | "Invalid leg pricing parameters" | Invalid leg pricing parameters was requested. |
| 400 | 3304 | "Quote price {-2100.32} outside strategy price bands ({7902.18} / {9627.5})" |
Quote must be within these price bands. |
| 400 | 3310 | "Cannot calculate sensical leg prices." | Leg prices couldn't be calculated. |
| 400 | 3311 | "Cannot calculate leg prices." | Leg prices couldn't be calculated. |
OB: [GET] /rfqs/{rfq_id}/bbo
/rfqs/{rfq_id}/bbo Request example
# You can also use wget
curl -X POST https://api.testnet.paradigm.trade/v1/ob/rfqs/131/bbo/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = 'Z9gBdD05yiHLotRCxrSeFTfC'
secret_key = b'9qgG7DU0XNaqF9n5Q35iQtL5Bv7JFNUffagT7/qC9jlH0exj'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/ob/rfqs/{rfq_id}/bbo
method = 'GET'
path = '/v1/ob/rfqs/579/bbo'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/rfqs/{rfq_id}/bbo Response example
{
"venue":"DBT",
"best_bid":{
"price":"-33118.5",
"quantity":"0"
},
"best_ask":{
"price":"-1118",
"quantity":"148640"
},
"greeks": {
"delta": "0.00466",
"gamma": "0.00001",
"theta": "-0.02436",
"vega": "0.20599",
},
"leg_prices":[
{
"instrument":"BTC-PERPETUAL",
"best_bid_price":"33118",
"best_bid_quantity":"148640",
"best_ask_price":"33118.5",
"best_ask_quantity":"491190",
"mark_price":"33077.21",
"timestamp":1625189984659,
"best_bid_iv": null,
"best_ask_iv": null,
"mark_price_iv": null,
"greeks": null,
},
{
"instrument":"BTC-24JUN22",
"best_bid_price":"0",
"best_bid_quantity":"0",
"best_ask_price":"32000",
"best_ask_quantity":"990000",
"mark_price":"31948.95",
"timestamp":1625189984174,
"best_bid_iv": "0.00",
"best_ask_iv": "110.18",
"mark_price_iv": "53.02",
"greeks": {
"delta": "0.00466",
"gamma": "0.00001",
"theta": "-0.02436",
"vega": "0.20599",
},
}
],
"mark_price":"-1128.26",
"product_code":"CF"
}
A [GET] /rfqs/{rfq_id}/bbo request returns the best Bid/Offer information from the underlying venue for a specific RFQ.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | endpoint | string | true | The Paradigm created unique identifier of the RFQ. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| venue | string | true | The underlying venue where the RFQ's Instruments are cleared & settled. Valid values include DBT, BIT, and BYB. |
| best_bid | array of objects | true | |
| > price | string | true | The calculated best bid price of the RFQ’s strategy per the legs' underlying screen price in the Quote Currency of the RFQ. |
| > quantity | string | true | The calculated best bid price of the RFQ’s strategy per the legs' underlying screen quantity in contract units of the RFQ. |
| best_ask | array of objects | true | |
| > price | string | true | The calculated best ask price of the RFQ’s strategy per the legs' underlying screen price in the Quote Currency of the RFQ. |
| > quantity | string | true | The calculated best ask price of the RFQ’s strategy per the legs' underlying screen quantity in contract units of the RFQ. |
| greeks | object | false | An object of variables used to assess the risk & exposure of a derivatives contract. |
| > delta | string | true | The delta value of the strategy. |
| > theta | string | true | The theta value of the strategy. |
| > vega | string | true | The vega value of the strategy. |
| > gamma | string | true | The gamma value of the strategy. |
| leg_prices | array of objects | true | |
| > instrument | string | true | The Paradigm standardized name of the Instrument. |
| > best_bid_price | string | true | The best bid on the underlying exchange’s Instrument Quote Book in the Quote Currency of the Instrument. |
| > best_bid_quantity | string | true | The best bid’s quantity on the underlying exchange’s Instrument Quote Book in contract units of the RFQ. |
| > best_ask_price | string | true | The best ask on the underlying exchange’s Instrument Quote Book in the Quote Currency of the Instrument. |
| > best_ask_quantity | string | true | The best ask’s quantity on the underlying exchange’s Instrument Quote Book in contract units of the RFQ. |
| > mark_price | string | true | The Mark price from the underlying exchange for specific Instrument in the Quote Currency of the Instrument. |
| > mark_price_iv | string | true | The Instrument’s mark price IV (implied volatility) from the underlying settlement venue. Set to null if the value is not available. |
| > best_bid_iv | string | true | The Instrument’s best bid IV (implied volatility) from the underlying settlement venue’s Order Books. Set to null if the value is not available. |
| > best_ask_iv | string | true | The Instrument’s best ask IV (implied volatility) from the underlying settlement venue’s Order Books. Set to null if the value is not available. |
| > timestamp | number | true | The time in unix milliseconds since the epoch when the data was returned from the underlying venue. |
| > greeks | object | false | An object of variables used to assess the risk & exposure of a derivatives contract. |
| >> delta | string | true | The delta value of the leg's Instrument. |
| >> theta | string | true | The theta value of the leg's Instrument. |
| >> vega | string | true | The vega value of the leg's Instrument. |
| >> gamma | string | true | The gamma value of the leg's Instrument. |
| mark_price | string | true | The calculated Mark Price of the strategy in the Quote Currency of the RFQ. |
| product_code | string | true | The Paradigm created Product Code of in the Instruments involved in the RFQ. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 400 | 3300 | "Unavailable RFQ" | RFQ is unavailable to be priced. |
OB: [GET] /rfqs/{rfq_id}/quotes/
/rfqs/{rfq_id}/quotes/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/ob/rfqs/131/quotes/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/ob/rfqs/{rfq_id}/quotes/
method = 'GET'
path = '/v1/ob/rfqs/576/quotes/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/rfqs/{rfq_id}/quotes/ Response example
{
"id":576,
"bids":[
{
"created":1625167826211.088,
"last_activity":1625167826211.088,
"id":"q_2Ym0K4wTjVfLEkditbWH5tFQ9ZW",
"price":"0.0078",
"remaining_quantity":"29943.7",
"side":"BUY",
"status":"OPEN",
"legs": [{"price": "1234", "side": "SELL"},{"price": "1235", "side": "BUY"}]
}
],
"asks":[
{
"created":1625173113830.57,
"last_activity":1625173113830.57,
"id":"q_2Ym0K4wTjVfLEkditbWH51ssSKm",
"price":"0.0084",
"remaining_quantity":"33.7",
"side":"SELL",
"status":"OPEN",
"legs": [{"price": "1234", "side": "SELL"},{"price": "1235", "side": "BUY"}]
}
]
}
A [GET] /rfqs/{rfq_id}/quotes/ request returns the OPEN Quotes upon the RFQ.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | endpoint | string | true | The Paradigm created unique identifier of the RFQ. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| id | int | true | The Paradigm created unique identifier of the RFQ. |
| bids | array of objects | true | Empty array if no Quotes are available. |
| > created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| > last_activity | number | true | The time in unix milliseconds since the epoch when the Quote was updated. |
| > id | string | true | The Paradigm created unique identifier of the Quote. |
| > maker | string | false | The Paradigm Desk Name of the Maker who created the quote. Only visible if requester is the Maker. |
| > remaining_quantity | string | true | The total remaining size of the Quote in the contract units of the RFQ. |
| > price | string | true | The price of the Quote in the Quote Currency of the RFQ. |
| > side | string | true | The direction of the Quote. Valid values include BUY. |
| > status | string | true | The status of the Quote. Valid values include OPEN |
| > legs | array of objects | true | The price and side of the legs |
| >> price | string | true | The price of individual legs |
| >> side | string | true | The BUY or SELL side of the individual legs |
| asks | array of objects | true | Empty array if no Quotes are available. |
| > created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| > id | string | true | The Paradigm created unique identifier of the Quote. |
| > maker | string | false | The Paradigm Desk Name of the Maker who created the quote. Only visible if requester is the Maker. |
| > remaining_quantity | string | true | The total remaining size of the Quote in the contract units of the RFQ. |
| > price | string | true | The price of the Quote in the Quote Currency of the RFQ. |
| > side | string | true | The direction of the Quote. Valid values include SELL. |
| > status | string | true | The status of the Quote. Valid values include OPEN |
| > legs | array of objects | true | The price and side of the legs |
| >> price | string | true | The price of individual legs |
| >> side | string | true | The BUY or SELL side of the individual legs |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials |
| 400 | 3300 | "Unavailable RFQ" | RFQ is unavailable to be priced. |
OB: [GET] /trades/
/trades/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/ob/trades/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
import json
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/ob/trades/
method = 'GET'
path = '/v1/ob/trades/'
payload = {}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers,
json=payload)
print(response.status_code)
print(response.text)
/trades/ Response example
{
"count":909,
"next":"cD0yMDIxLTA3LTI3KzE2JTNBMjElM0EyMC40MTQ3MjMlMkIwMCUzQTAw",
"results":[
{
"id":1221,
"description":"FSpd Perpetual / 31 Dec 21",
"desk_role":"Maker",
"mark_price":"1544.18",
"order_id":1094,
"price":"1550",
"product_codes":[
"CF"
],
"index_price": "",
"quantity":"10000",
"quote_currency":"USD",
"quote_id":"q_2Yx3b3pu68Tw7WpQxHCMVSiMo3K",
"rfq_id":1178,
"strategy_code":"FS",
"traded":1627440685659.369,
"venue":"DBT",
"action":"BUY",
"api_credential":"ParadigmTestNinetyFive",
"client_order_id":"",
"status":"COMPLETED"
},
{
"id":1219,
"description":"Cstm -13.3 Future Perpetual\n +1 Future 30 Jul 21\n +19.9 Future 6 Aug 21",
"mark_price":"289592.31",
"price":"289467.236",
"product_code":"CF",
"quantity":"586",
"quote_currency":"USD",
"rfq_id":1176,
"strategy_code":"CM",
"traded":1627419839512.485,
"venue":"DBT"
"index_price": "",
},
{
"id":1217,
"description":"Cstm +1 Put 30 Jul 21 38000\n -1 Put 30 Jul 21 40000",
"mark_price":"-0.0285",
"price":"-0.0005",
"product_code":"DO",
"quantity":"13",
"quote_currency":"BTC",
"rfq_id":1174,
"strategy_code":"CM",
"traded":1627418321044.7131,
"venue":"DBT"
"index_price": "",
},
{
"id":1216,
"description":"Cstm +1 Future Perpetual\n +1.7 Future 31 Dec 21\n +2.8 Future 24 Sep 21",
"mark_price":"210922.959",
"price":"211492",
"product_code":"BB",
"quantity":"5",
"quote_currency":"USD",
"rfq_id":1172,
"strategy_code":"CM",
"traded":1627402886964.928,
"venue":"BYB"
},
{
"id":1215,
"description":"Cstm +1 Future Perpetual\n +1.7 Future 31 Dec 21\n +2.8 Future 24 Sep 21",
"mark_price":"211042.936",
"price":"211492",
"product_code":"BB",
"quantity":"4",
"quote_currency":"USD",
"rfq_id":1172,
"strategy_code":"CM",
"traded":1627402880414.723,
"venue":"BYB"
"index_price": "",
}
]
}
A [GET] /trades/ request returns all completed Trades on Paradigm.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | The pagination page to return. Valid determined by the next key value in the response. |
| hide_public | query | string | false | Hide non-participant trades from results. Valid values include true and false. |
| page_size | query | string | false | The number of Trades to return per pagination. |
| status | query | string | false | The state of the Trades to return. Valid values include PENDING, COMPLETED, REJECTED. |
| product_codes | query | string | false | The Paradigm created Product Codes of the composite Instruments. The request can contain multiple codes such as ?product_codes=DO,CF. |
| strategies | query | string | false | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | int | true | Total number of Trades to paginate through from request. |
| next | string | true | null if no more pages to paginate. The value used for the cursor query string parameter to paginate pages. |
| results | array of objects | true | |
| > id | int | true | The Paradigm created unique identifier of the Trade. |
| > description | string | true | The description of the RFQ. |
| > desk_role | string | false | The role in the trade if the desk is either the Taker or the Maker of the trade. Valid values: Taker, Maker. |
| > mark_price | string | true | The mark price of the RFQ at execution in the Quote Currency of the RFQ using the underlying venue's mark price(s) of the RFQ. |
| > order_id | int | false | The Paradigm created unique identifier of the Order if the user is the Taker of the Trade. |
| > price | string | true | The price in the Quote Currency of the RFQ of the Trade. |
| > index_price | string | false | The index price average at the moment of execution. |
| > product_codes | array of strings | true | The Paradigm created product codes being traded in the RFQ. |
| > quantity | string | true | The size of the trade in contract units of the RFQ. |
| > quote_currency | string | true | The Quote Currency of the RFQ. |
| > rfq_id | int | true | The Paradigm created unique identifier of the RFQ. |
| > strategy_code | string | true | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
| > status | string | true | Trade status. Valid values include PENDING, COMPLETED, REJECTED. |
| > traded | number | true | The time in unix milliseconds since the epoch when the was cleared & settled at. |
| > venue | string | true | The underlying venue the Trade was cleared & settled upon. Valid values include DBT, BIT, BYB. |
| > action | string | false | The side of the Order. Only available if the requester is the Taker of the Trade. Valid values include BUY and SELL. |
| > api_credential | string | false | The name of the exchange API key used to execute upon the Quote. Only available if the requester is the Taker to the Trade. |
| > client_order_id | string | false | The user created Order label if the user is the Taker of the Trade. |
| > quote_id | string | false | The Paradigm created unique identifier of the executed Quote. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
OB: [GET] /trades/{trade_id}/
/trades/{trade_id}/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/ob/trades/50/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/ob/trades/{trade_id}/
method = 'GET'
path = '/v1/ob/trades/473/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/trades/{trade_id}/ Response example - User's Trade
COMPLETED
{
"id":1221,
"description":"FSpd Perpetual / 31 Dec 21",
"desk_role":"Taker",
"mark_price":"1544.18",
"order_id":1094,
"price":"1550",
"product_codes":[
"CF"
],
"quantity":"10000",
"quote_currency":"USD",
"quote_id":"q_2Yx3b3pu68Tw7WpQxHCMVSiMo3K",
"rfq_id":1178,
"traded":1627440685659.369,
"venue":"DBT",
"action":"BUY",
"api_credential":"ParadigmTestNinetyFive",
"client_order_id":"",
"status":"COMPLETED",
"legs":[
{
"id":1989,
"instrument":"BTC-PERPETUAL",
"price":"39952.58",
"product_code":"CF",
"quantity":"10000",
"ratio":"1",
"side":"SELL",
"action":"SELL",
"exec_id":"77508944"
},
{
"id":1990,
"instrument":"BTC-31DEC21",
"price":"41502.58",
"product_code":"CF",
"quantity":"10000",
"ratio":"1",
"side":"BUY",
"action":"BUY",
"exec_id":"77508943"
}
]
}
/trades/{trade_id}/ Response example - User's Trade
REJECTED
{
"id":1220,
"description":"FSpd Perpetual / 31 Dec 21",
"desk_role":"Maker",
"mark_price":"1537.57",
"order_id":1093,
"price":"1550",
"product_codes":[
"CF"
],
"quantity":"10000",
"quote_currency":"USD",
"quote_id":"q_2Yx3b3pu68Tw7WpQxHCMVSiMo3K",
"rfq_id":1178,
"traded":1627440566959.332,
"venue":"DBT",
"action":"BUY",
"api_credential":"ParadigmTestNinetyFive",
"client_order_id":"",
"status":"REJECTED",
"index_price": "None",
"legs":[
{
"id":1987,
"instrument":"BTC-PERPETUAL",
"price":"39900.66",
"product_code":"CF",
"quantity":"10000",
"index_price": "None",
"ratio":"1",
"side":"SELL",
"action":"SELL",
"exec_id":null
},
{
"id":1988,
"instrument":"BTC-31DEC21",
"price":"41450.66",
"index_price": "None",
"product_code":"CF",
"quantity":"10000",
"ratio":"1",
"side":"BUY",
"action":"BUY",
"exec_id":null
}
]
}
/trades/{trade_id}/ Response example - User is not a counterparty on the trade, and trade is
COMPLETED
{
"id":587,
"description":"Call 22 Oct 21 52000",
"mark_price":"0.0788",
"price":"0.09",
"product_codes":[
"DO"
],
"quantity":"25",
"quote_currency":"BTC",
"rfq_id":1118,
"traded":1634064072771.3809,
"venue":"DBT",
"legs":[
{
"id":862,
"instrument":"BTC-22OCT21-52000-C",
"price":"0.09",
"product_code":"DO",
"quantity":"25",
"ratio":"1",
"side":"BUY"
}
]
}
A [GET] /trades/{trade_id}/ request returns a specific Trade on Paradigm.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | query | string | true | The Paradigm created unique identifier of the Trade. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | int | true | Total number of Trades to paginate through from request. |
| next | string | true | null if no more pages to paginate. The value used for the cursor query string parameter to paginate pages. |
| results | array of objects | true | |
| > id | int | true | The Paradigm created unique identifier of the Trade. |
| > description | string | true | The description of the RFQ. |
| > desk_role | string | false | The role in the trade if the desk is either the Taker or the Maker of the trade. Valid values: Taker, Maker. |
| > mark_price | string | true | The mark price of the RFQ at execution in the Quote Currency of the RFQ using the underlying venue's mark price(s) of the RFQ. |
| > price | string | true | The price in the Quote Currency of the RFQ of the Trade. |
| > product_codes | array of strings | true | The Paradigm created product codes being traded in the RFQ. |
| > quantity | string | true | The size of the trade in contract units of the RFQ. |
| > quote_currency | string | true | The Quote Currency of the RFQ. |
| > rfq_id | int | true | The Paradigm created unique identifier of the RFQ. |
| > traded | number | true | The time in unix milliseconds since the epoch when the was cleared & settled at. |
| > venue | string | true | The underlying venue the Trade was cleared & settled upon. Valid values include DBT, BIT, BYB. |
| > legs | array of objects | true | |
| >> id | int | false | The Paradigm created unique individual leg trade identifier. |
| >> instrument | string | true | The Paradigm standardized name of the Instrument. |
| >> quantity | string | true | The size of the leg traded in contract unit terms. |
| >> price | string | true | The price of the leg traded in the Quote Currency of the RFQ. |
| >> product_code | string | true | The Paradigm created product code of the Instrument traded. |
| >> ratio | string | true | The quantity multiplier relative to other Instrument legs. |
| >> side | string | false | The direction of the leg of the original RFQ. Valid values include BUY and SELL. This does not reveal the direction of the Trade. |
| >> action | string | false | The direction of the user for the specific leg of the RFQ. Valid values include BUY and SELL. |
| >> exec_id | string | false | The venue created unique identifier of the trade. |
| >> index_price | string | false | The index price of the leg at the moment of execution. |
| > price | string | true | The price in the Quote Currency of the RFQ of the Trade. |
| > index_price | string | false | The index price average at the moment of execution. |
| > api_credentials | string | false | The name of venue API key used by the user in the Trade. |
| > client_order_id | string | false | The user created unique identifier. |
| > status | string | true | If the trade successfully cleared & settled on the underlying venue. Valid values include COMPLETED and REJECTED. |
Error Codes
| HTTP Status Code | Message | Meaning |
|---|---|---|
| 401 | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 404 | "Not found." | Invalid Trade Id value requested. |
OB: [GET] /mmp/status/
/mmp/status/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/ob/mmp/status/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/ob/mmp/status/
method = 'GET'
path = '/v1/ob/mmp/status/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/mmp/status/ Response example
{
"rate_limit_hit": false
}
A [GET] /mmp/status/ request returns the desk's Market Maker Protection (MMP) status. MMP Status applies on both DRFQ and OB.
This endpoint takes no parameters as part of the request.
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| rate_limit_hit | bool | true | A flag indicating if rate limit was hit |
OB: [PATCH] /mmp/status/
/mmp/status/ Request example
# You can also use wget
curl -X PATCH https://api.testnet.paradigm.trade/v1/ob/mmp/status/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# PATCH /v1/ob/mmp/status/
method = 'PATCH'
path = '/v1/ob/mmp/status/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.patch(host+path,
headers=headers)
print(response.status_code)
print(response.text)
A [PATCH] /mmp/status/ resets the Market Maker Protection (MMP) if triggered and enables the user to create new Quotes. MMP Status applies on both DRFQ and OB.
This endpoint takes no parameters as part of the request.
Response Schema
This request will return an HTTP Status Code of 204 to indicate success of operation.
Status Code 204
OB: [GET] /platform_state/
/platform_state/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/ob/platform_state/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
method = 'GET'
path = '/v1/ob/platform_state/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/platform_state/ Response example
{
"platform_state":"AVAILABLE",
"published_at":1652323645414,
"next_platform_state":"UNAVAILABLE",
"next_platform_state_at":1653949623000
}
A [GET] /platform_state request allows the user to return the present market availability state.
The Product and Account Management team will communicate expectations around market availability including the next_platform_state and the timing by the next_platform_state_at response key.
Markets can only be in three market availability states:
AVAILABLE- Normal Trading with no restrictions.UNAVAILABLE- No [POST], [PUT], or [DELETE] requests are allowed. All [GET] requests are allowed. Markets are locked and no trading is able to occur.AVAILABLE_CANCEL_ONLY- No [POST] or [PUT] requests are allowed. All [GET] requests are allowed. Markets are locked and no trading is able to occur.
This endpoint takes no parameters as part of the request.
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| platform_state | string | true | The state of the market. Valid values include AVAILABLE, UNAVAILABLE, AVAILABLE_CANCEL_ONLY. |
| published_at | decimal | true | Time of update in unix milliseconds since the epoch. |
| next_platform_state | string | true | The next expected platform_state. Valid values include AVAILABLE, UNAVAILABLE, AVAILABLE_CANCEL_ONLY. |
| next_platform_state_at | decimal | true | Expected time of the next platform_state update in unix milliseconds since the epoch. |
OBv1 - WebSocket Notifications Channels
OB Creation
An example of the
rfqnotification received when an RFQ is created
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"rfq",
"data":{
"kind":"ADDED",
"rfq":{
"id":1232,
"created":1628038165427.771,
"description":"Call 4 Aug 21 39000",
"last_trade":null,
"latest_activity":1628038165427.839,
"product_codes":[
"DO"
],
"status":"ACTIVE",
"strategy_code": "CP",
"venue":"DBT",
"legs":[
{
"instrument":"BTC-4AUG21-39000-C",
"product_code":"DO",
"ratio":"1",
"venue_instrument":"BTC-4AUG21-39000-C",
"side":"BUY"
}
]
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
rfqnotification received when an RFQ expires
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"rfq",
"data":{
"kind":"REMOVED",
"rfq":{
"id":589,
"venue":"DBT",
"created":1625191497588.2312,
"description":"FSpd 2 Jul 21 / 25 Mar 22",
"last_trade":null,
"latest_activity":1625191497588.316,
"legs":[
{
"instrument":"BTC-2JUL21",
"venue_instrument":"BTC-2JUL21",
"product_code":"CF",
"ratio":"1",
"side":"SELL"
},
{
"instrument":"BTC-25MAR22",
"venue_instrument":"BTC-25MAR22",
"product_code":"CF",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"CF"
],
"status":"EXPIRED",
"strategy_code": "FS"
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
All updates relating to RFQs are sent through the rfq WebSocket Notifications channel.
This is a public channel and consumable by all.
Notifications received through the rfq WebSocket channel can include RFQ creations, expirations, and updates. Updates are used to update the latest_activity and last_trade fields while the rfq is active.
| Member | Type | Required | Description |
|---|---|---|---|
| channel | string | true | WebSocket Notification Channel message is received upon. Valid value is rfq. |
| data | object | true | |
| > kind | string | true | WS Action. Valid values include ADDED, REMOVED, UPDATED. |
| > rfq | object | true | |
| >> id | int | true | The Paradigm created unique identifier of the RFQ. |
| >> venue | string | true | The underlying venue the RFQ is cleared & settled upon. Valid values include DBT, BIT, and BYB. |
| >> created | number | true | Time in unix milliseconds since the epoch when the RFQ was created. |
| >> description | string | true | Paradigm created description of the RFQ. |
| >> last_trade | object | true | null if RFQ has not been traded. |
| >>> traded | number | false | Time in unix milliseconds since the epoch when the the Trade occurred. |
| >>> quantity | string | false | The size of the trade in the contract units of the RFQ. |
| >>> price | string | false | The price the RFQ was Traded at. |
| >> latest_activity | number | true | Time in unix milliseconds since the epoch when the RFQ was last acted upon. |
| >> legs | array of objects | true | |
| >>> instrument | string | true | The Paradigm standardized name of the Instrument. |
| >>> venue_instrument | string | true | The name of the Instrument per the underlying venue's naming convention. |
| >>> product_code | string | true | The Paradigm created product code of the Instrument. |
| >>> ratio | string | true | The quantity multiple relative to other legs. |
| >>> price | string | false | The price of the Instrument in the Quote Currency of the RFQ. |
| >>> side | string | true | The direction of the leg. Valid values include BUY and SELL. |
| >> product_codes | array of strings | true | Paradigm created product codes being traded in the RFQ. |
| >> status | string | true | Status of the RFQ. Valid values include ACTIVE and EXPIRED. |
| >> strategy_code | string | true | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
| meta | object | true | |
| > seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. |
| > seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired within seq_group |
OB: quote_status
In OBv1, Quote Create and Replace API operations create a Quote in a PENDING state. Before moving
to OPEN, Order Book validations are performed asynchronously. The result of these validations
are returned over the quote_status channel.
This is a private channel, which includes the action_id parameter returned in the API Response.
An example of the
quote_statusnotification received when a Quote has been created successfully.
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"channel": "quote_status",
"data": {
"action_id": "658a3547-965b-49c9-adff-a844b8839e40",
"client_order_id": "a823e52e-9238-4ca2-ac78-13ff96cdd732",
"kind": "create",
"quote_id": "q_2Ym0K4wTjVfLEkditbWH5tFQ9ZW",
"success": true
},
"meta": {
"seq_group": 4113064136,
"seq_num": 2
}
}
}
An example of the
quote_statusnotification received when a Quote fails to open:
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"channel": "quote_status",
"data": {
"action_id": "71561c1f-f43b-4fb0-abc5-d7dcfbc81b0c",
"client_order_id": "a823e52e-9238-4ca2-ac78-13ff96cdd732",
"kind": "create",
"quote_id": "q_2Ym0K4wTjVfLEkditbWH5tFQ9ZW",
"success": false,
"error_code": 3303,
"error_message": "Limit of 2 for BUY-side quote reached. Please cancel an active quote before submitting a new one."
},
"meta": {
"seq_group": 4113064136,
"seq_num": 3
}
}
}
| Member | Type | Required | Description |
|---|---|---|---|
| channel | string | true | WebSocket Notification Channel message is received upon. |
| data | object | true | |
| > action_id | string | true | The Paradigm-generated UUID string for each API response |
| > client_order_id | string | false | A unique user created identifier for the Quote. |
| > kind | string($enum) | true | The type of API operation the status message is in response to. Valid values: create, replace |
| > quote_id | string | false | The Paradigm created unique identifier of the Quote. |
| > success | boolean | true | Boolean indicating the success or failure of the correlated API request |
| > error_code | int | false | Optional, but required when success=false. The Paradigm-defined error code that caused the API request to fail. |
| > error_message | string | false | Optional, but required when success=false. The descriptive text of the error that caused the API request to fail |
| > error_details | string | true | Additional details about an error. Always optional, even when success=false. |
| meta | object | true | |
| > seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. |
| > seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired with seq_group. |
OB: quote_book
An example of the
quote_booknotification received when a Quote is newly added to the Quote Book
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"quote_book",
"data":{
"kind":"ADDED",
"quote":{
"remaining_quantity":"20000",
"side":"BUY",
"rfq_id":816,
"id":"q_2Ym0K4wTjVfLEkditbWH5tFQ9ZW",
"price":"-9",
"status":"OPEN",
"created":1626155549137.585
"last_activity":1626155549137.600
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
quote_booknotification received when a Quote is removed from the Quote Book
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"quote_book",
"data":{
"kind":"REMOVED",
"quote":{
"id":"q_2Ym0K4wTjVfLEkditbWH5tFQ9ZW",
"side":"SELL",
"created":1626155407461.441,
"last_activity":1626155407461.512,
"rfq_id":816,
"status":"CLOSED",
"price":"-13",
"remaining_quantity":"20000"
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
quote_booknotification received when a Quote is updated in the Quote Book
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"quote_book",
"data":{
"kind":"UPDATED",
"quote":{
"remaining_quantity":"1990000",
"side":"SELL",
"rfq_id":816,
"id":"q_2Ym0K4wTjVfLEkditbWH5tFQ9ZW",
"price":"9",
"status":"OPEN",
"created":1626155762785.293
"last_activity":1626155762785.315
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
Updates relating to Quotes upon RFQs are sent through the quote_book WebSocket Notifications channel.
This is a public channel and is consumable by all. This is the channel you should use to create your own Quote Book & Executable Quote Book.
Updates received through the quote_book WebSocket Notification channel can include newly created quotes, removed quotes as well as updates to existing Quotes.
| Member | Type | Required | Description |
|---|---|---|---|
| channel | string | true | WebSocket Notification Channel message is received upon. |
| data | object | true | |
| > kind | string | true | The action of the message. Valid values include ADDED, REMOVED, UPDATED. |
| > quote | object | true | |
| >> side | string | true | The side of the Quote from the Maker's perspective. Valid values include BUY and SELL. |
| >> rfq_id | int | true | The Paradigm created unique identifier of the RFQ. |
| >> id | str | true | The Paradigm created unique identifier of the Quote. |
| >> price | string | true | The price in the Quote Currency of the RFQ. |
| >> status | string | true | The status of the Quote. Valid values include OPEN, CLOSED. |
| >> created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| >> last_activity | number | true | The time in unix milliseconds since the epoch when the Quote was updated. |
| >> remaining_quantity | string | true | The remaining Quantity upon the Quote in contract units of the RFQ. |
| meta | object | true | |
| > seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. |
| > seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired with seq_group. |
OB: quote
An example of the
quotenotification received when a Quote is created
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"quote",
"data":{
"kind":"NEW",
"quote":{
"id":"q_2Ym0K4wTjVfLEkditbWH5tFQ9ZW",
"status":"OPEN",
"maker":"DSK95",
"created":1628041444199.396,
"initial_quantity":"50",
"original_quantity":"50",
"filled_quantity":"0",
"rfq_id":1232,
"price":"0.004",
"remaining_quantity":"50",
"side":"BUY",
"client_order_id":"",
"account": "ParadigmTestNinetySix"
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
quotenotification received when a Quote is canceled
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"quote",
"data":{
"kind":"CANCELED",
"quote":{
"id":2776215,
"status":"CLOSED",
"maker":"DSK95",
"remaining_quantity":"22",
"side":"SELL",
"created":1631590685753.57,
"initial_quantity":"22",
"original_quantity":"22",
"filled_quantity":"0",
"client_order_id":"st12122",
"rfq_id":2073,
"price":"0.06",
"account": "ParadigmTestNinetySix",
"cancel":{
"reason": "REMOVED_BY_USER"
}
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
quotenotification received when a Quote is canceled due to an error
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"quote",
"data":{
"kind":"CANCELED",
"quote":{
"id":2776215,
"status":"CLOSED",
"maker":"DSK95",
"remaining_quantity":"22",
"side":"SELL",
"created":1631590685753.57,
"initial_quantity":"22",
"original_quantity":"22",
"filled_quantity":"0",
"client_order_id":"st12122",
"rfq_id":2073,
"price":"0.06",
"cancel":{
"reason": "FAILED_VALIDATION"
}
},
"error": {
"code": 3300,
"message": "Unavailable RFQ"
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
quotenotification received when a Quote is being executed upon
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"quote",
"data":{
"kind":"PENDING_FILL",
"quote":{
"initial_quantity":"60",
"original_quantity":"34",
"filled_quantity":"26",
"order":{
"id":266376,
"client_order_id":"st12122121",
"filled_quantity":"26",
"filled_average_price":"0.0904",
"limit_price":"0.1",
"requested_quantity":"60",
"rfq_id":2073,
"side":"BUY",
"status":"CLOSED",
"venue":"DBT"
},
"id":"q_2Ym0K4wTjVfLEkditbWH5tFQ9ZW",
"side":"BUY",
"price":"0.1",
"rfq_id":2073,
"created":1631591051681.613,
"status":"OPEN",
"client_order_id":"st121221",
"remaining_quantity":"7",
"maker":"DSK95",
"account": "ParadigmTestNinetySix"
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
quotenotification received when a Quote has been partially filled
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"quote",
"data":{
"kind":"PARTIALLY_FILLED",
"quote":{
"rfq_id":816,
"id":"q_2Ym0K4wTjVfLEkditbWH5tFQ9ZW",
"remaining_quantity":"1990000",
"status":"OPEN",
"client_order_id":"",
"price":"9",
"side":"SELL",
"created":1626155762785.2932,
"maker":"DSK95",
"initial_quantity":"2000000",
"original_quantity":"2000000"
"filled_quantity":"10000",
"account": "ParadigmTestNinetySix"
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
quotenotification received when a Quote has been partially filled & is partially executed again
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"quote",
"data":{
"kind":"PENDING_FILL",
"quote":{
"maker":"DSK95",
"rfq_id":816,
"client_order_id":"",
"price":"-13",
"side":"SELL",
"id":"q_2Ym0K4wTjVfLEkditbWH5tFQ9ZW",
"created":1626156440976.632,
"status":"OPEN",
"initial_quantity":"50000",
"original_quantity":"50000",
"filled_quantity":"10000",
"remaining_quantity":"20000",
"account": "ParadigmTestNinetySix"
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
quotenotification received when a Quote has been completely executed upon
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"quote",
"data":{
"kind":"PARTIALLY_FILLED",
"quote":{
"side":"BUY",
"rfq_id":2073,
"maker":"DSK95",
"status":"CLOSED",
"id":"q_2Ym0K4wTjVfLEkditbWH5tFQ9ZW",
"created":1631591051681.613,
"remaining_quantity":"7",
"order":{
"id":266376,
"client_order_id":"st12",
"filled_quantity":"26",
"filled_average_price":"0.0904",
"limit_price":"0.1",
"requested_quantity":"60",
"rfq_id":2073,
"side":"BUY",
"status":"CLOSED",
"venue":"DBT"
},
"price":"0.1",
"initial_quantity":"60",
"original_quantity":"34",
"filled_quantity":"26",
"client_order_id":"st12",
"account": "ParadigmTestNinetySix"
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
All updates relating to Quote state are sent through the quote WebSocket Notifications channel.
This is a private channel and only provides updates to the Maker who created the Quote.
Updates received through the quote WebSocket Notification channel can include newly created quotes, removed quotes, quotes pending settlement & clearing, quotes which are partially filled as well as quotes which are completely filled.
Quotes which are executed upon and a rejection occurs at the underlying venue are canceled upon rejected. The remaining_quantity of the Quote is no longer available on the Quote Book. It does not matter which party is to blame, the Quote is kind == CANCELED and status == CLOSED.
Quotes which have been [PUT] /rfqs/{rfq_id}/quotes/{quote_id}/ have the original quote kind == CANCELED and status == CLOSED and a new Quote with kind == NEW and status == OPEN.
Workflow Steps:
- Maker creates Quote.
kind==NEW&status==OPEN. - Taker partially executes upon Quote.
kind==PENDING_FILL&status==OPEN.- Upon finality at settlement & clearing, Maker receives
kind==PARTIALLY_FILLED&status==OPEN.
- Upon finality at settlement & clearing, Maker receives
- Taker partially executes upon already partially executed Quote.
kind==PENDING_FILL&status==OPEN.- Upon finality at settlement & clearing, Maker receives
kind==PARTIALLY_FILLED&status==OPEN.
- Upon finality at settlement & clearing, Maker receives
- Taker executes upon a Quote, but the Trade is rejected by the underlying venue.
kind==CANCELED&status==CLOSED. - Taker completely executes quote as so there is
0remaining_quantity.kind==FILLED&status==CLOSED.
| Member | Type | Required | Description |
|---|---|---|---|
| channel | string | true | WebSocket Notification Channel message is received upon. |
| data | object | true | |
| > kind | string | true | The action of the message. Valid values include NEW, CANCELED, PENDING_FILL, PARTIALLY_FILLED, FILLED. |
| > quote | object | true | |
| >> order | object | false | Present if Quote crosses the existing market. |
| >>> id | int | false | The Paradigm created unique identifier of the Order. |
| >>> client_order_id | string | false | A unique user created identifier for the Order. |
| >>> filled_quantity | string | false | The filled quantity of the Order in the contract units of the RFQ. |
| >>> filled_average_price | string | false | The average filled price of the Order in the quote currency of the RFQ. |
| >>> limit_price | string | false | The price of the Order in quote currency of the RFQ. |
| >>> requested_quantity | string | false | The requested crossing quantity of the Order. |
| >>> rfq_id | int | false | The Paradigm created unique identifier of the RFQ the Order is a child of. |
| >>> side | string | false | The direction of the Order. Valid values include BUY and SELL. |
| >>> status | string | false | The current status of the Order. Valid values include OPEN and CLOSED. |
| >>> venue | string | false | Underlying venue RFQ is cleared & settled upon. Valid values include DBT, BIT, BYB. |
| >> created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| >> client_order_id | string | false | A unique user created identifier for the Quote. Not present if th subscribed user is not the Maker. |
| >> id | string | true | The Paradigm created unique identifier of the Quote. |
| >> maker | string | true | The Paradigm desk name of the Maker. |
| >> initial_quantity | string | true | The Quote size in contract units of the RFQ. |
| >> original_quantity | string | true | The Quote size in contract units of the RFQ originally rested on the orderbook. |
| >> filled_quantity | string | true | The successfully executed size of the Quote in contract units of the RFQ. |
| >> price | string | true | The price of the Quote in the Quote Currency of the RFQ. |
| >> remaining_quantity | string | true | The remaining available quantity of the Quote in the contract units of the RFQ. |
| >> rfq_id | int | true | The Paradigm created unique identifier of the RFQ. |
| >> side | string | true | The side of the Quote. Valid values include BUY and SELL. |
| >> status | string | true | The status of the Quote. Valid values include OPEN and CLOSED. |
| >> account | string | true | The name of the Exchange API Key entered on your Client Admin dashboard. |
| > error | object | false | Optional. Present if the Quote is removed from the Quote Book due to an error. |
| >> code | int | false | Optional. The Paradigm-defined error code that caused the API request to fail. |
| >> message | string | false | Optional. The descriptive text of the error that caused the API request to fail |
| >> details | string | false | Optional. Additional details about an error. |
| venue_error | object | false | |
| > message | string | false | Example: "Deribit error: Trade rejected" |
| meta | object | true | |
| > seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. |
| > seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired with this identifier. |
OB: order
An example of the
ordernotification received when an Order is Pending Fill
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"order",
"data":{
"kind":"PENDING_FILL",
"order":{
"id":1113,
"client_order_id":"",
"filled_quantity":"0",
"filled_average_price":"0",
"limit_price":"0.0054",
"requested_quantity":"25",
"rfq_id":1232,
"side":"BUY",
"status":"OPEN",
"venue":"DBT",
"quote":{
"side":"BUY",
"rfq_id":1232,
"status":"CLOSED",
"id":"q_2Ym0K4wTjVfLEkditbWH5tFQ9ZW",
"created":1631591051681.613,
"remaining_quantity":"0",
"price":"0.1",
"initial_quantity":"25",
"original_quantity":"0",
"filled_quantity":"0",
"client_order_id":""
}
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
ordernotification received when an Order has reached finality
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"order",
"data":{
"kind":"SUMMARY",
"order":{
"id":1113,
"client_order_id":"",
"filled_quantity":"25",
"filled_average_price":"0.0054",
"limit_price":"0.0054",
"requested_quantity":"25",
"rfq_id":1232,
"side":"BUY",
"status":"CLOSED",
"venue":"DBT",
"quote":{
"side":"BUY",
"rfq_id":1232,
"status":"CLOSED",
"id":"q_2Ym0K4wTjVfLEkditbWH5tFQ9ZW",
"created":1631591051681.613,
"remaining_quantity":"0",
"price":"0.1",
"initial_quantity":"25",
"original_quantity":"0",
"filled_quantity":"25",
"client_order_id":""
}
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
All updates relating to Orders upon RFQs are sent through the order WebSocket Notifications channel.
This is a private channel and only provides updates to the Taker who submitted the Order.
Updates received through the order WebSocket Notification channel can include a pending fill notification as well as a summary of an order's execution at finality. You will receive a single kind == PENDING_FILL and kind == SUMMARY per order execution regardless of the number of Quotes consumed.
It is important to be aware that executions can be rejected by exchanges. You should differentiate between the requested_quantity and the filled_quantity in the messages to be aware of the success of the execution(s).
| Member | Type | Required | Description |
|---|---|---|---|
| channel | string | true | WebSocket Notification Channel message is received upon. |
| data | object | true | |
| > kind | string | true | The action of the message. Valid values include PENDING_FILL, SUMMARY. |
| > order | object | true | |
| >> id | int | true | The Paradigm created unique identifier of the Order. |
| >> client_order_id | string | true | The user created unique value associated with the Order. |
| >> filled_quantity | string | true | The filled quantity upon finality of the Order. |
| >> filled_average_price | string | true | The average price of the filled quantity of the Order upon finality. |
| >> limit_price | string | true | The price in the Quote currency of the RFQ of the Order. |
| >> requested_quantity | string | true | The requested quantity of the Order in the contract units of the RFQ. |
| >> rfq_id | int | true | The Paradigm created unique identifier of the RFQ. |
| >> side | string | true | The direction of the Order. Valid values include BUY and SELL. |
| >> status | string | true | The status of the Order. Valid values include OPEN, CLOSED. |
| >> venue | string | true | The underlying venue the trade was settled upon. Valid values include DBT, BIT, BYB. |
| >> quote | object | true | |
| >>> created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| >>> client_order_id | string | false | A unique user created identifier for the Quote. |
| >>> id | string | true | The Paradigm created unique identifier of the Quote. |
| >>> maker | string | true | The Paradigm desk name of the Maker. |
| >>> initial_quantity | string | true | The Quote size in contract units of the RFQ. |
| >>> original_quantity | string | true | The Quote size in contract units of the RFQ originally rested on the orderbook. |
| >>> filled_quantity | string | true | The successfully executed size of the Quote in contract units of the RFQ. |
| >>> price | string | true | The price of the Quote in the Quote Currency of the RFQ. |
| >>> remaining_quantity | string | true | The remaining available quantity of the Quote in the contract units of the RFQ. |
| >>> rfq_id | int | true | The Paradigm created unique identifier of the RFQ. |
| >>> side | string | true | The side of the Quote. Valid values include BUY and SELL. |
| >>> status | string | true | The status of the Quote. Valid values include OPEN and CLOSED. |
| meta | object | true | |
| > seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. |
| > seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired within seq_group |
OB: trade
An example of the
tradenotification received when a Trade successfully settles and clears
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"trade",
"data":{
"kind":"CONFIRMATION",
"trade":{
"quote_id":709033,
"action":"BUY",
"id":1257,
"rfq_id":1232,
"order_id":1120,
"quantity":"25",
"index_price": "63000",
"product_codes":[
"DO"
],
"traded":1628040498333.169,
"api_credential":"ParadigmTestNinetySix",
"price":"0.0055",
"client_order_id":"",
"status":"COMPLETED",
"legs":[
{
"id":2044,
"instrument":"BTC-4AUG21-39000-C",
"price":"0.0055",
"product_code":"DO",
"quantity":"25",
"ratio":"1",
"side":"BUY",
"action":"BUY",
"exec_id":"78144401"
"index_price": "63000",
}
],
"venue":"DBT",
"mark_price":"0.0054",
"quote_currency":"BTC",
"description":"Call 4 Aug 21 39000",
"desk_role":"Maker"
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
tradenotification received when a Trade is rejected at settlement and clearing
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"trade",
"data":{
"kind":"REJECTION",
"trade":{
"order_id":1121,
"quote_currency":"BTC",
"id":1258,
"mark_price":"0.0054",
"client_order_id":"",
"price":"0.0055",
"quote_id":709033,
"quantity":"25",
"traded":1628040604131.9612,
"action":"BUY",
"api_credential":"ParadigmTestNinetySix",
"status":"REJECTED",
"description":"Call 4 Aug 21 39000",
"desk_role":"Maker",
"index_price": "63000",
"product_codes":[
"DO"
],
"legs":[
{
"id":2045,
"index_price": "63000",
"instrument":"BTC-4AUG21-39000-C",
"price":"0.0055",
"product_code":"DO",
"quantity":"25",
"ratio":"1",
"side":"BUY",
"action":"BUY",
"exec_id":null
}
],
"venue":"DBT",
"rfq_id":1232
}
},
"venue_error":{
"message":"DBT Error: Trade refused by exchange"
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
Updates relating to Trades upon RFQs are sent through the trade WebSocket Notifications channel.
This is a private channel and only provides updates to the Taker & Maker of the Trade (matching of an Order and a Quote).
Updates received through the trade WebSocket Notification channel can include trade success and rejection at clearing & settlement.
| Member | Type | Required | Description |
|---|---|---|---|
| channel | string | true | WebSocket Notification Channel message is received upon. |
| data | object | true | |
| > kind | string | true | The action of the WS Message. Valid values include CONFIRMATION and REJECTION. |
| > trade | object | true | |
| >> api_credential | string | false | The name given the to the Exchange API Key entered on the Paradigm Client Admin dashboard. |
| >> description | false | true | The Paradigm created description of the RFQ. |
| >> desk_role | string | false | The role in the trade if the desk is either the Taker or the Maker of the trade. Valid values: Taker, Maker |
| >> client_order_id | string | true | A unique user created identifier for the Quote (Maker) or trade Order (Taker). |
| >> rfq_id | int | true | The Paradigm created unique identifier of the RFQ. |
| >> id | int | true | The Paradigm created unique identifier of the Trade. |
| >> mark_price | string | false | The calculated mark price of the RFQ from the underlying venue's mark prices in the Quote Currency of the RFQ. |
| >> order_id | int | false | The Paradigm created unique identifier of the Order that triggered execution. |
| >> price | string | false | The price the Trade was executed at in the Quote Currency of the RFQ. |
| >> index_price | string | false | The index price average at the moment of execution. |
| >> product_codes | array of strings | false | The Paradigm created Product Codes of the trade. |
| >> quantity | string | false | The size of the trade in contracts units of the RFQ. |
| >> quote_currency | string | false | The Quote Currency of the RFQ executed upon. |
| >> quote_id | string | false | The Paradigm created unique identifier of the Quote executed upon. |
| >> action | string | false | The direction of the Trade from the perspective of the User. Valid values include BUY and SELL. |
| >> status | string | true | Trade status. Valid values include COMPLETED, REJECTED. |
| >> traded | number | false | The time in unix milliseconds since the epoch when the trade was cleared & settled. |
| >> venue | string | true | Venue the underlying RFQ clears and settles upon. Valid values include DBT, BIT, BYB. |
| >> legs | array of objects | true | |
| >>> id | int | true | The Paradigm created unique individual leg trade identifier. |
| >>> exec_id | string | false | The venue created leg trade execution identifier. Only available to participants of the trade. |
| >>> instrument | string | true | The Paradigm standardized name of the Instrument. |
| >>> quantity | string | true | The size of the leg traded in contract unit terms. |
| >>> price | string | true | The price of the leg traded in the Quote Currency of the RFQ. |
| >>> index_price | string | false | The leg index price at the moment of execution. |
| >>> product_code | string | true | The Paradigm created product code of the Instrument traded. |
| >>> ratio | string | true | The quantity multiplier relative to other Instrument legs. |
| >>> side | string | true | The direction of the leg of the RFQ. Valid values include BUY, SELL. |
| >>> action | string | true | The direction of the leg from the user's perspective Traded. Valid values include BUY, SELL. |
| venue_error | object | false | Only present if the Trade was rejected by the underlying venue. |
| > message | string | false | Reason the trade was rejected by the underlying venue. |
| meta | object | true | |
| > seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. |
| > seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired with this identifier. |
OB: trade_tape
An example of the
trade_tapenotification received when a trade settles & clears
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"trade_tape",
"data":{
"kind":"COMPLETED",
"trade":{
"id":1260,
"description":"Call 4 Aug 21 39000",
"mark_price":"0.0054",
"price":"0.0054",
"product_codes":[
"DO"
],
"quantity":"25",
"quote_currency":"BTC",
"rfq_id":1232,
"strategy_code":"CL",
"traded":1628041230769.151,
"venue":"DBT"
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
All updates relating to Trades upon RFQs are sent through the trade_tape WebSocket Notifications channel.
This is a public channel and provides updates about all Trades which are executed through Paradigm & successfully clear and settle on the underlying venue.
All notifications through the trade_tape WebSocket channel do not reveal Taker or Maker information or the side/action the RFQ/Order/Quote was executed.
| Member | Type | Required | Description |
|---|---|---|---|
| channel | string | true | WebSocket Notification Channel message is received upon. |
| data | object | true | |
| > kind | string | true | The action of the WS Message. Valid values include COMPLETED. |
| > trade | object | true | |
| >> id | int | true | The Paradigm created unique identifier of the Trade. |
| >> description | string | true | The Paradigm created description of the RFQ. |
| >> mark_price | string | true | The calculated mark price of the RFQ from the underlying venue's mark prices in the Quote Currency of the RFQ. |
| >> price | string | true | The price the Trade was executed at in the Quote Currency of the RFQ. |
| >> product_codes | array of strings | true | The Paradigm created Product Codes of the trade. |
| >> quantity | string | true | The size of the trade in contracts units of the RFQ. |
| >> quote_currency | string | true | The Quote Currency of the RFQ executed upon. |
| >> rfq_id | int | true | The Paradigm created unique identifier of the RFQ. |
| >> strategy_code | string | true | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
| >> traded | number | true | The time in unix milliseconds since the epoch when the trade was cleared & settled. |
| >> venue | string | true | Venue the underlying RFQ clears and settles upon. Valid values include DBT, BIT, BYB. |
| >> index_price | string | false | The index price average at the moment of execution. |
| meta | object | true | |
| > seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. |
| > seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired with this identifier. |
OB: ticker.{rfq_id}
An example, of an update message
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"channel": "ticker",
"data": {
"rfq_id": 50114339,
"published": 1683044823761,
"best_ask": {
"price": "0",
"quantity": "0.0"
},
"best_bid": {
"price": "0.1000",
"quantity": "8.0"
},
"greeks": {
"delta": "0.00466",
"gamma": "0.00001",
"theta": "-0.02436",
"vega": "0.20599",
},
"mark_price": "0.2256",
"legs": [
{
"instrument": "BTC-30JUN23-25000-C",
"mark_price": "0.2256",
"best_bid": {
"price": "0.1000",
"quantity": "8.0"
},
"best_ask": {
"price": "0.0000",
"quantity": "0.0"
},
"best_bid_iv": "110.18",
"best_ask_iv": "0.00",
"mark_price_iv": "53.02",
"greeks": {
"delta": "0.00466",
"gamma": "0.00001",
"theta": "-0.02436",
"vega": "0.20599",
},
}
]
},
"meta": {
"seq_group": 1294173505,
"seq_num": 1187
}
}
}
All updates relating to an RFQ's composite instrument & structure market data are sent via the ticker.{rfq_id} WebSocket Notification Channel.
This is a public channel and consumable by all.
This channel publishes real-time updates of the underlying market data from the composite instruments' settlement venue.
Parameters
| Member | Type | Required | Enums | Description |
|---|---|---|---|---|
| rfq_id | string | true | rfq_id |
The Paradigm created rfq_id of the RFQ. |
Response Schema
| Member | Type | Required | Description |
|---|---|---|---|
| jsonrpc | string | true | Always 2.0. |
| method | string | true | The value will always be subscription to indicate message type. |
| params | object | true | |
| > channel | string | true | The Websocket channel the message was delivered upon. |
| > data | object | true | An object containing the update’s information. |
| >> rfq_id | string | true | The Paradigm created unique identifier of the RFQ. |
| >> published | number | true | The time in unix milliseconds since the epoch when the data was returned from the underlying venue. |
| >> best_bid | object | true | |
| >>> price | string | true | The calculated best bid price of the RFQ’s strategy per the legs' underlying screen price in the Quote Currency of the RFQ. |
| >>> quantity | string | true | The calculated best bid price of the RFQ’s strategy per the legs' underlying screen quantity in contract units of the RFQ. |
| >> best_ask | object | true | |
| >>> price | string | true | The calculated best ask price of the RFQ’s strategy per the legs' underlying screen price in the Quote Currency of the RFQ. |
| >>> quantity | string | true | The calculated best ask price of the RFQ’s strategy per the legs' underlying screen quantity in contract units of the RFQ. |
| >> mark_price | string | true | The calculated Mark Price of the strategy in the Quote Currency of the RFQ. |
| >> greeks | object | false | An object of variables used to assess the risk & exposure of a derivatives contract. |
| >>> delta | string | true | The delta value of the strategy. |
| >>> theta | string | true | The theta value of the strategy. |
| >>> vega | string | true | The vega value of the strategy. |
| >>> gamma | string | true | The gamma value of the strategy. |
| >> legs | Array of Objects | true | The composite Instruments of the RFQ. |
| >>> instrument | string | true | The Paradigm standardized name of the Instrument. |
| >>> mark_price | string | true | The Mark price from the underlying exchange for specific Instrument in the Quote Currency of the Instrument. |
| >>> mark_price_iv | string | true | The Instrument’s mark price IV (implied volatility) from the underlying settlement venue. Set to null if the value is not available. |
| >>> best_bid_iv | string | true | The Instrument’s best bid IV (implied volatility) from the underlying settlement venue’s Order Books. Set to null if the value is not available. |
| >>> best_ask_iv | string | true | The Instrument’s best ask IV (implied volatility) from the underlying settlement venue’s Order Books. Set to null if the value is not available. |
| >>> best_bid | object | true | |
| >>>> price | string | true | The best bid on the underlying exchange’s Instrument Quote Book in the Quote Currency of the Instrument. |
| >>>> quantity | string | true | The best bid’s quantity on the underlying exchange’s Instrument Quote Book in contract units of the RFQ. |
| >>> best_ask | object | true | |
| >>>> price | string | true | The best ask on the underlying exchange’s Instrument Quote Book in the Quote Currency of the Instrument. |
| >>>> quantity | string | true | The best ask’s quantity on the underlying exchange’s Instrument Quote Book in contract units of the RFQ. |
| >>> greeks | object | false | An object of variables used to assess the risk & exposure of a derivatives contract. |
| >>>> delta | string | true | The delta value of the leg's Instrument. |
| >>>> theta | string | true | The theta value of the leg's Instrument. |
| >>>> vega | string | true | The vega value of the leg's Instrument. |
| >>>> gamma | string | true | The gamma value of the leg's Instrument. |
| > meta | object | true | |
| >> seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. |
| >> seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired within seq_group. |
OB: platform_state
An example when the
platform_state==UNAVAILABLE.
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"platform_state",
"data":{
"platform_state":"UNAVAILABLE",
"published_at":1652323465888,
"next_platform_state":"AVAILABLE_CANCEL_ONLY",
"next_platform_state_at":1652324400000
}
}
}
An example when the
platform_state==AVAILABLE_CANCEL_ONLY.
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"platform_state",
"data":{
"platform_state":"AVAILABLE_CANCEL_ONLY",
"published_at":1652323475415,
"next_platform_state":"AVAILABLE",
"next_platform_state_at":1652324400000
}
}
}
An example when the
platform_state==AVAILABLE.
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"platform_state",
"data":{
"platform_state":"AVAILABLE",
"published_at":1652323494426,
"next_platform_state":"UNAVAILABLE",
"next_platform_state_at":1653966000000
}
}
}
All updates relating to market availability are sent through the platform_state WebSocket Notifications channel.
The Product and Account Management team will communicate expectations around market availability including the next_platform_state and the timing by the next_platform_state_at response key.
Markets can only be in three market availability states:
AVAILABLE- Normal Trading with no restrictions.UNAVAILABLE- No [POST], [PUT], or [DELETE] requests are allowed. All [GET] requests are allowed. Markets are locked and no trading is able to occur.AVAILABLE_CANCEL_ONLY- No [POST] or [PUT] requests are allowed. All [GET] requests are allowed. Markets are locked and no trading is able to occur.
Response Schema
| Member | Type | Required | Description |
|---|---|---|---|
| method | string | true | Value will always be subscription to indicate message type. |
| channel | string | true | Channel the message was delivered upon. |
| data | object | true | Object of information relating to the message received. |
| > platform_state | string | true | The state of the market. Valid values include AVAILABLE, UNAVAILABLE, AVAILABLE_CANCEL_ONLY. |
| > published_at | int | true | Time of update in unix milliseconds since the epoch. |
| > next_platform_state | string | true | The next expected platform_state. Valid values include AVAILABLE, UNAVAILABLE, AVAILABLE_CANCEL_ONLY. |
| > next_platform_state_at | int | true | Expected time of the next platform_state update in unix milliseconds since the epoch. |
OB: market_maker_protection
An example when the market maker protection has triggered.
{
"jsonrpc": "2.0",
"method": "subscription",
"params":
{
"channel": "market_maker_protection",
"data":
{
"kind": "TRIGGERED"
}
}
}
Market Maker Protection (MMP) is a feature designed to help market makers manage their risk when quoting in a vast range of financial instruments. It assists market makers in controlling the possibility of executing all trades simultaneously, which could potentially overwhelm them.
When triggered, the system will cancel all open quotes and send the above message in this private channel.
One can visit the admin site to view the settings.
Response Schema
| Member | Type | Required | Description |
|---|---|---|---|
| jsonrpc | string | true | Always 2.0. |
| method | string | true | Value will always be subscription to indicate message type. |
| channel | string | true | Channel the message was delivered upon. |
| data | object | true | Object of information relating to the message received. |
| > kind | string | true | The action of the WS Message. Valid values include TRIGGERED. |
Message Sequence Numbers
WebSocket messages contain sequence numbers to help clients identify if
they have missed any messages during temporary disconnections or network errors. The sequence number
is included in the WebSocket messages under the meta field.
Message Structure with Sequence Numbers
WebSocket messages now include an additional meta field that contains the following properties:
| Member | Type | Description |
|---|---|---|
| seq_group | number | Unique identifier for the group of messages |
| seq_num | number | Sequence number of the message within the group |
Here's an example of a WebSocket message with sequence numbers:
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"channel": "rfq",
"data": {
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
Handling Sequence Numbers
Clients should monitor the sequence numbers of the incoming messages to ensure they have not missed any messages. If a client detects a gap in the sequence numbers, it may have missed one or more messages and should take appropriate action, such as refreshing data from REST.
Sequences increase monotonically within the context of a sequence group. Sequences are only relevant within a sequence group, which represents a subscribed channel. Sequences may be re-used between sequence groups.
While messages are sent ordered according to their sequences, sequences are not guaranteed not to repeat.
Delta-1 Spreads
FSPD - REST Endpoints
FSPD: [GET] /instruments
/instruments Request example
# You can also use wget
curl -X GET https://api.fs.testnet.paradigm.trade/v1/fs/instruments \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.fs.testnet.paradigm.trade'
# GET /v1/fs/instruments
method = 'GET'
path = '/v1/fs/instruments'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/instruments Response example
{
"next":"eyJmaWx0ZXIiOnsidmVudWUiOiJGVFgiLCJraW5kIjoiIiwic2V0dGxlbWVudF9jdXJyZW5jeSI6IiIsImNsZWFyaW5nX2N1cnJlbmN5IjoiIiwic3RhdGUiOiJBQ1RJVkUiLCJWZW51ZUluc3RydW1lbnROYW1lIjoiIiwibmFtZSI6IiIsImxpbWl0Ijo1LCJtYXJnaW5fdHlwZSI6IiJ9LCJ0aW1lIjoxNjU2MzkzNDQzODk2MTg0MzQ2LCJtYXJrZXIiOnsibWFya2VyIjoiNTYzNTQxOTQ0MTk5NDEzODIiLCJkaXJlY3Rpb24iOjB9LCJpbml0aWFsX21hcmtlciI6IjU2MzU0MTk0NDIwMDA2OTIzIn0=",
"prev":"None",
"results":[
{
"id":"56354194420006923",
"name":"ETH-PERPETUAL",
"created_at":1656095317329249937,
"expires_at":-1,
"last_updated":1656095317504692677,
"venue":"FTX",
"kind":"FUTURE",
"base_currency":"ETH",
"quote_currency":"USD",
"clearing_currency":"ETH",
"settlement_currency":"USD",
"min_tick_size":"0.1",
"state":"ACTIVE",
"venue_instrument_name":"ETH-PERP",
"product_code":"FE",
"contract_size":1,
"min_order_size_decimal":"0.001",
"min_block_size_decimal":"0.001",
"margin_type":"LINEAR",
"min_order_size":0,
"min_block_size":0
},
{
"id":"56354194419941387",
"name":"AVAX-30SEP22",
"created_at":1656095317329239777,
"expires_at":1664506800000000000,
"last_updated":1656095317496350036,
"venue":"FTX",
"kind":"FUTURE",
"base_currency":"AVAX",
"quote_currency":"USD",
"clearing_currency":"AVAX",
"settlement_currency":"USD",
"min_tick_size":"0.001",
"state":"ACTIVE",
"venue_instrument_name":"AVAX-0930",
"product_code":"FA",
"contract_size":1,
"min_order_size_decimal":"0.1",
"min_block_size_decimal":"0.1",
"margin_type":"LINEAR",
"min_order_size":0,
"min_block_size":0
},
{
"id":"56354194419941385",
"name":"ETHUSD",
"created_at":1656095317329255668,
"expires_at":-1,
"last_updated":1656095317507437918,
"venue":"FTX",
"kind":"SPOT",
"base_currency":"ETH",
"quote_currency":"USD",
"clearing_currency":"ETH",
"settlement_currency":"USD",
"min_tick_size":"0.1",
"state":"ACTIVE",
"venue_instrument_name":"ETH/USD",
"product_code":"EB",
"contract_size":1,
"min_order_size_decimal":"0.001",
"min_block_size_decimal":"0.001",
"margin_type":"LINEAR",
"min_order_size":0,
"min_block_size":0
},
{
"id":"56354194419941384",
"name":"BTCUSD",
"created_at":1656095317329272545,
"expires_at":-1,
"last_updated":1656095317515500719,
"venue":"FTX",
"kind":"SPOT",
"base_currency":"BTC",
"quote_currency":"USD",
"clearing_currency":"BTC",
"settlement_currency":"USD",
"min_tick_size":"1",
"state":"ACTIVE",
"venue_instrument_name":"BTC/USD",
"product_code":"SB",
"contract_size":1,
"min_order_size_decimal":"0.0001",
"min_block_size_decimal":"0.0001",
"margin_type":"LINEAR",
"min_order_size":0,
"min_block_size":0
},
{
"id":"56354194419941382",
"name":"BTC-30DEC22",
"created_at":1656095317329246886,
"expires_at":1672369200000000000,
"last_updated":1656095317502052914,
"venue":"FTX",
"kind":"FUTURE",
"base_currency":"BTC",
"quote_currency":"USD",
"clearing_currency":"BTC",
"settlement_currency":"USD",
"min_tick_size":"1",
"state":"ACTIVE",
"venue_instrument_name":"BTC-1230",
"product_code":"FB",
"contract_size":1,
"min_order_size_decimal":"0.0001",
"min_block_size_decimal":"0.001",
"margin_type":"LINEAR",
"min_order_size":0,
"min_block_size":0
}
]
}
A [GET] /instruments request allows you to return all available Instruments upon Paradigm's Future Spread Product. Instruments are the legs part of a Strategy.
Paradigm uses our instrument name throughout the API. The venue_instrument_name is provided solely to allow easily reconciliation between Paradigm and the underlying venues' APIs.
- The response key
min_order_size_decimaldeprecatesmin_order_size. You should usemin_order_size_decimal. - The response key
min_block_size_decimaldeprecatesmin_block_size. You should usemin_block_size_decimal.
You must paginate to return the complete results.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | Returns the next paginated page. |
| venue | query | string | false | Venue to return Instruments for. Values include DBT, BYB, FTX. |
| kind | query | string | false | Returns Instruments of the specified contract type. Valid values include ANY, FUTURE, SPOT. |
| settlement_currency | query | string | false | Currency instrument is settled in. Valid values include BTC, ETH, SOL, AVAX, USD. |
| clearing_currency | query | string | false | Currency order size is submitted to the underlying venue in. Valid values include USD, BTC, ETH, SOL, AVAX. |
| name | query | string | false | The name of the Instrument, standardized by Paradigm, to be used with Paradigm’s API. |
| venue_instrument_name | query | string | false | The name of the Instrument as it is returned by the underlying venue. |
| state | query | string | false | Returns Instruments with the specified state. Default is ACTIVE. Valid values include ACTIVE, SETTLED, EXPIRED. |
| page_size | query | string | false | The number of Instruments to return per pagination page. Default is to return all. |
| margin_type | query | string | false | How the contract is margined. Valid values include LINEAR, INVERSE. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| prev | string | true | Previous Cursor string value of the last pagination page. Equal to null if first pagination page response. |
| next | string | true | Cursor string value to use to paginate results. Equal to null if no more pages are available. |
| results | Array of Objects | true | Array of Objects with details related to specific Instruments. |
| > id | string | true | Paradigm created unique identifier of the Instrument. |
| > name | string | true | The name of the Instrument, normalized by Paradigm, to be used with Paradigm’s API. |
| > venue_instrument_name | string | true | The name of the Instrument as it is returned by the underlying venue. |
| > venue | string | true | The clearing venue of the Instrument. Valid values include DBT, BYB, FTX. |
| > kind | string | true | The kind of instrument. Valid values include FUTURE, SPOT. |
| > base_currency | string | true | Currency instrument is based in. Valid values include BTC, ETH, SOL, AVAX. |
| > quote_currency | string | true | Currency instrument is quoted in. Valid values include USD. |
| > clearing_currency | string | true | Currency order size is submitted to the underlying venue in. Valid values include USD, BTC, ETH, SOL, AVAX. |
| > settlement_currency | string | true | Currency instrument is settled in. Valid values include BTC, ETH, SOL, USD. |
| > min_order_size | integer | true | [DEPRECATED] Minimum order size increment in the clearing_currency of the instrument. |
| > min_tick_size | string | true | Minimum price increment the instrument can be priced in denominated in the quote_currency of the instrument. |
| > min_block_size | integer | true | [DEPRECATED] Minimum block / order size of the instrument, denominated in the clearing_currency of the instrument. |
| > state | string | true | If the Instrument is available to trade, expired, or settled. Values include ACTIVE, SETTLED, EXPIRED. |
| > created_at | integer | true | The time in unix nanoseconds since the epoch when the Instrument was created by the underlying venue. |
| > expires_at | integer | true | The time in unix nanoseconds since the epoch when the Instrument is will expire. -1 if the Instrument does not expire. |
| > last_updated | integer | true | The time in unix nanoseconds since the epoch when the Instrument was last updated by the underlying venue. |
| > product_code | string | true | The Paradigm created product code for the Instrument. |
| > contract_size | integer | true | The multiplier applied to Order amount for the product size in the quote_currency of the Strategy. Example: If a Strategy has a contract_size == 10 and a quote_currency == USD, an Order of amount == 1 will in total notional size == 10 USD. |
| > min_order_size_decimal | string | true | Minimum order size increment in the clearing_currency of the instrument. |
| > min_block_size_decimal | string | true | Minimum block / order size of the instrument, denominated in the clearing_currency of the instrument. |
| > margin_type | string | true | How the contract is margined. Valid values include LINEAR, INVERSE. |
Error Codes
| HTTP Status Code | Code | Error | Message | Meaning |
|---|---|---|---|---|
| 400 | 4000 | INVALID_REQUEST_PARAMETER | Specific parameter field and valid values. | Response messages specifies which key is affected and the valid values. |
FSPD: [GET] /strategies
/strategies Request example
# You can also use wget
curl -X GET https://api.fs.testnet.paradigm.trade/v1/fs/strategies \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.fs.testnet.paradigm.trade'
# GET /v1/fs/strategies
method = 'GET'
path = '/v1/fs/strategies'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/strategies Response example
{
"next":"eyJmaWx0ZXIiOnsidmVudWUiOiJGVFgiLCJraW5kIjoiIiwic2V0dGxlbWVudF9jdXJyZW5jeSI6IiIsImNsZWFyaW5nX2N1cnJlbmN5IjoiIiwic3RhdGUiOiJBQ1RJVkUiLCJpZCI6IiIsImxpbWl0IjoyLCJtYXJnaW5fdHlwZSI6IiIsImJhc2VfY3VycmVuY3kiOiIifSwidGltZSI6MTY1NjM5NDM2MjA5Mzg3ODUwNiwibWFya2VyIjp7Im1hcmtlciI6IjU2MzU0MTk1NjExMDU4MTg2IiwiZGlyZWN0aW9uIjowfSwiaW5pdGlhbF9tYXJrZXIiOiI1NjM1NDE5NTYxMTA1ODE4NyJ9",
"prev":"None",
"results":[
{
"id":"56354195611058187",
"name":"SA/FS_SOLUSD_SOL-PERPETUAL",
"venue":"FTX",
"created_at":1656095318119886765,
"expires_at":-1,
"kind":"SPOT_FUTURE",
"state":"ACTIVE",
"clearing_currency":"SOL",
"quote_currency":"USD",
"settlement_currency":"USD",
"min_tick_size":"0.0025",
"last_updated":1656387233522526694,
"legs":[
{
"instrument_id":"56354194419875848",
"instrument_name":"SOLUSD",
"side":"SELL",
"ratio":"-1.0",
"kind":"SPOT",
"base_currency":"SOL",
"quote_currency":"USD",
"clearing_currency":"SOL",
"settlement_currency":"USD",
"min_tick_size":"0.0025",
"state":"ACTIVE",
"expires_at":-1,
"created_at":1656095318120586461,
"product_code":"SA",
"contract_size":1,
"venue_instrument_name":"SOL/USD",
"min_order_size_decimal":"0.01",
"min_block_size_decimal":"0.01",
"margin_type":"LINEAR",
"min_order_size":0,
"min_block_size":0
},
{
"instrument_id":"56354194419875846",
"instrument_name":"SOL-PERPETUAL",
"side":"BUY",
"ratio":"1.0",
"kind":"FUTURE",
"base_currency":"SOL",
"quote_currency":"USD",
"clearing_currency":"SOL",
"settlement_currency":"USD",
"min_tick_size":"0.0025",
"state":"ACTIVE",
"expires_at":-1,
"created_at":1656095318121345589,
"product_code":"FS",
"contract_size":1,
"venue_instrument_name":"SOL-PERP",
"min_order_size_decimal":"0.01",
"min_block_size_decimal":"0.01",
"margin_type":"LINEAR",
"min_order_size":0,
"min_block_size":0
}
],
"min_order_size_decimal":"0.01",
"min_block_size_decimal":"0.01",
"margin_type":"LINEAR",
"base_currency":"SOL",
"min_order_size":0,
"min_block_size":0
},
{
"id":"56354195611058186",
"name":"SA/FS_SOLUSD_SOL-30SEP22",
"venue":"FTX",
"created_at":1656095318161548455,
"expires_at":1664506800000000000,
"kind":"SPOT_FUTURE",
"state":"ACTIVE",
"clearing_currency":"SOL",
"quote_currency":"USD",
"settlement_currency":"USD",
"min_tick_size":"0.0025",
"last_updated":1656387233542514800,
"legs":[
{
"instrument_id":"56354194419875848",
"instrument_name":"SOLUSD",
"side":"SELL",
"ratio":"-1.0",
"kind":"SPOT",
"base_currency":"SOL",
"quote_currency":"USD",
"clearing_currency":"SOL",
"settlement_currency":"USD",
"min_tick_size":"0.0025",
"state":"ACTIVE",
"expires_at":-1,
"created_at":1656095318233465522,
"product_code":"SA",
"contract_size":1,
"venue_instrument_name":"SOL/USD",
"min_order_size_decimal":"0.01",
"min_block_size_decimal":"0.01",
"margin_type":"LINEAR",
"min_order_size":0,
"min_block_size":0
},
{
"instrument_id":"56354194419875847",
"instrument_name":"SOL-30SEP22",
"side":"BUY",
"ratio":"1.0",
"kind":"FUTURE",
"base_currency":"SOL",
"quote_currency":"USD",
"clearing_currency":"SOL",
"settlement_currency":"USD",
"min_tick_size":"0.0025",
"state":"ACTIVE",
"expires_at":1664506800000000000,
"created_at":1656095318234210349,
"product_code":"FS",
"contract_size":1,
"venue_instrument_name":"SOL-0930",
"min_order_size_decimal":"0.01",
"min_block_size_decimal":"0.01",
"margin_type":"LINEAR",
"min_order_size":0,
"min_block_size":0
}
],
"min_order_size_decimal":"0.01",
"min_block_size_decimal":"0.01",
"margin_type":"LINEAR",
"base_currency":"SOL",
"min_order_size":0,
"min_block_size":0
}
]
}
A [GET] /strategies request allows you to return all available Strategies upon Paradigm.
Strategies are what you trade as part of the Future Spread Dashboard. Strategies contain Instruments as legs.
- The response key
min_order_size_decimaldeprecatesmin_order_size. You should usemin_order_size_decimal. - The response key
min_block_size_decimaldeprecatesmin_block_size. You should usemin_block_size_decimal.
You must paginate to return the complete results.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | Returns the next paginated page. |
| venue | query | string | false | Venue to return Strategies for. Values include DBT, BYB, FTX. |
| kind | query | string | false | Returns the type of Strategy. Valid values include ANY, FUTURE, SPOT_FUTURE. |
| base_currency | query | string | false | Currency instrument is based in. Valid values include BTC, ETH, SOL, AVAX. |
| settlement_currency | query | string | false | Currency Strategy is settled in. Valid values include BTC, ETH, SOL, AVAX, USD. |
| clearing_currency | query | string | false | The currency the Strategy order size is submitted to the underlying venue in. Valid values include USD, BTC, ETH, SOL, AVAX. |
| id | query | string | false | The Paradigm created unique identifier of the Strategy. |
| state | query | string | false | Returns Strategies which are available to trade, settled or expired. Default is ACTIVE. Valid values include ACTIVE, SETTLED, EXPIRED. |
| page_size | query | string | false | The number of Strategies to return per pagination page. Default is to return all. |
| margin_type | query | string | false | How the contract is margined. Valid values include LINEAR, INVERSE. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| prev | string | true | Previous Cursor string value of the last pagination page. Equal to null if first pagination page response. |
| next | string | true | Cursor string value to use to paginate results. Equal to null if no more pages are available. |
| results | Array of Objects | true | |
| > id | string | true | The Paradigm created unique Strategy Identifier. |
| > venue | string | true | The clearing venue of the Strategy. Valid values include DBT, BYB, FTX. |
| > name | string | true | A Paradigm created description of the composite Instruments in the Strategy. |
| > state | string | true | Returns Strategies which are available to trade, settled or expired. Valid values include ACTIVE, SETTLED, EXPIRED. |
| > kind | string | true | Returns the type of Strategy. Valid values include FUTURE, SPOT_FUTURE. |
| > base_currency | string | true | Currency instrument is based in. Valid values include BTC, ETH, SOL, AVAX. |
| > clearing_currency | string | true | The currency the Strategy order size is submitted to the underlying venue in. Valid values include USD, BTC, ETH, SOL, AVAX. |
| > quote_currency | string | true | The currency the Strategy is priced in. Valid values include USD. |
| > settlement_currency | string | true | Currency Strategy is settled in. Valid values include BTC, ETH, SOL, AVAX, USD. |
| > min_order_size | integer | true | [DEPRECATED] The minimum order size increment the Strategy can be traded in the clearing_currency of the Strategy. |
| > min_tick_size | string | true | Minimum price increment the instrument can be priced in denominated in the quote_currency of the Strategy. |
| > min_block_size | integer | true | [DEPRECATED] Minimum block / order size of the instrument, denominated in the clearing_currency of the Strategy. |
| > min_order_size_decimal | string | true | The minimum order size increment the Strategy can be traded in the clearing_currency of the Strategy. |
| > min_block_size_decimal | string | true | Minimum block / order size of the instrument, denominated in the clearing_currency of the Strategy. |
| > created_at | integer | true | The time in unix nanoseconds since the epoch when the Strategy was created. |
| > expires_at | integer | true | The time in unix nanoseconds since the epoch when the Strategy will expire. |
| > last_updated | integer | true | The time in unix nanoseconds since the epoch when the Strategy was last updated. |
| > margin_type | string | true | How the contract is margined. Valid values include LINEAR, INVERSE. |
| > legs | array of objects | true | |
| >> instrument_id | string | true | The Paradigm created unique identifier of the Instrument. |
| >> instrument_name | string | true | The name of the Instrument, normalized by Paradigm, to be used with Paradigm’s API. |
| >> venue_instrument_name | string | true | The name of the Instrument as it is returned by the underlying venue. |
| >> kind | string | true | The kind of Instrument. Valid values include FUTURE. |
| >> base_currency | string | true | Currency instrument is based in. Valid values include BTC, ETH, SOL, AVAX. |
| >> clearing_currency | string | true | The currency the Strategy order size is submitted to the underlying venue in. Valid values include USD, BTC, ETH, SOL, AVAX. |
| >> quote_currency | string | true | The currency the Strategy is priced in. Valid values include USD. |
| >> settlement_currency | string | true | Currency Strategy is settled in. Valid values include BTC, ETH, SOL, AVAX, USD. |
| >> min_order_size | integer | true | [DEPRECATED] The minimum allowed order size increment allowed for the Instrument in the clearing_currency of the Instrument. |
| >> min_tick_size | string | true | Minimum price increment the instrument can be priced in denominated in the quote_currency of the Instrument. |
| >> min_block_size | integer | true | [DEPRECATED] Minimum block / order size of the instrument, denominated in the clearing_currency of the Strategy. |
| >> min_order_size_decimal | string | true | The minimum order size increment the Strategy can be traded in the clearing_currency of the Strategy. |
| >> min_block_size_decimal | string | true | Minimum block / order size of the instrument, denominated in the clearing_currency of the Strategy. |
| >> margin_type | string | true | How the contract is margined. Valid values include LINEAR, INVERSE. |
| >> state | string | true | State of the Instrument. Values include ACTIVE, SETTLED, EXPIRED. |
| >> expires_at | integer | true | The time in unix nanoseconds since the epoch when the instrument is will expire. -1 if the Instrument does not expire. |
| >> created_at | integer | true | The time in unix nanoseconds since the epoch when the Instrument was created by the underlying venue. |
| >> ratio | string | true | The multiple of the lowest quantity leg size. This value can be positive or negative. |
| >> side | string | true | The direction of the leg of the Strategy. Valid Values include BUY and SELL. |
| >> contract_size | integer | true | The multiplier applied to Order amount for the product size in the quote_currency of the Strategy. Example: If a Strategy has a contract_size == 10 and a quote_currency == USD, an Order of amount == 1 will in total notional size == 10 USD. |
| >> product_code | string | true | The Paradigm created product code for the Instrument. |
Error Codes
| HTTP Status Code | Code | Error | Message | Meaning |
|---|---|---|---|---|
| 400 | 4000 | INVALID_REQUEST_PARAMETER | Specific parameter field and valid values. | Response messages specifies which key is affected and the valid values. |
FSPD: [GET] /strategies/{strategy_id}
/strategies/{strategy_id} Request example
# You can also use wget
curl -X GET https://api.fs.testnet.paradigm.trade/v1/fs/strategies/123 \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.fs.testnet.paradigm.trade'
# GET /v1/fs/strategies/{strategy_id}
method = 'GET'
path = '/v1/fs/strategies/12345678'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/strategies/{strategy_id} Response example
{
"id":"56354195611058187",
"name":"SA/FS_SOLUSD_SOL-PERPETUAL",
"venue":"FTX",
"created_at":1656095318119886765,
"expires_at":-1,
"kind":"SPOT_FUTURE",
"state":"ACTIVE",
"clearing_currency":"SOL",
"quote_currency":"USD",
"settlement_currency":"USD",
"min_tick_size":"0.0025",
"last_updated":1656387233522526694,
"legs":[
{
"instrument_id":"56354194419875848",
"instrument_name":"SOLUSD",
"side":"SELL",
"ratio":"-1.0",
"kind":"SPOT",
"base_currency":"SOL",
"quote_currency":"USD",
"clearing_currency":"SOL",
"settlement_currency":"USD",
"min_tick_size":"0.0025",
"state":"ACTIVE",
"expires_at":-1,
"created_at":1656095318120586461,
"product_code":"SA",
"contract_size":1,
"venue_instrument_name":"SOL/USD",
"min_order_size_decimal":"0.01",
"min_block_size_decimal":"0.01",
"margin_type":"LINEAR",
"min_order_size":0,
"min_block_size":0
},
{
"instrument_id":"56354194419875846",
"instrument_name":"SOL-PERPETUAL",
"side":"BUY",
"ratio":"1.0",
"kind":"FUTURE",
"base_currency":"SOL",
"quote_currency":"USD",
"clearing_currency":"SOL",
"settlement_currency":"USD",
"min_tick_size":"0.0025",
"state":"ACTIVE",
"expires_at":-1,
"created_at":1656095318121345589,
"product_code":"FS",
"contract_size":1,
"venue_instrument_name":"SOL-PERP",
"min_order_size_decimal":"0.01",
"min_block_size_decimal":"0.01",
"margin_type":"LINEAR",
"min_order_size":0,
"min_block_size":0
}
],
"min_order_size_decimal":"0.01",
"min_block_size_decimal":"0.01",
"margin_type":"LINEAR",
"base_currency":"SOL",
"min_order_size":0,
"min_block_size":0
}
A [GET] /strategies/{strategy_id} request allows you to return a specific Strategy. Instruments are the legs part of a Strategy.
Strategies are what you trade as part of the Future Spread Dashboard. Strategies contain Instruments as legs.
- The response key
min_order_size_decimaldeprecatesmin_order_size. You should usemin_order_size_decimal. - The response key
min_block_size_decimaldeprecatesmin_block_size. You should usemin_block_size_decimal.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| strategy_id | endpoint | string | true | The Paradigm created unique identifier of the Strategy. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| prev | string | true | Previous Cursor string value of the last pagination page. Equal to null if first pagination page response. |
| next | string | true | Cursor string value to use to paginate results. Equal to null if no more pages are available. |
| results | Array of Objects | true | |
| > id | string | true | The Paradigm created unique Strategy Identifier. |
| > venue | string | true | The clearing venue of the Strategy. Valid values include DBT, BYB, FTX. |
| > name | string | true | A Paradigm created description of the composite Instruments in the Strategy. |
| > state | string | true | Returns Strategies which are available to trade, settled or expired. Valid values include ACTIVE, SETTLED, EXPIRED. |
| > kind | string | true | Returns the type of Strategy. Valid values include FUTURE, SPOT_FUTURE. |
| > base_currency | string | true | Currency instrument is based in. Valid values include BTC, ETH, SOL, AVAX. |
| > clearing_currency | string | true | The currency the Strategy order size is submitted to the underlying venue in. Valid values include USD, BTC, ETH, SOL, AVAX. |
| > quote_currency | string | true | The currency the Strategy is priced in. Valid values include USD. |
| > settlement_currency | string | true | Currency Strategy is settled in. Valid values include BTC, ETH, SOL, AVAX, USD. |
| > min_order_size | integer | true | [DEPRECATED] The minimum order size increment the Strategy can be traded in the clearing_currency of the Strategy. |
| > min_tick_size | string | true | Minimum price increment the instrument can be priced in denominated in the quote_currency of the Strategy. |
| > min_block_size | integer | true | [DEPRECATED] Minimum block / order size of the instrument, denominated in the clearing_currency of the Strategy. |
| > min_order_size_decimal | string | true | The minimum order size increment the Strategy can be traded in the clearing_currency of the Strategy. |
| > min_block_size_decimal | string | true | Minimum block / order size of the instrument, denominated in the clearing_currency of the Strategy. |
| > created_at | integer | true | The time in unix nanoseconds since the epoch when the Strategy was created. |
| > expires_at | integer | true | The time in unix nanoseconds since the epoch when the Strategy will expire. |
| > last_updated | integer | true | The time in unix nanoseconds since the epoch when the Strategy was last updated. |
| > margin_type | string | true | How the contract is margined. Valid values include LINEAR, INVERSE. |
| > legs | array of objects | true | |
| >> instrument_id | string | true | The Paradigm created unique identifier of the Instrument. |
| >> instrument_name | string | true | The name of the Instrument, normalized by Paradigm, to be used with Paradigm’s API. |
| >> venue_instrument_name | string | true | The name of the Instrument as it is returned by the underlying venue. |
| >> kind | string | true | The kind of Instrument. Valid values include FUTURE. |
| >> base_currency | string | true | Currency instrument is based in. Valid values include BTC, ETH, SOL, AVAX. |
| >> clearing_currency | string | true | The currency the Strategy order size is submitted to the underlying venue in. Valid values include USD, BTC, ETH, SOL, AVAX. |
| >> quote_currency | string | true | The currency the Strategy is priced in. Valid values include USD. |
| >> settlement_currency | string | true | Currency Strategy is settled in. Valid values include BTC, ETH, SOL, AVAX, USD. |
| >> min_order_size | integer | true | [DEPRECATED] The minimum allowed order size increment allowed for the Instrument in the clearing_currency of the Instrument. |
| >> min_tick_size | string | true | Minimum price increment the instrument can be priced in denominated in the quote_currency of the Instrument. |
| >> min_block_size | integer | true | [DEPRECATED] Minimum block / order size of the instrument, denominated in the clearing_currency of the Strategy. |
| >> min_order_size_decimal | string | true | The minimum order size increment the Strategy can be traded in the clearing_currency of the Strategy. |
| >> min_block_size_decimal | string | true | Minimum block / order size of the instrument, denominated in the clearing_currency of the Strategy. |
| >> margin_type | string | true | How the contract is margined. Valid values include LINEAR, INVERSE. |
| >> state | string | true | State of the Instrument. Values include ACTIVE, SETTLED, EXPIRED. |
| >> expires_at | integer | true | The time in unix nanoseconds since the epoch when the instrument is will expire. -1 if the Instrument does not expire. |
| >> created_at | integer | true | The time in unix nanoseconds since the epoch when the Instrument was created by the underlying venue. |
| >> ratio | string | true | The multiple of the lowest quantity leg size. This value can be positive or negative. |
| >> side | string | true | The direction of the leg of the Strategy. Valid Values include BUY and SELL. |
| >> contract_size | integer | true | The multiplier applied to Order amount for the product size in the quote_currency of the Strategy. Example: If a Strategy has a contract_size == 10 and a quote_currency == USD, an Order of amount == 1 will in total notional size == 10 USD. |
| >> product_code | string | true | The Paradigm created product code for the Instrument. |
Error Codes
| HTTP Status Code | Code | Error | Message | Meaning |
|---|---|---|---|---|
| 400 | 4001 | UNAVAILABLE_STRATEGY_ID | could not find strategy id: {strategy_id} | Unavailable strategy_id requested. |
FSPD: [GET] /strategies/{strategy_id}/order-book
/strategies/{strategy_id}/order-book Request example
# You can also use wget
curl -X GET https://api.fs.testnet.paradigm.trade/v1/fs/strategies/123/order-book \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.fs.testnet.paradigm.trade'
# GET /v1/fs/strategies/{strategy_id}/order-book
method = 'GET'
path = '/v1/fs/strategies/12345678/order-book'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/strategies/{strategy_id}/order-book
L2Response example
{
"id": "8955522325741570",
"seq_id": 12,
"asks": [
{
"price": "2371",
"amount": 400000,
"amount_decimal": "400000"
},
{
"price": "2372",
"amount": 400000,
"amount_decimal": "400000"
},
{
"price": "2373",
"amount": 200000,
"amount_decimal": "200000"
}
],
"bids": [
{
"price": "2370",
"amount": 400000,
"amount_decimal": "400000"
},
{
"price": "2369",
"amount": 200000,
"amount_decimal": "200000"
},
{
"price": "2368",
"amount": 600000,
"amount_decimal": "600000"
}
]
}
/strategies/{strategy_id}/order-book
L3Response example
{
"id": "8955522325741570",
"seq_id": 12,
"asks": [
{
"price": "2371",
"amount": 200000,
"amount_decimal": "200000"
},
{
"price": "2371",
"amount": 200000,
"amount_decimal": "200000"
},
{
"price": "2372",
"amount": 200000,
"amount_decimal": "200000"
},
{
"price": "2372",
"amount": 200000,
"amount_decimal": "200000"
},
{
"price": "2373",
"amount": 200000,
"amount_decimal": "200000"
}
],
"bids": [
{
"price": "2370",
"amount": 200000,
"amount_decimal": "200000"
},
{
"price": "2370",
"amount": 200000,
"amount_decimal": "200000"
},
{
"price": "2369",
"amount": 200000,
"amount_decimal": "200000"
},
{
"price": "2368",
"amount": 200000,
"amount_decimal": "200000"
},
{
"price": "2368",
"amount": 200000,
"amount_decimal": "200000"
},
{
"price": "2368",
"amount": 200000,
"amount_decimal": "200000"
}
]
}
A [GET] /strategies/{strategy_id}/order-book request allows you to return the complete Order Book for a specific Strategy.
L2 returns aggregated price and size levels. L3 returns each individual Order within the Order Book.
The response key amount_decimal deprecates amount. You should use amount_decimal.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| strategy_id | endpoint | string | true | Paradigm created unique Strategy identifier. |
| depth | query | string | false | The number of levels to return. ALL returns all levels, 1 returns the top level, 5 returns the top five levels and 25 returns the top twenty-five levels. Default is ALL. Valid values include ALL, 1, 5, and 25. |
| level | query | string | false | The L2 level is comprised of price+amount levels. The L3 level is comprised of each individual order which makes up the Order Book. Valid values include L2 and L3. Default is L2. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | true | Paradigm created unique Strategy identifier. |
| seq_id | integer | true | The unique update identifier this complete Order Book represents. |
| asks | Array of Objects | true | |
| > price | number | true | The price of the level in the quote_currency of the Strategy. |
| > amount | integer | true | [DEPRECATED] The amount on each level in the clearing_currency of the Strategy. |
| > amount_decimal | string | true | The amount on each level in the clearing_currency of the Strategy. |
| >> order_id | string | false | Paradigm created unique Order identifier. Populated when level is L3. |
| bids | Array of Objects | true | |
| > price | number | true | The price of the level in the quote_currency of the Strategy. |
| > amount | integer | true | [DEPRECATED] The amount on each level in the clearing_currency of the Strategy. |
| > amount_decimal | string | true | The amount on each level in the clearing_currency of the Strategy. |
| >> order_id | string | false | Paradigm created unique Order identifier. Populated when level is L3. |
Error Codes
| HTTP Status Code | Code | Error | Message | Meaning |
|---|---|---|---|---|
| 400 | 4000 | INVALID_REQUEST_PARAMETER | could not find strategy id: {strategy_id} | Response messages specifies which key is affected and the valid values. |
| 400 | 4001 | UNAVAILABLE_STRATEGY_ID | could not find strategy id: {strategy_id} | Unavailable strategy_id requested. |
FSPD: [GET] /strategies/{strategy_id}/order-book-summary
/strategies/{strategy_id}/order-book-summary Request example
# You can also use wget
curl -X GET https://api.fs.testnet.paradigm.trade/v1/fs/strategies/123/order-book-summary \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.fs.testnet.paradigm.trade'
# GET /v1/fs/strategies/{strategy_id}/order-book-summary
method = 'GET'
path = '/v1/fs/strategies/12345678/order-book-summary'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/strategies/{strategy_id}/order-book-summary Response example
{
"id": "8955522325741570",
"last_updated": 1629859884,
"best_bid_price": "2370",
"best_bid_amount": 400000,
"best_bid_amount_decimal": "400000",
"best_ask_price": "2371",
"best_ask_amount": 400000,
"best_ask_amount_decimal": "400000",
"last_trade_amount": 200000,
"last_trade_amount_decimal": "200000",
"last_trade_price": "2371"
}
A [GET] /strategies/{strategy_id}/order-book-summary request allows you to return a summary of the Order Book for a specific Strategy.
L2 returns aggregated price and size levels. L3 returns each individual order within the Order Book.
- The response key
best_bid_amount_decimaldeprecatesbest_bid_amount. You should usebest_bid_amount_decimal. - The response key
best_ask_amount_decimaldeprecatesbest_ask_amount. You should usebest_ask_amount_decimal. - The response key
last_trade_amount_decimaldeprecateslast_trade_amount. You should uselast_trade_amount_decimal.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| strategy_id | endpoint | string | true | Paradigm created unique Strategy identifier. |
| level | query | string | false | The L2 level is comprised of price+amount levels. The L3 level is comprised of each individual order within the Order Book. Valid values include L2 and L3. Default is L2. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| id | integer | true | Paradigm unique Strategy identifier. |
| last_updated | integer | true | The latest time in unix nanoseconds since the epoch when any value in the response was updated. |
| best_bid_price | string | true | The Paradigm Order Book best bid price in the quote_currency of the Strategy. |
| best_bid_amount | integer | true | [DEPRECATED] The Paradigm Order Book best bid amount in the clearing_currency of the Strategy. |
| best_bid_amount_decimal | string | true | The Paradigm Order Book best bid amount in the clearing_currency of the Strategy. |
| best_ask_price | string | true | The Paradigm Order Book best ask price in the quote_currency of the Strategy. |
| best_ask_amount | integer | true | [DEPRECATED] The Paradigm Order Book best ask amount in the clearing_currency of the Strategy. |
| best_ask_amount_decimal | string | true | The Paradigm Order Book best ask amount in the clearing_currency of the Strategy. |
| last_trade_price | string | true | The last traded price on Paradigm in the quote_currency of the Strategy. |
| last_trade_amount | integer | true | [DEPRECATED] The last traded amount on Paradigm in the clearing_currency of the Strategy. |
| last_trade_amount_decimal | string | true | The last traded amount on Paradigm in the clearing_currency of the Strategy. |
Error Codes
| HTTP Status Code | Code | Error | Message | Meaning |
|---|---|---|---|---|
| 400 | 4000 | INVALID_REQUEST_PARAMETER | could not find strategy id: {strategy_id} | Response messages specifies which key is affected and the valid values. |
| 400 | 4001 | UNAVAILABLE_STRATEGY_ID | could not find strategy id: {strategy_id} | Unavailable strategy_id requested. |
FSPD: [GET] /orders
/orders Request example
# You can also use wget
curl -X GET https://api.fs.testnet.paradigm.trade/v1/fs/orders \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.fs.testnet.paradigm.trade'
# GET /v1/fs/orders
method = 'GET'
path = '/v1/fs/orders'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/orders Response example
{
"next":"eyJmaWx0ZXIiOnsiVmVudWUiOiIiLCJLaW5kIjoiIiwiU3RhdGUiOiJDTE9TRUQiLCJUeXBlIjoiIiwiU3RyYXRlZ3lJZCI6IiIsIklkIjoiIiwiRGVza0lkIjoiIiwiTWVtYmVySWQiOiIiLCJMaW1pdCI6MiwiRnJvbU9yZGVySWQiOiIifSwidGltZSI6MTY1NjQ1NTAwMzQ2NTM3OTI1MiwibWFya2VyIjp7Im1hcmtlciI6IjE2NTU5Mzk5NTA5NTE4MDE3NjE2NTQxOTAwMDAiLCJkaXJlY3Rpb24iOjB9LCJpbml0aWFsX21hcmtlciI6IjE2NTYzNjc3ODE5OTE4MDE3NjE2MTI4NTAwMDAifQ==",
"prev":"None",
"results":[
{
"id":"1656367781991801761612850000",
"strategy_id":"56354195208404996",
"state":"CLOSED",
"side":"SELL",
"type":"LIMIT",
"time_in_force":"GOOD_TILL_CANCELED",
"created_at":1656367781991934776,
"venue":"FTX",
"amount":1,
"amount_decimal":"1",
"price":"50.00",
"label":"",
"pending_fill_amount":0,
"filled_amount":0,
"canceled_amount":1,
"pending_fill_amount_decimal":"0.0",
"filled_amount_decimal":"0.0",
"canceled_amount_decimal":"1",
"account_name":"ParadigmTestNinetyFive",
"events":[
{
"datetime":1656367782005599526,
"state":"OPENED",
"description":"Order added to orderbook"
},
{
"datetime":1656367811990998404,
"state":"CANCELED",
"description":"requested by user",
"reason":"USER_REQUEST"
}
],
"post_only":false
},
{
"id":"1655939950951801761654190000",
"strategy_id":"55276234854105090",
"state":"CLOSED",
"side":"BUY",
"type":"LIMIT",
"time_in_force":"GOOD_TILL_CANCELED",
"created_at":1655939950957716803,
"venue":"DBT",
"amount":200000,
"amount_decimal":"200000",
"price":"1.00",
"label":"",
"pending_fill_amount":0,
"filled_amount":0,
"canceled_amount":200000,
"pending_fill_amount_decimal":"0.0",
"filled_amount_decimal":"0.0",
"canceled_amount_decimal":"200000",
"account_name":"ParadigmTestNinetyFive",
"events":[
{
"datetime":1655939950977834727,
"state":"OPENED",
"description":"Order added to orderbook"
},
{
"datetime":1655939953201430905,
"state":"CANCELED",
"description":"requested by user",
"reason":"USER_REQUEST"
}
],
"post_only":false
}
]
}
A [GET] /orders request allows you to return all the user's Orders on Paradigm.
amount_decimaldeprecatesamount. You should useamount_decimal.pending_fill_amount_decimaldeprecatespending_fill_amount. You should usepending_fill_amount_decimal.filled_amount_decimaldeprecatesfilled_amount. You should usefilled_amount_decimal.canceled_amount_decimaldeprecatescanceled_amount. You should usecanceled_amount_decimal.
You must paginate to return the complete results. state == OPEN Orders are returned by default.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | Returns the next paginated page. |
| venue | query | string | false | Venue to return Orders for. Values include DBT, BYB, FTX. |
| kind | query | string | false | Returns Strategies of the specified contract type(s). Valid values include ANY, FUTURE, SPOT_FUTURE. |
| settlement_currency | query | string | false | Currency Strategy is settled in. Valid values include BTC, ETH, SOL, AVAX, USD. |
| strategy_id | query | string | false | The Paradigm created unique Strategy identifier. |
| state | query | string | false | The state of the Order. Valid values include OPEN, CLOSED. Default is OPEN. |
| type | query | string | false | The type of the Order. Valid values include LIMIT and MARKET. |
| page_size | query | string | false | The number of Orders to return per pagination page. Default is to return all. |
| from_order_id | query | string | false | Returns from and including the unique Paradigm Order Identifier. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| prev | string | true | Previous Cursor string value of the last pagination page. Equal to null if first pagination page response. |
| next | string | true | Cursor string value to use to paginate results. Equal to null if no more pages are available. |
| results | Array of Objects | true | |
| > id | string | true | The Paradigm created unique Order identifier. |
| > strategy_id | string | true | The Paradigm created unique identifier of the Strategy. |
| > state | string | true | The state of the Order. Valid values include OPEN, CLOSED. |
| > side | string | true | The side the strategy was executed. Valid values include BUY and SELL. |
| > type | string | true | The type of order. Valid values include LIMIT and MARKET. |
| > time_in_force | string | true | The validity protocol the order. Valid values include GOOD_TILL_CANCELED. |
| > created_at | number | true | The time in unix nanoseconds since the epoch when the Order was created. |
| > venue | string | true | The underlying venue the Strategy is cleared upon. Valid values include DBT, BYB, FTX. |
| > amount | integer | true | [DEPRECATED] The size of the Order in the clearing_currency of the Strategy. |
| > amount_decimal | string | true | The size of the Order in the clearing_currency of the Strategy. |
| > price | string | true | The price of the order in the quote_currency of the Strategy. Empty string if the order was a MARKET order type. |
| > label | string | true | The user created label for the Order. |
| > pending_fill_amount | integer | true | [DEPRECATED] The amount of the order pending clearing in the clearing_currency of the Strategy. |
| > pending_fill_amount_decimal | string | true | The amount of the order pending clearing in the clearing_currency of the Strategy. |
| > filled_amount | integer | true | [DEPRECATED] The amount of the order filled in the clearing_currency of the Strategy. |
| > filled_amount_decimal | string | true | The amount of the order filled in the clearing_currency of the Strategy. |
| > canceled_amount | integer | true | [DEPRECATED] The amount of the order canceled due to falling below the min_block_size of the Strategy after execution. Only affects Orders when venue == DBT. |
| > canceled_amount_decimal | string | true | The amount of the order canceled due to falling below the min_block_size of the Strategy after execution. Only affects Orders when venue == DBT. |
| > account_name | string | true | The name of the users’s underlying venue’s API Key on your Paradigm Client Admin Dashboard used to submit the order. |
| > post_only | boolean | true | If the order was flagged post_only or not. |
| > events | array of objects | true | |
| >> datetime | integer | true | The time in unix nanoseconds since the epoch when the event occurred. |
| >> state | string | true | Status of what happened during the event. Valid values include OPENED, PENDING_FILL, FILLED, CANCELED, EXPIRED. |
| >> reason | string | false | A code for the reason of the event state. Only available for CANCELED events. Valid values include SAME_DESK_MATCH, NO_MATCH, REMAINDER_AMOUNT_BELOW_MINIMUM, AMOUNT_BELOW_MINIMUM, EXPIRED_STRATEGY, VENUE_REJECTION, WEBSOCKET_DISCONNECT, USER_REQUEST, REPLACE, MARKET_MAKER_PROTECTION |
| >> description | string | true | Brief description of what happened in the event. |
Error Codes
| HTTP Status Code | Code | Error | Message | Meaning |
|---|---|---|---|---|
| 400 | 4000 | INVALID_REQUEST_PARAMETER | Specific parameter field and valid values. | Response messages specifies which key is affected and the valid values. |
| 400 | 4001 | UNAVAILABLE_STRATEGY_ID | Specific parameter field and valid values. | Unavailable strategy_id requested. |
FSPD: [GET] /orders/{order_id}
/orders/{order_id} Request example
# You can also use wget
curl -X GET https://api.fs.testnet.paradigm.trade/v1/fs/orders/123 \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.fs.testnet.paradigm.trade'
# GET /v1/fs/orders/{order_id}
method = 'GET'
path = '/v1/fs/orders/1234'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/orders/{order_id} Response example
{
"id":"1656367781991801761612850000",
"strategy_id":"56354195208404996",
"state":"CLOSED",
"side":"SELL",
"type":"LIMIT",
"time_in_force":"GOOD_TILL_CANCELED",
"created_at":1656367781991934776,
"venue":"FTX",
"amount":1,
"amount_decimal":"1.12",
"price":"50.00",
"label":"",
"pending_fill_amount":0,
"filled_amount":0,
"canceled_amount":1,
"pending_fill_amount_decimal":"0.0",
"filled_amount_decimal":"0.0",
"canceled_amount_decimal":"1.12",
"account_name":"ParadigmTestNinetyFive",
"events":[
{
"datetime":1656367782005599526,
"state":"OPENED",
"description":"Order added to orderbook"
},
{
"datetime":1656367811990998404,
"state":"CANCELED",
"description":"requested by user",
"reason":"USER_REQUEST"
}
],
"post_only":false
}
A [GET] /orders/{order_id} request allows you to return a specific Order from the User.
amount_decimaldeprecatesamount. You should useamount_decimal.pending_fill_amount_decimaldeprecatespending_fill_amount. You should usepending_fill_amount_decimal.filled_amount_decimaldeprecatesfilled_amount. You should usefilled_amount_decimal.canceled_amount_decimaldeprecatescanceled_amount. You should usecanceled_amount_decimal.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| order_id | endpoint | string | true | The Paradigm created unique identifier of the Order. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | true | The Paradigm created unique Order identifier. |
| strategy_id | string | true | The Paradigm created unique identifier of the Strategy. |
| state | string | true | The state of the Order. Valid values include OPEN, CLOSED. |
| side | string | true | The side the strategy was executed. Valid values include BUY and SELL. |
| type | string | true | The type of order. Valid values include LIMIT and MARKET. |
| time_in_force | string | true | The validity protocol the order. Valid values include GOOD_TILL_CANCELED. |
| created_at | number | true | The time in unix nanoseconds since the epoch when the Order was created. |
| venue | string | true | The underlying venue the Strategy is cleared upon. Valid values include DBT, BYB, FTX. |
| amount | integer | true | [DEPRECATED] The size of the Order in the clearing_currency of the Strategy. |
| amount_decimal | string | true | The size of the Order in the clearing_currency of the Strategy. |
| price | string | true | The price of the order in the quote_currency of the Strategy. Empty string if the order was a MARKET order type. |
| label | string | true | The user created label for the Order. |
| pending_fill_amount | integer | true | [DEPRECATED] The amount of the order pending clearing in the clearing_currency of the Strategy. |
| pending_fill_amount_decimal | string | true | The amount of the order pending clearing in the clearing_currency of the Strategy. |
| filled_amount | integer | true | [DEPRECATED] The amount of the order filled in the clearing_currency of the Strategy. |
| filled_amount_decimal | string | true | The amount of the order filled in the clearing_currency of the Strategy. |
| canceled_amount | integer | true | [DEPRECATED] The amount of the order canceled due to falling below the min_block_size of the Strategy after execution. Only affects Orders when venue == DBT. |
| canceled_amount_decimal | string | true | The amount of the order canceled due to falling below the min_block_size of the Strategy after execution. Only affects Orders when venue == DBT. |
| account_name | string | true | The name of the users’s underlying venue’s API Key on your Paradigm Client Admin Dashboard used to submit the order. |
| post_only | boolean | true | If the order was flagged post_only or not. |
| events | array of objects | true | |
| > datetime | integer | true | The time in unix nanoseconds since the epoch when the event occurred. |
| > state | string | true | Status of what happened during the event. Valid values include OPENED, PENDING_FILL, FILLED, CANCELED, EXPIRED. |
| > reason | string | false | A code for the reason of the event state. Only available for CANCELED events. Valid values include SAME_DESK_MATCH, NO_MATCH, REMAINDER_AMOUNT_BELOW_MINIMUM, AMOUNT_BELOW_MINIMUM, EXPIRED_STRATEGY, VENUE_REJECTION, WEBSOCKET_DISCONNECT, USER_REQUEST, REPLACE, MARKET_MAKER_PROTECTION |
| > description | string | true | Brief description of what happened in the event. |
Error Codes
| HTTP Status Code | Code | Error | Message | Meaning |
|---|---|---|---|---|
| 400 | 4003 | UNAVAILABLE_ORDER_ID | could not find order id: {order_id} | Unavailable order_id requested. |
FSPD: [POST] /orders
/orders Request example
# built ins
import base64
import hmac
import time
import json
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.fs.testnet.paradigm.trade'
# POST /v1/fs/orders
method = 'POST'
path = '/v1/fs/orders'
payload = {
"side": "BUY",
"strategy_id":"123456789",
"price":"35",
"amount_decimal": "200000",
"type":"LIMIT",
"label":"settle",
"account_name":"ParadigmTestNinetyFive",
"post_only": False
}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.post(host+path,
headers=headers,
json=payload)
print(response.status_code)
print(response.text)
/orders Response example
{
"id": "1629860095771801761622800000",
"strategy_id": "8955522325741570",
"side": "BUY",
"price": "2368",
"amount": 200000,
"amount_decimal": "200000",
"time_in_force": "GOOD_TILL_CANCELED",
"created_at": 1629860095773171285,
"type": "LIMIT",
"label": "settle",
"account_name": "fake",
"state": "PENDING",
"post_only":false
}
A [POST] /orders request allows you to create an Order that interacts with the Strategy's Order Book.
The amount_decimal you specify is the individual leg size for the Strategy. For example, if you are trading a 1-1 Future Spread and submit an Order with amount_decimal == 100000, each leg's individual amount_decimal == 100000 for a total Strategy amount_decimal == 200000.
The state of the Order will always return PENDING in response to a successful request. The orders.{venue}.{kind}.{strategy_id} WebSocket channel will send a message when the Order's state == OPEN and the Order is cancelable and available upon the Strategy's Order Book. If an Order has a state == PENDING, cancel requests will be made on a best efforts basis.
The parameter & response key amount_decimal deprecates amount. You should use amount_decimal to specify the amount of your Order. If both amount and amount_decimal are specified in the request, amount_decimal will be used.
Only Orders of type == LIMIT can be time_in_force == IMMEDIATE_OR_CANCEL. Orders which are time_in_force == IMMEDIATE_OR_CANCEL cannot be post_only == True.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| side | body | string | true | The direction of the order. Valid values include BUY and SELL. |
| strategy_id | body | string | true | The Paradigm created unique identifier of the strategy. |
| price | body | string | false | The price of the Strategy in the quote_currency of the Strategy. Only used for LIMIT type orders. |
| amount | body | integer | false | [DEPRECATED] The total size of the Order in the clearing_currency of the Strategy. |
| amount_decimal | body | string | true | The total size of the Order in the clearing_currency of the Strategy. |
| type | body | string | true | The Order type. Valid values include LIMIT and MARKET. |
| label | body | string | false | A user defined label for the Order. A maximum of 100 characters. |
| account_name | body | string | true | The name of the user’s underlying venue’s API Key on your Paradigm Client Admin Dashboard. |
| post_only | body | bool | false | If the Order crosses an existing Order, cancel the Order without filling or placing upon the Order Book. |
| time_in_force | body | string | false | The time condition associated with the order. Valid values include GOOD_TILL_CANCELED, IMMEDIATE_OR_CANCEL. GOOD_TILL_CANCELED is the value if unspecified. |
Response Schema
Status Code 201
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | true | The Paradigm created unique Order identifier. |
| strategy_id | string | true | The Paradigm created unique identifier of the Strategy. |
| side | string | true | The direction of the order. Valid values include BUY and SELL. |
| price | string | false | The price of the order in the quote_currency of the Strategy. Omitted if the order was a MARKET order type. |
| amount | integer | true | [DEPRECATED] The total size of the order in the clearing_currency of the Strategy. |
| amount_decimal | string | true | The total size of the order in the clearing_currency of the Strategy. |
| time_in_force | string | true | The time the order is in force. Valid values include GOOD_TILL_CANCELED, IMMEDIATE_OR_CANCEL. |
| created_at | integer | true | The time in unix nanoseconds since the epoch when the Order was created. |
| type | string | true | The type of the Order. Valid values include LIMIT and MARKET. |
| label | string | false | The user created label for the Order. |
| account_name | string | true | The name of the user’s underlying venue’s API Key on your Paradigm Client Admin Dashboard used to submit order. |
| state | string | true | The state of the Order. Will always be PENDING. |
| post_only | bool | true | If the Order crosses an existing Order, cancel the Order without filling or placing upon the Order Book. |
Error Codes
| HTTP Status Code | Code | Error | Message | Meaning |
|---|---|---|---|---|
| 400 | 4000 | INVALID_REQUEST_PARAMETER | Specific parameter field and valid values. | Response messages specifies which key is affected and the valid values. |
| 400 | 4001 | UNAVAILABLE_STRATEGY_ID | Specific parameter field and valid values. | Unavailable strategy_id requested. |
| 400 | 4004 | UNAVAILABLE_ACCOUNT_NAME | could not find account name: {account_name}. | The provided account_name in the request does not match an existing Venue API Key name on the Client Admin Dashboard. |
| 400 | 4006 | UNAVAILABLE_ENDPOINT_PLATFORM_STATE | Unavailable endpoint during existing platform_state. | Endpoint is unavailable given the present platform_state. |
| 400 | 4008 | TRADE_REJECTION_LOCKOUT_PENALTY | Desk is under a Trade Rejection Lockout Penalty, please contact support to remove. | Endpoint is unavailable given you are under a Trade Rejection Lockout. |
| 400 | 4013 | TRADE_SIZE_EXCEEDED | Trade size limit (limit) exceeded. Please update the order amount |
Strategy total amount of the order would exceed the trade size limit. |
FSPD: [POST] /orders/{order_id}/replace
/orders/{order_id}/replace Request example
# built ins
import base64
import hmac
import time
import json
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.fs.testnet.paradigm.trade'
# POST /v1/fs/orders/{order_id}/replace
method = 'POST'
path = '/v1/fs/orders/{order_id}/replace'
payload = {
"price":"35",
"amount_decimal": "200000",
"type":"LIMIT",
"label":"settle",
"account_name":"ParadigmTestNinetyFive"
}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.post(host+path,
headers=headers,
json=payload)
print(response.status_code)
print(response.text)
/orders/{order_id}/replace Response example
{
"id": "1629860095771801761622800000",
"strategy_id": "8955522325741570",
"side": "BUY",
"price": "2368",
"amount": 200000,
"amount_decimal": "200000",
"time_in_force": "GOOD_TILL_CANCELED",
"created_at": 1629860095773171285,
"type": "LIMIT",
"label": "settle",
"account_name": "fake",
"state": "PENDING",
"post_only":false
}
A [POST] /orders/{order_id}/replace request allows you to update an existing Order of yours.
When an Order is updated, the time priority is lost and becomes the created_at time of the newly created Order.
You cannot update the side of an Order.
The state of the Order will always return PENDING in response to a successful request. The orders.{venue}.{kind}.{strategy_id} WebSocket channel will send a message when the Order's state == OPEN and the Order is cancelable and available upon the Strategy's Order Book. If an Order has a state == PENDING, cancel requests will be made on a best efforts basis.
The parameter & response key amount_decimal deprecates amount. You should use amount_decimal to specify the amount of your Order. If both amount and amount_decimal are specified in the request, amount_decimal will be used.
Only Orders of type == LIMIT can be time_in_force == IMMEDIATE_OR_CANCEL. Orders which are time_in_force == IMMEDIATE_OR_CANCEL cannot be post_only == True.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| order_id | endpoint | string | true | The Paradigm created unique identifier of an existing Order. |
| price | body | string | true | The price of the Strategy in the quote_currency of the Strategy. |
| amount | body | number | false | [DEPRECATED] The total size of the Order in the clearing_currency of the Strategy. |
| amount_decimal | body | string | true | The total size of the Order in the clearing_currency of the Strategy. |
| type | body | string | true | The Order type. Valid values include LIMIT and MARKET. |
| label | body | string | false | A user defined label for the Order. A maximum of 100 characters. |
| account_name | body | string | true | The name of the user’s underlying venue’s API Key on your Paradigm Client Admin Dashboard. |
| post_only | body | bool | false | If the Order crosses an existing Order, cancel the Order without filling or placing upon the Order Book. |
| time_in_force | body | string | false | The time condition associated with the order. Valid values include GOOD_TILL_CANCELED, IMMEDIATE_OR_CANCEL. GOOD_TILL_CANCELED is the value if unspecified. |
Response Schema
Status Code 201
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | true | The Paradigm created unique Order identifier. |
| strategy_id | string | true | The Paradigm created unique identifier of the Strategy. |
| side | string | true | The direction of the order. Valid values include BUY and SELL. |
| price | string | true | The price of the order in the quote_currency of the Strategy. |
| amount | integer | true | [DEPRECATED] The total size of the order in the clearing_currency of the Strategy. |
| amount_decimal | string | true | The total size of the order in the clearing_currency of the Strategy. |
| time_in_force | string | true | The time the order is in force. Valid values include GOOD_TILL_CANCELED, IMMEDIATE_OR_CANCEL. |
| created_at | integer | true | The time in unix nanoseconds since the epoch when the Order was created. |
| type | string | true | The type of the Order. Valid values include LIMIT and MARKET. |
| state | string | true | The state of the Order. Will always be PENDING |
| label | string | false | The user created label for the Order. |
| account_name | string | true | The name of the user’s underlying venue’s API Key on your Paradigm Client Admin Dashboard used to submit order. |
| post_only | bool | true | If the Order crosses an existing Order, cancel the Order without filling or placing upon the Order Book. |
Error Codes
| HTTP Status Code | Code | Error | Message | Meaning |
|---|---|---|---|---|
| 400 | 4000 | INVALID_REQUEST_PARAMETER | Specific parameter field and valid values. | Response messages specifies which key is affected and the valid values. |
| 400 | 4001 | UNAVAILABLE_STRATEGY_ID | Specific parameter field and valid values. | Unavailable strategy_id requested. |
| 400 | 4003 | UNAVAILABLE_ORDER_ID | Specific parameter field and valid values. | Unavailable order_id requested. |
| 400 | 4004 | UNAVAILABLE_ACCOUNT_NAME | could not find account name: {account_name}. | The provided account_name in the request does not match an existing Venue API Key name on the Client Admin Dashboard. |
| 400 | 4006 | UNAVAILABLE_ENDPOINT_PLATFORM_STATE | Unavailable endpoint during existing platform_state. | Endpoint is unavailable given the present platform_state. |
| 400 | 4008 | TRADE_REJECTION_LOCKOUT_PENALTY | Desk is under a Trade Rejection Lockout Penalty, please contact support to remove. | Endpoint is unavailable given you are under a Trade Rejection Lockout. |
| 400 | 4013 | TRADE_SIZE_EXCEEDED | Trade size limit (limit) exceeded. Please update the order amount |
Strategy total amount of the order would exceed the trade size limit. |
FSPD: [DELETE] /orders
/orders Request example
# You can also use wget
curl -X DELETE https://api.fs.testnet.paradigm.trade/v1/fs/orders \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.fs.testnet.paradigm.trade'
# DELETE /v1/fs/orders
method = 'DELETE'
path = '/v1/fs/orders'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.delete(host+path,
headers=headers)
print(response.status_code)
print(response.text)
A [DELETE] /orders request allows you to cancel all the user's existing Orders.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| side | query | string | false | The side of all Orders to Cancel. Valid values include BUY and SELL. |
| label | query | string | false | label of all Orders to Cancel. |
Response Schema
Status Code 204
There is no response schema for this endpoint. Success is indicated by the HTTP Status Code 204.
Error Codes
| HTTP Status Code | Code | Error | Message | Meaning |
|---|---|---|---|---|
| 400 | 4000 | INVALID_REQUEST_PARAMETER | Specific parameter field and valid values. | Response messages specifies which key is affected and the valid values. |
| 400 | 4006 | UNAVAILABLE_ENDPOINT_PLATFORM_STATE | Unavailable endpoint during existing platform_state. | Endpoint is unavailable given the present platform_state. |
FSPD: [DELETE] /orders/{order_id}
/orders/{order_id} Request example
# You can also use wget
curl -X DELETE https://api.fs.testnet.paradigm.trade/v1/fs/orders/123 \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.fs.testnet.paradigm.trade'
# DELETE /v1/fs/orders/{order_id}
method = 'DELETE'
path = '/v1/fs/orders/123'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.delete(host+path,
headers=headers)
print(response.status_code)
print(response.text)
A [DELETE] /orders/{order_id} request allows you to cancel a specific Order of the user's.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| order_id | endpoint | string | true | order_id of the Order to Cancel. |
Response Schema
Status Code 204
There is no response schema for this endpoint. Success is indicated by the HTTP Status Code 204.
Error Codes
| HTTP Status Code | Code | Error | Message | Meaning |
|---|---|---|---|---|
| 400 | 4003 | UNAVAILABLE_ORDER_ID | could not find order id: {order_id} | Unavailable order_id requested. |
| 400 | 4006 | UNAVAILABLE_ENDPOINT_PLATFORM_STATE | Unavailable endpoint during existing platform_state. | Endpoint is unavailable given the present platform_state. |
FSPD: [GET] /trades
/trades Request example
# You can also use wget
curl -X GET https://api.fs.testnet.paradigm.trade/v1/fs/trades \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.fs.testnet.paradigm.trade'
# GET /v1/fs/trades
method = 'GET'
path = '/v1/fs/trades'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/trades Response example
{
"next":"eyJmaWx0ZXIiOnsiU3RhdGUiOiIiLCJWZW51ZSI6IiIsIktpbmQiOiIiLCJSb2xlIjoiIiwiU3RyYXRlZ3lJZCI6IiIsIklkIjoiIiwiT3JkZXJJZCI6IiIsIkxpbWl0IjoyLCJGcm9tVHJhZGVJZCI6IiJ9LCJ0aW1lIjoxNjU2NDU2NjE0ODM0OTE4NDgyLCJtYXJrZXIiOnsibWFya2VyIjoiMTY1NDE5MDUyMjY2MTgwMTc2MTYwODA2MDAwMCIsImRpcmVjdGlvbiI6MH0sImluaXRpYWxfbWFya2VyIjoiMTY1NDE5MDY1NDExMTgwMTc2MTYwODA2MDAwMCJ9",
"prev":"None",
"results":[
{
"seq_no":116,
"id":"1654190654111801761608060000",
"exec_id":"251621",
"order_id":"1653534454231801761611110000",
"strategy_id":"51217492537901066",
"venue":"DBT",
"kind":"FUTURE",
"state":"FILLED",
"role":"MAKER",
"executed_at":1654190654113783430,
"filled_at":1654190655080786015,
"side":"BUY",
"price":"35.00",
"legs":[
{
"instrument_name":"BTC-3JUN22",
"side":"SELL",
"price":"30647.53",
"fee_amount":"0.00032629",
"index_price":"30235.08",
"venue_trade_id":"107753909",
"mark_price":"30231.82",
"best_bid_price":"30230.5",
"best_ask_price":"30236",
"max_venue_price":"30687",
"min_venue_price":"29779.5",
"amount_decimal":"100000",
"best_bid_amount_decimal":"1370",
"best_ask_amount_decimal":"20",
"amount":100000,
"best_bid_amount":1370,
"best_ask_amount":20
},
{
"instrument_name":"BTC-31MAR23",
"side":"BUY",
"price":"30682.53",
"fee_amount":"0.0008148",
"index_price":"30235.08",
"venue_trade_id":"107753908",
"mark_price":"31097.99",
"best_bid_price":"31100",
"best_ask_price":"31102.5",
"max_venue_price":"31563",
"min_venue_price":"30630",
"amount_decimal":"100000",
"best_bid_amount_decimal":"2930",
"best_ask_amount_decimal":"20",
"amount":100000,
"best_bid_amount":2930,
"best_ask_amount":20
}
],
"strategy_name":"CF_BTC-3JUN22_BTC-31MAR23",
"quote_currency":"USD",
"mark_price":"-866.17",
"settlement_status":"Cleared by Deribit",
"amount_decimal":"100000",
"amount":100000
},
{
"seq_no":115,
"id":"1654190522661801761608060000",
"exec_id":"251618",
"order_id":"1653534337471801761611110000",
"strategy_id":"51217492537901066",
"venue":"DBT",
"kind":"FUTURE",
"state":"FILLED",
"role":"MAKER",
"executed_at":1654190522669823565,
"filled_at":1654190523624965681,
"side":"BUY",
"price":"35.00",
"legs":[
{
"instrument_name":"BTC-3JUN22",
"side":"SELL",
"price":"30622.77",
"fee_amount":"0.00032655",
"index_price":"30215.27",
"venue_trade_id":"107753776",
"mark_price":"30205.74",
"best_bid_price":"30197",
"best_ask_price":"30205",
"max_venue_price":"30659",
"min_venue_price":"29752.5",
"amount_decimal":"100000",
"best_bid_amount_decimal":"9220",
"best_ask_amount_decimal":"5500",
"amount":100000,
"best_bid_amount":9220,
"best_ask_amount":5500
},
{
"instrument_name":"BTC-31MAR23",
"side":"BUY",
"price":"30657.77",
"fee_amount":"0.00081545",
"index_price":"30215.27",
"venue_trade_id":"107753775",
"mark_price":"31074.34",
"best_bid_price":"31075",
"best_ask_price":"31098",
"max_venue_price":"31538.5",
"min_venue_price":"30606",
"amount_decimal":"100000",
"best_bid_amount_decimal":"5720",
"best_ask_amount_decimal":"30",
"amount":100000,
"best_bid_amount":5720,
"best_ask_amount":30
}
],
"strategy_name":"CF_BTC-3JUN22_BTC-31MAR23",
"quote_currency":"USD",
"mark_price":"-868.6",
"settlement_status":"Cleared by Deribit",
"amount_decimal":"100000",
"amount":100000
}
]
}
A [GET] /trades request allows you to return all the user's Trades on Paradigm.
amount_decimaldeprecatesamount. You should useamount_decimal.legs.amount_decimaldeprecateslegs.amount. You should uselegs.amount_decimal.legs.best_bid_amount_decimaldeprecateslegs.best_bid_amount. You should uselegs.best_bid_amount_decimal.legs.best_ask_amount_decimaldeprecateslegs.best_ask_amount. You should uselegs.best_ask_amount_decimal.
You must paginate to return the complete results.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | Returns the next paginated page. |
| state | query | string | false | The state of the trade. Valid values are FILLED and REJECTED. |
| venue | query | string | false | Venue to return Trades for. Values include DBT, BYB, FTX. |
| kind | query | string | false | Returns Strategies of the specified contract type. Valid values include ANY and FUTURE. |
| settlement_currency | query | string | false | Currency Strategy is settled in. Valid values include BTC, ETH, SOL, AVAX, USD. |
| role | query | string | false | The role of the user in the trade. Valid values include MAKER and TAKER. |
| strategy_id | query | string | false | The unique strategy_id to return trades for. |
| page_size | query | string | false | The number of Trades to return per pagination page. Default is to return all. |
| from_trade_id | query | string | false | Returns from and including the specified Paradigm Unique Trade Identifier. |
| order_id | query | string | false | Returns all Trades associated with the specified Paradigm created unique Order identifier. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| prev | string | true | Previous Cursor string value of the last pagination page. Equal to null if first pagination page response. |
| next | string | true | Cursor string value to use to paginate results. Equal to null if no more pages are available. |
| results | Array of Objects | true | |
| > seq_no | integer | true | The sequential number of the trade for the specific Strategy. |
| > id | string | true | The Paradigm created unique identifier of the Trade. |
| > exec_id | string | true | The corresponding trade_id present upon the underlying venue of the Strategy. "-1" if trade is not FILLED. |
| > order_id | string | true | The Paradigm created unique identifier of the order associated with the trade. |
| > state | string | true | The state of the trade. Valid values include FILLED and REJECTED. |
| > reject_party | string | false | Party responsible for the failure of clearing. Valid values include USER or COUNTERPARTY. Omitted if trade is not FILLED. |
| > reject_reason | string | false | Rejection reason for failure of clearing. Omitted if trade is not FILLED. |
| > role | string | true | The role of the user in the trade. Valid values include TAKER and MAKER. |
| > executed_at | integer | true | The timestamp in unix nanoseconds since the epoch when the trade was executed on Paradigm. |
| > filled_at | integer | true | The timestamp in unix nanoseconds since the epoch when the trade was filled on Paradigm. -1 if the trade is not FILLED. |
| > strategy_id | string | true | The Paradigm created unique identifier of the Strategy. |
| > side | string | true | The side the Strategy was executed. Valid values include BUY and SELL. |
| > venue | string | true | The underlying venue the Strategy is cleared upon. Valid values include DBT, BYB, FTX. |
| > price | string | true | The price in the quote_currency of the Strategy the trade was executed at. |
| > amount | integer | true | [DEPRECATED] The amount in the clearing_currency of the Strategy the trade was executed at. |
| > amount_decimal | string | true | The amount in the clearing_currency of the Strategy the trade was executed at. |
| > strategy_name | string | true | A Paradigm created description of the composite Instruments making up the Strategy. |
| > quote_currency | string | true | The currency the Strategy is priced. Valid values include USD. |
| > mark_price | string | true | The Strategy's composite venue mark price calculated from the individual legs at time of execution. |
| > settlement_status | string | false | And informative string containing the settlement status. E.g.: "Cleared by Deribit". Omitted if trade is not FILLED. |
| > legs | array of objects | true | |
| >> instrument_name | string | true | The name of the Instrument, normalized by Paradigm, to be used with Paradigm’s API. |
| >> amount | integer | true | [DEPRECATED] The amount of the Instrument traded in the clearing_currency of the Instrument. |
| >> amount_decimal | string | true | The amount of the Instrument traded in the clearing_currency of the Instrument. |
| >> price | string | true | The price of the Instrument traded in the quote_currency of the Instrument. |
| >> side | string | true | The side this Instrument is traded. Valid values include BUY and SELL. |
| >> fee_amount | string | false | The amount of fees paid for this leg of the trade in the base_currency of the Strategy. Omitted if trade is not FILLED. |
| >> venue_trade_id | string | false | The corresponding unique trade identifier available upon the underlying venue. Omitted if the trade is not FILLED. |
| >> index_price | string | false | The index price of the Instrument at the time of execution. Omitted if the trade is not FILLED. |
| >> mark_iv | string | false | The implied volatility of the Instrument at the time of execution. Omitted if unavailable. |
| >> mark_price | string | true | The calculated Mark Price of the Instrument from the underlying settlement venue. |
| >> min_venue_price | string | true | The minimum price a Strategy can be traded at. |
| >> max_venue_price | string | true | The maximum price a Strategy can be traded at. |
| >> best_bid_price | string | true | The best calculated bid price from the underlying settlement venue of the Strategy. |
| >> best_bid_amount | integer | true | [DEPRECATED] The best calculated bid amount from the underlying settlement venue of the Strategy. |
| >> best_bid_amount_decimal | string | true | The best calculated bid amount from the underlying settlement venue of the Strategy. |
| >> best_ask_price | string | true | The best calculated ask price from the underlying settlement venue of the Strategy. |
| >> best_ask_amount | integer | true | [DEPRECATED] The best calculated ask amount from the underlying settlement venue of the Strategy. |
| >> best_ask_amount_decimal | string | true | The best calculated ask amount from the underlying settlement venue of the Strategy. |
Error Codes
| HTTP Status Code | Code | Error | Message | Meaning |
|---|---|---|---|---|
| 400 | 4000 | INVALID_REQUEST_PARAMETER | Specific parameter field and valid values. | Response messages specifies which key is affected and the valid values. |
FSPD: [GET] /trades/{trade_id}
/trades/{trade_id} Request example
# You can also use wget
curl -X GET https://api.fs.testnet.paradigm.trade/v1/fs/trades/123 \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.fs.testnet.paradigm.trade'
# GET /v1/fs/trades/{trade_id}
method = 'GET'
path = '/v1/fs/trades/1234'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/trades/{trade_id} Response example
{
"seq_no":116,
"id":"1654190654111801761608060000",
"exec_id":"251621",
"order_id":"1653534454231801761611110000",
"strategy_id":"51217492537901066",
"venue":"DBT",
"kind":"FUTURE",
"state":"FILLED",
"role":"MAKER",
"executed_at":1654190654113783430,
"filled_at":1654190655080786015,
"side":"BUY",
"price":"35.00",
"legs":[
{
"instrument_name":"BTC-3JUN22",
"side":"SELL",
"price":"30647.53",
"fee_amount":"0.00032629",
"index_price":"30235.08",
"venue_trade_id":"107753909",
"mark_price":"30231.82",
"best_bid_price":"30230.5",
"best_ask_price":"30236",
"max_venue_price":"30687",
"min_venue_price":"29779.5",
"amount_decimal":"100000",
"best_bid_amount_decimal":"1370",
"best_ask_amount_decimal":"20",
"amount":100000,
"best_bid_amount":1370,
"best_ask_amount":20
},
{
"instrument_name":"BTC-31MAR23",
"side":"BUY",
"price":"30682.53",
"fee_amount":"0.0008148",
"index_price":"30235.08",
"venue_trade_id":"107753908",
"mark_price":"31097.99",
"best_bid_price":"31100",
"best_ask_price":"31102.5",
"max_venue_price":"31563",
"min_venue_price":"30630",
"amount_decimal":"100000",
"best_bid_amount_decimal":"2930",
"best_ask_amount_decimal":"20",
"amount":100000,
"best_bid_amount":2930,
"best_ask_amount":20
}
],
"strategy_name":"CF_BTC-3JUN22_BTC-31MAR23",
"quote_currency":"USD",
"mark_price":"-866.17",
"settlement_status":"Cleared by Deribit",
"amount_decimal":"100000",
"amount":100000
}
A [GET] /trades/{trade_id} request allows you to return a specific Trade of the user's.
amount_decimaldeprecatesamount. You should useamount_decimal.legs.amount_decimaldeprecateslegs.amount. You should uselegs.amount_decimal.legs.best_bid_amount_decimaldeprecateslegs.best_bid_amount. You should uselegs.best_bid_amount_decimal.legs.best_ask_amount_decimaldeprecateslegs.best_ask_amount. You should uselegs.best_ask_amount_decimal.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| trade_id | endpoint | string | true | The Paradigm created unique Trade identifier. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| seq_no | integer | true | The sequential number of the trade for the specific Strategy. |
| id | string | true | The Paradigm created unique identifier of the Trade. |
| exec_id | string | true | The corresponding trade_id present upon the underlying venue of the Strategy. "-1" if trade is not FILLED. |
| order_id | string | true | The Paradigm created unique identifier of the order associated with the trade. |
| state | string | true | The state of the trade. Valid values include FILLED and REJECTED. |
| reject_party | string | false | Party responsible for the failure of clearing. Valid values include USER or COUNTERPARTY. Omitted if trade is not FILLED. |
| reject_reason | string | false | Rejection reason for failure of clearing. Omitted if trade is not FILLED. |
| role | string | true | The role of the user in the trade. Valid values include TAKER and MAKER. |
| executed_at | integer | true | The timestamp in unix nanoseconds since the epoch when the trade was executed on Paradigm. |
| filled_at | integer | true | The timestamp in unix nanoseconds since the epoch when the trade was filled on Paradigm. -1 if the trade is not FILLED. |
| strategy_id | string | true | The Paradigm created unique identifier of the Strategy. |
| side | string | true | The side the Strategy was executed. Valid values include BUY and SELL. |
| venue | string | true | The underlying venue the Strategy is cleared upon. Valid values include DBT, BYB, FTX. |
| price | string | true | The price in the quote_currency of the Strategy the trade was executed at. |
| amount | integer | true | [DEPRECATED] The amount in the clearing_currency of the Strategy the trade was executed at. |
| amount_decimal | string | true | The amount in the clearing_currency of the Strategy the trade was executed at. |
| strategy_name | string | true | A Paradigm created description of the composite Instruments making up the Strategy. |
| quote_currency | string | true | The currency the Strategy is priced. Valid values include USD. |
| mark_price | string | true | The Strategy's composite venue mark price calculated from the individual legs at time of execution. |
| settlement_status | string | false | And informative string containing the settlement status. E.g.: "Cleared by Deribit". Omitted if trade is not FILLED. |
| legs | array of objects | true | |
| > instrument_name | string | true | The name of the Instrument, normalized by Paradigm, to be used with Paradigm’s API. |
| > amount | integer | true | [DEPRECATED] The amount of the Instrument traded in the clearing_currency of the Instrument. |
| > amount_decimal | string | true | The amount of the Instrument traded in the clearing_currency of the Instrument. |
| > price | string | true | The price of the Instrument traded in the quote_currency of the Instrument. |
| > side | string | true | The side this Instrument is traded. Valid values include BUY and SELL. |
| > fee_amount | string | false | The amount of fees paid for this leg of the trade in the base_currency of the Strategy. Omitted if trade is not FILLED. |
| > venue_trade_id | string | false | The corresponding unique trade identifier available upon the underlying venue. Omitted if the trade is not FILLED. |
| > index_price | string | false | The index price of the Instrument at the time of execution. Omitted if the trade is not FILLED. |
| > mark_iv | string | false | The implied volatility of the Instrument at the time of execution. Omitted if unavailable. |
| > mark_price | string | true | The calculated Mark Price of the Instrument from the underlying settlement venue. |
| > min_venue_price | string | true | The minimum price a Strategy can be traded at. |
| > max_venue_price | string | true | The maximum price a Strategy can be traded at. |
| > best_bid_price | string | true | The best calculated bid price from the underlying settlement venue of the Strategy. |
| > best_bid_amount | integer | true | [DEPRECATED] The best calculated bid amount from the underlying settlement venue of the Strategy. |
| > best_bid_amount_decimal | string | true | The best calculated bid amount from the underlying settlement venue of the Strategy. |
| > best_ask_price | string | true | The best calculated ask price from the underlying settlement venue of the Strategy. |
| > best_ask_amount | integer | true | [DEPRECATED] The best calculated ask amount from the underlying settlement venue of the Strategy. |
| > best_ask_amount_decimal | string | true | The best calculated ask amount from the underlying settlement venue of the Strategy. |
Error Codes
| HTTP Status Code | Code | Error | Message | Meaning |
|---|---|---|---|---|
| 400 | 4002 | UNAVAILABLE_TRADE_ID | Requested a trade_id which is unavailable to you. |
Response messages specifies which key is affected and the valid values. |
FSPD: [GET] /trade_tape
/trade_tape Request example
# You can also use wget
curl -X GET https://api.fs.testnet.paradigm.trade/v1/fs/trade_tape \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.fs.testnet.paradigm.trade'
# GET /v1/fs/trades
method = 'GET'
path = '/v1/fs/trade_tape'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/trade_tape Response example
{
"next":"eyJmaWx0ZXIiOnsiVmVudWUiOiIiLCJLaW5kIjoiIiwiU3RyYXRlZ3lJZCI6IiIsIklkIjoiIiwiTGltaXQiOjJ9LCJ0aW1lIjoxNjU2NDU3NjQ1Mjg5MjEwODg4LCJtYXJrZXIiOnsibWFya2VyIjoiMTY1NjQ1NzIwMDU1MTgwMTc2MTY2NzY1MDAwMCIsImRpcmVjdGlvbiI6MH0sImluaXRpYWxfbWFya2VyIjoiMTY1NjQ1NzIyMTEwMTgwMTc2MTY2NzY1MDAwMCJ9",
"prev":"None",
"results":[
{
"seq_no":12,
"id":"1656457221101801761667650000",
"strategy_id":"51658041979895813",
"price":"2.70",
"executed_at":1656457221103387533,
"filled_at":1656457257544809070,
"venue":"BYB",
"kind":"FUTURE",
"legs":[
{
"instrument_name":"ETH-30SEP22",
"side":"BUY",
"price":"1162.65",
"amount_decimal":"1",
"amount":1
},
{
"instrument_name":"ETH-30DEC22",
"side":"SELL",
"price":"1165.35",
"amount_decimal":"1",
"amount":1
}
],
"strategy_name":"EF_ETH-30SEP22_ETH-30DEC22",
"side":"SELL",
"quote_currency":"USD",
"mark_price":"-2.57",
"amount_decimal":"1",
"amount":1
},
{
"seq_no":160,
"id":"1656457200551801761667650000",
"strategy_id":"41070993581539338",
"price":"0.80",
"executed_at":1656457200557318781,
"filled_at":1656457223242175155,
"venue":"BYB",
"kind":"FUTURE",
"legs":[
{
"instrument_name":"ETH-PERPETUAL",
"side":"SELL",
"price":"1161.6",
"amount_decimal":"1",
"amount":1
},
{
"instrument_name":"ETH-30SEP22",
"side":"BUY",
"price":"1162.4",
"amount_decimal":"1",
"amount":1
}
],
"strategy_name":"EF_ETH-PERPETUAL_ETH-30SEP22",
"side":"BUY",
"quote_currency":"USD",
"mark_price":"0.78",
"amount_decimal":"1",
"amount":1
}
]
}
A [GET] /trade_tape request allows you to return all Trades executed through Paradigm and successfully settled.
amount_decimaldeprecatesamount. You should useamount_decimal.legs.amount_decimaldeprecatesamount. You should uselegs.amount_decimal.
You must paginate to return the complete results.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | Returns the next paginated page. |
| venue | query | string | false | Venue to return Trades for. Values include DBT, BYB, FTX. |
| kind | query | string | false | Returns Strategies of the specified contract type. Valid values include ANY, FUTURE, SPOT_FUTURE. |
| strategy_id | query | string | false | The unique strategy_id to return trades for. |
| page_size | query | string | false | The number of Trades to return per pagination page. Default is to return all. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| prev | string | true | Previous Cursor string value of the last pagination page. Equal to null if first pagination page response. |
| next | string | true | Cursor string value to use to paginate results. Equal to null if no more pages are available. |
| results | Array of Objects | true | |
| > seq_no | string | true | The sequential number of the trade for the specific Strategy. |
| > id | string | true | The Paradigm created unique identifier of the Trade. |
| > strategy_id | string | true | The Paradigm created unique identifier of the Strategy. |
| > venue | string | true | The underlying venue the Strategy is cleared upon. Valid values include DBT and BYB. |
| > kind | string | true | Strategies of a specific contract type. Valid values include FUTURE. |
| > amount | integer | true | [DEPRECATED] The amount in the clearing_currency of the Strategy the trade was executed at. |
| > amount_decimal | string | true | The amount in the clearing_currency of the Strategy the trade was executed at. |
| > price | number | true | The price in the quote_currency of the Strategy the trade was executed at. |
| > strategy_name | string | true | A Paradigm created description of the composite instruments making up the Strategy. |
| > quote_currency | string | true | The currency the Strategy is priced in. Valid values include USD. |
| > executed_at | integer | true | The timestamp in unix nanoseconds since the epoch when the trade was executed on Paradigm. |
| > filled_at | integer | true | The timestamp in unix nanoseconds since the epoch when the trade was filled on Paradigm. -1 if the trade is not FILLED. |
| > side | string | true | The side the Strategy was executed. This is always from the Taker's perspective. Valid values include BUY and SELL. |
| > mark_price | string | true | The Strategy's underlying venue mark price in the quote_currency of the Strategy. |
| > legs | array of objects | true | |
| >> instrument_name | string | true | The name of the Instrument, normalized by Paradigm, to be used with Paradigm’s API. |
| >> amount | integer | true | [DEPRECATED] The amount of the Instrument traded in the clearing_currency of the Instrument. |
| >> amount_decimal | string | true | The amount of the Instrument traded in the clearing_currency of the Instrument. |
| >> price | string | true | The price of the Instrument traded in the quote_currency of the Instrument. |
| >> side | string | true | The side this Instrument is traded. This is always from the Taker's perspective. Valid values include BUY and SELL. |
| >> mark_iv | string | false | The implied volatility of the Instrument at the time of execution. Omitted if unavailable. |
Error Codes
| HTTP Status Code | Code | Error | Message | Meaning |
|---|---|---|---|---|
| 400 | 4000 | INVALID_REQUEST_PARAMETER | Specific parameter field and valid values. | Response messages specifies which key is affected and the valid values. |
FSPD: [GET] /system/time
/system/time Request example
# You can also use wget
curl -X GET https://api.fs.testnet.paradigm.trade/v1/fs/system/time \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.fs.testnet.paradigm.trade'
# GET /v1/fs/system/time
method = 'GET'
path = '/v1/fs/system/time'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/system/time Response example
{
"paradigm_server_time": 1629860313961605584
}
A [GET] /system/time request allows the user to return Paradigm's Server's clock time.
This endpoint takes no parameters as part of the request.
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| paradigm_server_time | integer | true | The time in unix nanoseconds since the epoch of Paradigm’s system. |
FSPD: [GET] /platform_state
/platform_state Request example
# You can also use wget
curl -X GET https://api.fs.testnet.paradigm.trade/v1/fs/platform_state \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.fs.testnet.paradigm.trade'
# GET /v1/fs/platform_state
method = 'GET'
path = '/v1/fs/platform_state'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/platform_state Response example
{
"message_kind":"MARKET_AVAILABILITY",
"platform_state":"AVAILABLE",
"published_at":1652323645414245580,
"next_platform_state":"UNAVAILABLE",
"next_platform_state_at":1653949623000000000
}
A [GET] /platform_state request allows the user to return the present market availability state of FSPD.
The Product and Account Management team will communicate expectations around market availability including the next_platform_state and the timing by the next_platform_state_at response key.
The platform_state will always transition in the following order: AVAILABLE -> UNAVAILABLE -> AVAILABLE_CANCEL_ONLY -> AVAILABLE.
Markets can only be in three market availability states:
AVAILABLE- Normal Trading with no restrictions.UNAVAILABLE- No [POST]/orders, [POST]/orders/{order_id}/replace, [DELETE]/orders, and [DELETE]/orders/{order_id}requests are allowed. All [GET] requests are allowed. Markets are locked and no trading is able to occur.AVAILABLE_CANCEL_ONLY- Only [DELETE]/ordersand [DELETE]/orders/{order_id}requests are allowed. All [GET] requests are allowed. Markets are locked and no trading is able to occur.
This endpoint takes no parameters as part of the request.
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| message_kind | string | true | The kind of message on the channel. Valid values include MARKET_AVAILABILITY. |
| platform_state | string | true | The state of the market. Valid values include AVAILABLE, UNAVAILABLE, AVAILABLE_CANCEL_ONLY. |
| published_at | integer | true | Time of update in unix nanoseconds since the epoch. |
| next_platform_state | string | true | The next expected platform_state. Valid values include AVAILABLE, UNAVAILABLE, AVAILABLE_CANCEL_ONLY. |
| next_platform_state_at | integer | true | Expected time of the next platform_state update in unix nanoseconds since the epoch. |
FSPD - WebSocket Notification Channels
FSPD: strategy_state.{venue}.{kind}
An example when a Strategy is created
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"strategy_state.ALL.ALL",
"data":{
"id":"56354195611058187",
"name":"SA/FS_SOLUSD_SOL-PERPETUAL",
"venue":"FTX",
"created_at":1656095318119886765,
"expires_at":-1,
"kind":"SPOT_FUTURE",
"state":"ACTIVE",
"clearing_currency":"SOL",
"quote_currency":"USD",
"settlement_currency":"USD",
"min_tick_size":"0.0025",
"last_updated":1656387233522526694,
"legs":[
{
"instrument_id":"56354194419875848",
"instrument_name":"SOLUSD",
"side":"SELL",
"ratio":"-1.0",
"kind":"SPOT",
"base_currency":"SOL",
"quote_currency":"USD",
"clearing_currency":"SOL",
"settlement_currency":"USD",
"min_tick_size":"0.0025",
"state":"ACTIVE",
"expires_at":-1,
"created_at":1656095318120586461,
"product_code":"SA",
"contract_size":1,
"venue_instrument_name":"SOL/USD",
"min_order_size_decimal":"0.01",
"min_block_size_decimal":"0.01",
"margin_type":"LINEAR",
"min_order_size":0,
"min_block_size":0
},
{
"instrument_id":"56354194419875846",
"instrument_name":"SOL-PERPETUAL",
"side":"BUY",
"ratio":"1.0",
"kind":"FUTURE",
"base_currency":"SOL",
"quote_currency":"USD",
"clearing_currency":"SOL",
"settlement_currency":"USD",
"min_tick_size":"0.0025",
"state":"ACTIVE",
"expires_at":-1,
"created_at":1656095318121345589,
"product_code":"FS",
"contract_size":1,
"venue_instrument_name":"SOL-PERP",
"min_order_size_decimal":"0.01",
"min_block_size_decimal":"0.01",
"margin_type":"LINEAR",
"min_order_size":0,
"min_block_size":0
}
],
"min_order_size_decimal":"0.01",
"min_block_size_decimal":"0.01",
"margin_type":"LINEAR",
"base_currency":"SOL",
"min_order_size":0,
"min_block_size":0
}
}
}
An example when a Strategy is settled by the underlying venue at expiration
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"strategy_state.ALL.ALL",
"data":{
"id":"56354195611058186",
"name":"SA/FS_SOLUSD_SOL-30SEP22",
"venue":"FTX",
"created_at":1656095318161548455,
"expires_at":1664506800000000000,
"kind":"SPOT_FUTURE",
"state":"SETTLED",
"clearing_currency":"SOL",
"quote_currency":"USD",
"settlement_currency":"USD",
"min_tick_size":"0.0025",
"last_updated":1656387233542514800,
"legs":[
{
"instrument_id":"56354194419875848",
"instrument_name":"SOLUSD",
"side":"SELL",
"ratio":"-1.0",
"kind":"SPOT",
"base_currency":"SOL",
"quote_currency":"USD",
"clearing_currency":"SOL",
"settlement_currency":"USD",
"min_tick_size":"0.0025",
"state":"ACTIVE",
"expires_at":-1,
"created_at":1656095318233465522,
"product_code":"SA",
"contract_size":1,
"venue_instrument_name":"SOL/USD",
"min_order_size_decimal":"0.01",
"min_block_size_decimal":"0.01",
"margin_type":"LINEAR",
"min_order_size":0,
"min_block_size":0
},
{
"instrument_id":"56354194419875847",
"instrument_name":"SOL-30SEP22",
"side":"BUY",
"ratio":"1.0",
"kind":"FUTURE",
"base_currency":"SOL",
"quote_currency":"USD",
"clearing_currency":"SOL",
"settlement_currency":"USD",
"min_tick_size":"0.0025",
"state":"SETTLED",
"expires_at":1664506800000000000,
"created_at":1656095318234210349,
"product_code":"FS",
"contract_size":1,
"venue_instrument_name":"SOL-0930",
"min_order_size_decimal":"0.01",
"min_block_size_decimal":"0.01",
"margin_type":"LINEAR",
"min_order_size":0,
"min_block_size":0
}
],
"min_order_size_decimal":"0.01",
"min_block_size_decimal":"0.01",
"margin_type":"LINEAR",
"base_currency":"SOL",
"min_order_size":0,
"min_block_size":0
}
}
}
An example when a Strategy is expired by Paradigm
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"strategy_state.ALL.ALL",
"data":{
"id":"56354195611058186",
"name":"SA/FS_SOLUSD_SOL-30SEP22",
"venue":"FTX",
"created_at":1656095318161548455,
"expires_at":1664506800000000000,
"kind":"SPOT_FUTURE",
"state":"EXPIRED",
"clearing_currency":"SOL",
"quote_currency":"USD",
"settlement_currency":"USD",
"min_tick_size":"0.0025",
"last_updated":1656387233542514800,
"legs":[
{
"instrument_id":"56354194419875848",
"instrument_name":"SOLUSD",
"side":"SELL",
"ratio":"-1.0",
"kind":"SPOT",
"base_currency":"SOL",
"quote_currency":"USD",
"clearing_currency":"SOL",
"settlement_currency":"USD",
"min_tick_size":"0.0025",
"state":"ACTIVE",
"expires_at":-1,
"created_at":1656095318233465522,
"product_code":"SA",
"contract_size":1,
"venue_instrument_name":"SOL/USD",
"min_order_size_decimal":"0.01",
"min_block_size_decimal":"0.01",
"margin_type":"LINEAR",
"min_order_size":0,
"min_block_size":0
},
{
"instrument_id":"56354194419875847",
"instrument_name":"SOL-30SEP22",
"side":"BUY",
"ratio":"1.0",
"kind":"FUTURE",
"base_currency":"SOL",
"quote_currency":"USD",
"clearing_currency":"SOL",
"settlement_currency":"USD",
"min_tick_size":"0.0025",
"state":"EXPIRED",
"expires_at":1664506800000000000,
"created_at":1656095318234210349,
"product_code":"FS",
"contract_size":1,
"venue_instrument_name":"SOL-0930",
"min_order_size_decimal":"0.01",
"min_block_size_decimal":"0.01",
"margin_type":"LINEAR",
"min_order_size":0,
"min_block_size":0
}
],
"min_order_size_decimal":"0.01",
"min_block_size_decimal":"0.01",
"margin_type":"LINEAR",
"base_currency":"SOL",
"min_order_size":0,
"min_block_size":0
}
}
}
All updates relating to Strategies are sent through the strategy_state.{venue}.{kind} WebSocket Notifications channel.
This is a public channel and consumable by all.
Updates received through the strategy_state.{venue}.{kind} WebSocket Notification channel can include Strategy creations, settlements and expirations.
Strategies are considered SETTLED when the underlying Instruments reach expiration and are settled by the underlying venue. Strategies are considered EXPIRED when Paradigm chooses to remove the Strategy from Paradigm.
- The response key
min_order_size_decimaldeprecatesmin_order_size. You should usemin_order_size_decimal. - The response key
min_block_size_decimaldeprecatesmin_block_size. You should usemin_block_size_decimal.
Parameters
| Member | Type | Required | Enums | Description |
|---|---|---|---|---|
| venue | string | true | ALL, DBT, BYB, FTX |
Venue the underlying instruments of the Strategy are cleared upon. ALL returns all. |
| kind | string | true | ALL, FUTURE, SPOT_FUTURE |
Type of Strategy. ALL returns all. |
Response Schema
| Member | Type | Required | Description |
|---|---|---|---|
| method | string | true | Value will always be subscription to indicate message type. |
| channel | string | true | Channel the message was delivered upon. |
| data | object | true | Object of information relating to the message received. |
| > id | string | true | The Paradigm created unique Strategy Identifier. |
| > venue | string | true | The clearing venue of the Strategy. Valid values include DBT, BYB, FTX. |
| > name | string | true | A Paradigm created description of the composite Instruments in the Strategy. |
| > state | string | true | Returns Strategies which are available to trade, settled or expired. Valid values include ACTIVE, SETTLED, EXPIRED. |
| > kind | string | true | Returns the type of Strategy. Valid values include FUTURE, SPOT_FUTURE. |
| > base_currency | string | true | Currency instrument is based in. Valid values include BTC, ETH, SOL, AVAX. |
| > clearing_currency | string | true | The currency the Strategy order size is submitted to the underlying venue in. Valid values include USD. |
| > quote_currency | string | true | The currency the Strategy is priced in. Valid values include USD. |
| > settlement_currency | string | true | Currency Strategy is settled in. Valid values include BTC, ETH, SOL, AVAX, USD. |
| > min_order_size | integer | true | [DEPRECATED] The minimum order size increment the Strategy can be traded in, in the clearing_currency of the Strategy. |
| > min_tick_size | string | true | Minimum price increment the instrument can be priced in denominated in the quote_currency of the Strategy. |
| > min_block_size | integer | true | [DEPRECATED] Minimum block / order size of the instrument, denominated in the clearing_currency of the Strategy. |
| > min_order_size_decimal | string | true | The minimum order size increment the Strategy can be traded in the clearing_currency of the Strategy. |
| > min_block_size_decimal | string | true | Minimum block / order size of the instrument, denominated in the clearing_currency of the Strategy. |
| > created_at | integer | true | The time in unix nanoseconds since the epoch when the Strategy was created. |
| > expires_at | integer | true | The time in unix nanoseconds since the epoch when the Strategy will expire. |
| > last_updated | integer | true | The time in unix nanoseconds since the epoch when the Strategy was last updated. |
| > margin_type | string | true | How the contract is margined. Valid values include LINEAR, INVERSE. |
| > legs | array of objects | true | |
| >> instrument_id | string | true | The Paradigm created unique identifier of the Instrument. |
| >> instrument_name | string | true | The name of the Instrument, normalized by Paradigm, to be used with Paradigm’s API. |
| >> venue_instrument_name | string | true | The name of the Instrument as it is returned by the underlying venue. |
| >> kind | string | true | The kind of Instrument. Valid values include FUTURE. |
| >> base_currency | string | true | Currency instrument is based in. Valid values include BTC, ETH, SOL, AVAX. |
| >> clearing_currency | string | true | The currency the Strategy order size is submitted to the underlying venue in. Valid values include USD, BTC, ETH, SOL, AVAX. |
| >> quote_currency | string | true | The currency the Strategy is priced in. Valid values include USD. |
| >> settlement_currency | string | true | Currency Strategy is settled in. Valid values include BTC, ETH, SOL, AVAX, USD. |
| >> min_order_size | integer | true | [DEPRECATED] The minimum allowed order size increment allowed for the Instrument in the clearing_currency of the Instrument. |
| >> min_tick_size | string | true | Minimum price increment the instrument can be priced in denominated in the quote_currency of the Instrument. |
| >> min_block_size | number | true | [DEPRECATED] Minimum block / order size of the instrument, denominated in the clearing_currency of the Strategy. |
| >> min_order_size_decimal | string | true | The minimum order size increment the Strategy can be traded in the clearing_currency of the Strategy. |
| >> min_block_size_decimal | string | true | Minimum block / order size of the instrument, denominated in the clearing_currency of the Strategy. |
| >> margin_type | string | true | How the contract is margined. Valid values include LINEAR, INVERSE. |
| >> state | string | true | State of the Instrument. Values include ACTIVE, SETTLED, EXPIRED. |
| >> expires_at | integer | true | The time in unix nanoseconds since the epoch when the instrument is will expire. -1 if the Instrument does not expire. |
| >> created_at | integer | true | The time in unix nanoseconds since the epoch when the Instrument was created by the underlying venue. |
| >> ratio | string | true | The multiple of the lowest quantity leg size. This value can be positive or negative. |
| >> side | string | true | The direction of the leg of the Strategy. Valid Values include BUY and SELL. |
| >> contract_size | integer | true | The multiplier applied to Order amount for the product size in the quote_currency of the Strategy. Example: If a Strategy has a contract_size == 10 and a quote_currency == USD, an Order of amount == 1 will in total notional size == 10 USD. |
| >> product_code | string | true | The Paradigm created product code for the Instrument. |
FSPD: order_book.{strategy_id}.{level}
An example of a delta of an
ADDto the price and size level
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"order_book.ALL.L2",
"data":{
"id":"8955522325741570",
"timestamp":1629860869,
"seq_id":17,
"asks":[
],
"bids":[
{
"action":"ADD",
"price":"2368",
"amount":200000,
"amount_decimal": "200000.4"
}
]
}
}
}
An example of a delta of a
REMOVEto the price and size level
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"order_book.ALL.L2",
"data":{
"id":"8955522325741570",
"timestamp":1629860881,
"seq_id":18,
"asks":[
],
"bids":[
{
"action":"REMOVE",
"price":"2368",
"amount":200000,
"amount_decimal": "200000"
}
]
}
}
}
All updates relating to Strategies' Order Book are sent through the order_book.{strategy_id}.{level} WebSocket Notifications channel.
This is a public channel and consumable by all.
Updates received through the order_book.{strategy_id}.{level} WebSocket Notification channel are the deltas/changes to the Order Book.
The response key amount_decimal deprecates amount. You should use amount_decimal.
Parameters
| Member | Type | Required | Enums | Description |
|---|---|---|---|---|
| strategy_id | string | true | ALL, strategy_id |
Paradigm created unique Strategy Identifier. |
| level | string | true | L2, L3 |
L2 returns updates to price+amount levels. L3 returns updates relating to each individual order within the Order Book. |
Response Schema
| Member | Type | Required | Description |
|---|---|---|---|
| method | string | true | Value will always be subscription to indicate message type. |
| channel | string | true | Channel the message was delivered upon. |
| data | object | true | Array of information relating to the message received. |
| > id | string | true | Paradigm created unique Strategy identifier. |
| > timestamp | integer | true | Time of update in unix nanoseconds since the epoch. |
| > seq_id | integer | true | Unique sequence identifier of the update to the Order Book. This always increments by 1. |
| > asks | array of objects | true | |
| >> action | string | true | Action relating to ask level. Valid values include ADD, REMOVE. |
| >> price | string | true | Price of Order Book level in the quote_currency of the Strategy. |
| >> amount | integer | true | [DEPRECATED] Amount of Order Book level in the clearing_currency of the Strategy. |
| >> amount_decimal | string | true | Amount of Order Book level in the clearing_currency of the Strategy. |
| >> order_id | string | false | Paradigm created unique Order identifier. Populated when level is L3. |
| > bids | array of objects | true | |
| >> action | string | true | Action relating to bid level. Valid values include ADD, REMOVE. |
| >> price | string | true | Price of Order Book level in the quote_currency of the Strategy. |
| >> amount | integer | true | [DEPRECATED] Amount of Order Book level in the clearing_currency of the Strategy. |
| >> amount_decimal | string | true | Amount of Order Book level in the clearing_currency of the Strategy. |
| >> order_id | string | false | Paradigm created unique Order identifier. Populated when level is L3. |
FSPD: orders.{venue}.{kind}.{strategy_id}
An example when a
LIMITorder is created
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"orders.ALL.ALL.ALL",
"data":{
"id":"1629860869421801761622800000",
"strategy_id":"8955522325741570",
"state":"OPEN",
"side":"BUY",
"type":"LIMIT",
"time_in_force":"GOOD_TILL_CANCELED",
"created_at":1629860869420188044,
"venue":"DBT",
"amount":200000,
"amount_decimal": "200000",
"price":"2368",
"label":"settle",
"pending_fill_amount":0,
"filled_amount":0,
"canceled_amount":0,
"pending_fill_amount_decimal": "0",
"filled_amount_decimal": "0",
"canceled_amount_decimal": "0",
"account_name":"fake",
"post_only": false,
"events":[
{
"datetime":1629860869455194492,
"state":"OPENED",
"description":"Order added to orderbook"
}
]
}
}
}
An example when a
LIMITorder crosses and is awaiting clearing & settlement
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"orders.ALL.ALL.ALL",
"data":{
"id":"1629861196291801761622800000",
"strategy_id":"8955522325741570",
"state":"CLOSED",
"side":"BUY",
"type":"LIMIT",
"time_in_force":"GOOD_TILL_CANCELED",
"created_at":1629861196297619836,
"venue":"DBT",
"amount":300000,
"amount_decimal": "300000",
"price":"2370",
"label":"settle",
"pending_fill_amount":300000,
"filled_amount":0,
"canceled_amount":0,
"pending_fill_amount_decimal": "300000",
"filled_amount_decimal": "0",
"canceled_amount_decimal": "0",
"account_name":"fake",
"post_only": false,
"events":[
{
"datetime":1629861196310561775,
"state":"PENDING_FILL",
"description":"300000 quantity is pending_fill"
}
]
}
}
}
An example when a
LIMITorder is filled
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"orders.ALL.ALL.ALL",
"data":{
"id":"1629861196291801761622800000",
"strategy_id":"8955522325741570",
"state":"CLOSED",
"side":"BUY",
"type":"LIMIT",
"time_in_force":"GOOD_TILL_CANCELED",
"created_at":1629861196297619836,
"venue":"DBT",
"amount":300000,
"amount_decimal": "300000",
"price":"2370",
"label":"settle",
"pending_fill_amount":0,
"filled_amount":300000,
"canceled_amount":0,
"pending_fill_amount_decimal": "0",
"filled_amount_decimal": "300000",
"canceled_amount_decimal": "0",
"account_name":"fake",
"post_only": false,
"events":[
{
"datetime":1629861196310561775,
"state":"PENDING_FILL",
"description":"300000 quantity is pending_fill"
},
{
"datetime":1629861196344422931,
"state":"FILLED",
"description":"300000 quantity is filled"
}
]
}
}
}
An example when an order is canceled
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"orders.ALL.ALL.ALL",
"data":{
"id":"1629860881381801761622800000",
"strategy_id":"8955522325741570",
"state":"CLOSED",
"side":"SELL",
"type":"LIMIT",
"time_in_force":"GOOD_TILL_CANCELED",
"created_at":1629860881389254427,
"venue":"DBT",
"amount":200000,
"amount_decimal": "200000",
"price":"29",
"label":"settle",
"pending_fill_amount":0,
"filled_amount":0,
"canceled_amount":200000,
"pending_fill_amount_decimal": "0",
"filled_amount_decimal": "0",
"canceled_amount_decimal": "200000",
"account_name":"fake",
"post_only": false,
"events":[
{
"datetime":1629860881406107280,
"state":"CANCELED",
"description":"Canceled by User"
}
]
}
}
}
All updates relating to User's Orders are sent through the orders.{venue}.{kind}.{strategy_id} WebSocket Notifications channel.
This is a private channel and consumable solely by the authenticated user.
Updates received through the orders.{venue}.{kind}.{strategy_id} WebSocket Notification channel can include Order creation, partial fills, complete fills and cancellation.
When an Order reaches state == CLOSED it has reached finality and can no longer be acted upon by the creator or another user.
Response Schema keys amount_decimal, pending_fill_amount_decimal, filled_amount_decimal, and canceled_amount_decimal illustrate the present value at risk of the Order. The keys pending_fill_amount_decimal, filled_amount_decimal, and canceled_amount_decimal will always sum to equal amount_decimal.
amount_decimaldeprecatesamount. You should useamount_decimal.pending_fill_amount_decimaldeprecatespending_fill_amount. You should usepending_fill_amount_decimal.filled_amount_decimaldeprecatesfilled_amount. You should usefilled_amount_decimal.canceled_amount_decimaldeprecatescanceled_amount. You should usecanceled_amount_decimal.
Parameters
| Member | Type | Required | Enums | Description |
|---|---|---|---|---|
| venue | string | true | ALL, DBT, BYB, FTX |
Venue the Strategy is cleared & settled upon. ALL returns all. |
| kind | string | true | ALL, FUTURE, SPOT_FUTURE |
Instrument kind. ALL returns all. |
| strategy_id | string | true | ALL, strategy_id |
Paradigm created unique Strategy identifier. ALL returns all. |
Response Schema
| Member | Type | Required | Description |
|---|---|---|---|
| method | string | true | Value will always be subscription to indicate message type. |
| channel | string | true | Channel the message was delivered upon. |
| data | object | true | Object of information relating to the message received. |
| > id | string | true | The Paradigm created unique Order identifier. |
| > strategy_id | string | true | The Paradigm created unique identifier of the Strategy. |
| > state | string | true | The state of the Order. Valid values include OPEN, CLOSED. |
| > side | string | true | The side the strategy was executed. Valid values include BUY and SELL. |
| > type | string | true | The type of order. Valid values include LIMIT and MARKET. |
| > time_in_force | string | true | The validity protocol the order. Valid values include GOOD_TILL_CANCELED, IMMEDIATE_OR_CANCEL. |
| > created_at | number | true | The time in unix nanoseconds since the epoch when the Order was created. |
| > venue | string | true | The underlying venue the Strategy is cleared upon. Valid values include DBT, BYB, FTX. |
| > amount | integer | true | [DEPRECATED] The size of the Order in the clearing_currency of the Strategy. |
| > amount_decimal | string | true | The size of the Order in the clearing_currency of the Strategy. |
| > price | string | true | The price of the order in the quote_currency of the Strategy. Empty string if the order was a MARKET order type. |
| > label | string | true | The user created label for the Order. |
| > pending_fill_amount | integer | true | [DEPRECATED] The amount of the order pending clearing in the clearing_currency of the Strategy. |
| > pending_fill_amount_decimal | string | true | The amount of the order pending clearing in the clearing_currency of the Strategy. |
| > filled_amount | integer | true | [DEPRECATED] The amount of the order filled in the clearing_currency of the Strategy. |
| > filled_amount_decimal | string | true | The amount of the order filled in the clearing_currency of the Strategy. |
| > canceled_amount | integer | true | [DEPRECATED] The amount of the order canceled due to falling below the min_block_size of the Strategy after execution. Only affects Orders when venue == DBT. |
| > canceled_amount_decimal | string | true | The amount of the order canceled due to falling below the min_block_size of the Strategy after execution. Only affects Orders when venue == DBT. |
| > account_name | string | true | The name of the users’s underlying venue’s API Key on your Paradigm Client Admin Dashboard used to submit the order. |
| > post_only | boolean | true | If the order was flagged post_only or not. |
| > events | array of objects | true | |
| >> datetime | integer | true | The time in unix nanoseconds since the epoch when the event occurred. |
| >> state | string | true | Status of what happened during the event. Valid values include OPENED, PENDING_FILL, FILLED, CANCELED, EXPIRED. |
| >> reason | string | false | A code for the reason of the event state. Only available for CANCELED events. Valid values include SAME_DESK_MATCH, NO_MATCH, REMAINDER_AMOUNT_BELOW_MINIMUM, AMOUNT_BELOW_MINIMUM, EXPIRED_STRATEGY, VENUE_REJECTION, WEBSOCKET_DISCONNECT, USER_REQUEST, REPLACE, MARKET_MAKER_PROTECTION |
| >> description | string | true | Brief description of what happened in the event. |
FSPD: trades.{venue}.{kind}.{strategy_id}
An example when a Trade is
FILLED
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"trades.ALL.ALL.ALL",
"data":{
"seq_no":116,
"id":"1654190654111801761608060000",
"exec_id":"251621",
"order_id":"1653534454231801761611110000",
"strategy_id":"51217492537901066",
"venue":"DBT",
"kind":"FUTURE",
"state":"FILLED",
"role":"MAKER",
"executed_at":1654190654113783430,
"filled_at":1654190655080786015,
"side":"BUY",
"price":"35.00",
"legs":[
{
"instrument_name":"BTC-3JUN22",
"side":"SELL",
"price":"30647.53",
"fee_amount":"0.00032629",
"index_price":"30235.08",
"venue_trade_id":"107753909",
"mark_price":"30231.82",
"best_bid_price":"30230.5",
"best_ask_price":"30236",
"max_venue_price":"30687",
"min_venue_price":"29779.5",
"amount_decimal":"100000",
"best_bid_amount_decimal":"1370",
"best_ask_amount_decimal":"20",
"amount":100000,
"best_bid_amount":1370,
"best_ask_amount":20
},
{
"instrument_name":"BTC-31MAR23",
"side":"BUY",
"price":"30682.53",
"fee_amount":"0.0008148",
"index_price":"30235.08",
"venue_trade_id":"107753908",
"mark_price":"31097.99",
"best_bid_price":"31100",
"best_ask_price":"31102.5",
"max_venue_price":"31563",
"min_venue_price":"30630",
"amount_decimal":"100000",
"best_bid_amount_decimal":"2930",
"best_ask_amount_decimal":"20",
"amount":100000,
"best_bid_amount":2930,
"best_ask_amount":20
}
],
"strategy_name":"CF_BTC-3JUN22_BTC-31MAR23",
"quote_currency":"USD",
"mark_price":"-866.17",
"settlement_status":"Cleared by Deribit",
"amount_decimal":"100000",
"amount":100000
}
}
}
An example when a Trade is
REJECTED
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"trades.ALL.ALL.ALL",
"data":{
"seq_no":116,
"id":"1654190654111801761608060000",
"exec_id":"-1",
"order_id":"1653534454231801761611110000",
"strategy_id":"51217492537901066",
"venue":"DBT",
"kind":"FUTURE",
"state":"REJECTED",
"reject_party":"COUNTERPARTY",
"reject_reason":"Counterparty responsible for Trade Rejection.",
"role":"TAKER",
"executed_at":1642542811994589574,
"filled_at":-1,
"side":"BUY",
"price":"35.00",
"legs":[
{
"instrument_name":"BTC-3JUN22",
"side":"SELL",
"price":"30647.53",
"fee_amount":"0.00032629",
"index_price":"30235.08",
"mark_price":"30231.82",
"best_bid_price":"30230.5",
"best_ask_price":"30236",
"max_venue_price":"30687",
"min_venue_price":"29779.5",
"amount_decimal":"100000",
"best_bid_amount_decimal":"1370",
"best_ask_amount_decimal":"20",
"amount":100000,
"best_bid_amount":1370,
"best_ask_amount":20
},
{
"instrument_name":"BTC-31MAR23",
"side":"BUY",
"price":"30682.53",
"fee_amount":"0.0008148",
"index_price":"30235.08",
"mark_price":"31097.99",
"best_bid_price":"31100",
"best_ask_price":"31102.5",
"max_venue_price":"31563",
"min_venue_price":"30630",
"amount_decimal":"100000",
"best_bid_amount_decimal":"2930",
"best_ask_amount_decimal":"20",
"amount":100000,
"best_bid_amount":2930,
"best_ask_amount":20
}
],
"strategy_name":"CF_BTC-3JUN22_BTC-31MAR23",
"quote_currency":"USD",
"mark_price":"-866.17",
"settlement_status":"Cleared by Deribit",
"amount_decimal":"100000",
"amount":100000
}
}
}
All updates relating to User's Trades are sent through the trades.{venue}.{kind}.{strategy_id} WebSocket Notifications channel.
This is a private channel and consumable solely by the authenticated user.
Updates received through the trades.{venue}.{kind}.{strategy_id} WebSocket Notification channel can include Trades being FILLED or REJECTED.
You may receive multiple notifications if an Order of yours interacts with more than one other Order.
amount_decimaldeprecatesamount. You should useamount_decimal.legs.amount_decimaldeprecateslegs.amount. You should uselegs.amount_decimal.legs.best_bid_amount_decimaldeprecateslegs.best_bid_amount. You should uselegs.best_bid_amount_decimal.legs.best_ask_amount_decimaldeprecateslegs.best_ask_amount. You should uselegs.best_ask_amount_decimal.
Parameters
| Member | Type | Required | Enums | Description |
|---|---|---|---|---|
| venue | string | true | ALL, DBT, BYB, FTX |
The venue the Strategy is cleared upon. ALL returns all. |
| kind | string | true | ALL, FUTURE, SPOT_FUTURE |
Strategy Instrument composite contract type. ALL returns all. |
| strategy_id | string | true | ALL, strategy_id |
Paradigm created unique Strategy Identifier. ALL returns all. |
Response Schema
| Member | Type | Required | Description |
|---|---|---|---|
| method | string | true | Value will always be subscription to indicate message type. |
| channel | string | true | Channel the message was delivered upon. |
| data | object | true | Object of information relating to the message received. |
| > seq_no | integer | true | The sequential number of the trade for the specific Strategy. |
| > id | string | true | The Paradigm created unique identifier of the Trade. |
| > exec_id | string | true | The corresponding trade_id present upon the underlying venue of the Strategy. "-1" if trade is not FILLED. |
| > order_id | string | true | The Paradigm created unique identifier of the order associated with the trade. |
| > state | string | true | The state of the trade. Valid values include FILLED and REJECTED. |
| > reject_party | string | false | Party responsible for the failure of clearing. Valid values include USER or COUNTERPARTY. Omitted if trade is not FILLED. |
| > reject_reason | string | false | Rejection reason for failure of clearing. Omitted if trade is not FILLED. |
| > role | string | true | The role of the user in the trade. Valid values include TAKER and MAKER. |
| > executed_at | integer | true | The timestamp in unix nanoseconds since the epoch when the trade was executed on Paradigm. |
| > filled_at | integer | true | The timestamp in unix nanoseconds since the epoch when the trade was filled on Paradigm. -1 if the trade is not FILLED. |
| > strategy_id | string | true | The Paradigm created unique identifier of the Strategy. |
| > side | string | true | The side the Strategy was executed. Valid values include BUY and SELL. |
| > venue | string | true | The underlying venue the Strategy is cleared upon. Valid values include DBT, BYB, FTX. |
| > price | string | true | The price in the quote_currency of the Strategy the trade was executed at. |
| > amount | integer | true | [DEPRECATED] The amount in the clearing_currency of the Strategy the trade was executed at. |
| > amount_decimal | string | true | The amount in the clearing_currency of the Strategy the trade was executed at. |
| > strategy_name | string | true | A Paradigm created description of the composite Instruments making up the Strategy. |
| > quote_currency | string | true | The currency the Strategy is priced. Valid values include USD. |
| > mark_price | string | true | The Strategy's composite venue mark price calculated from the individual legs at time of execution. |
| > settlement_status | string | false | And informative string containing the settlement status. E.g.: "Cleared by Deribit". Omitted if trade is not FILLED. |
| > legs | array of objects | true | |
| >> instrument_name | string | true | The name of the Instrument, normalized by Paradigm, to be used with Paradigm’s API. |
| >> amount | integer | true | [DEPRECATED] The amount of the Instrument traded in the clearing_currency of the Instrument. |
| >> amount_decimal | string | true | The amount of the Instrument traded in the clearing_currency of the Instrument. |
| >> price | string | true | The price of the Instrument traded in the quote_currency of the Instrument. |
| >> side | string | true | The side this Instrument is traded. Valid values include BUY and SELL. |
| >> fee_amount | string | false | The amount of fees paid for this leg of the trade in the base_currency of the Strategy. Omitted if trade is not FILLED. |
| >> venue_trade_id | string | false | The corresponding unique trade identifier available upon the underlying venue. Omitted if the trade is not FILLED. |
| >> index_price | string | false | The index price of the Instrument at the time of execution. Omitted if the trade is not FILLED. |
| >> mark_iv | string | false | The implied volatility of the Instrument at the time of execution. Omitted if unavailable. |
| >> mark_price | string | true | The calculated Mark Price of the Instrument from the underlying settlement venue. |
| >> min_venue_price | string | true | The minimum price a Strategy can be traded at. |
| >> max_venue_price | string | true | The maximum price a Strategy can be traded at. |
| >> best_bid_price | string | true | The best calculated bid price from the underlying settlement venue of the Strategy. |
| >> best_bid_amount | integer | true | [DEPRECATED] The best calculated bid amount from the underlying settlement venue of the Strategy. |
| >> best_bid_amount_decimal | string | true | The best calculated bid amount from the underlying settlement venue of the Strategy. |
| >> best_ask_price | string | true | The best calculated ask price from the underlying settlement venue of the Strategy. |
| >> best_ask_amount | integer | true | [DEPRECATED] The best calculated ask amount from the underlying settlement venue of the Strategy. |
| >> best_ask_amount_decimal | string | true | The best calculated ask amount from the underlying settlement venue of the Strategy. |
FSPD: trade_tape.{venue}.{kind}.{strategy_id}
An example when a Strategy trades on Paradigm
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"trade_tape.ALL.ALL.ALL",
"data":{
"seq_no":4,
"id":"1642473035901801761666720000",
"strategy_id":"31938544255631362",
"price":"24",
"amount":100000,
"executed_at":1642473035909964678,
"filled_at":1642473038485887301,
"venue":"DBT",
"kind":"FUTURE",
"legs":[
{
"instrument_name":"BTC-PERPETUAL",
"side":"BUY",
"amount":100000,
"price":"42191.77"
},
{
"instrument_name":"BTC-21JAN22",
"side":"SELL",
"amount":100000,
"price":"42215.77"
}
],
"strategy_name":"CF_BTC-PERPETUAL_BTC-21JAN22",
"side":"SELL",
"quote_currency":"USD",
"mark_price":"-43.86"
}
}
}
All updates relating to all Trades on Paradigm are sent through the trade_tape.{venue}.{kind}.{strategy_id} WebSocket Notifications channel.
This is a public channel and consumable by all.
amount_decimaldeprecatesamount. You should useamount_decimal.legs.amount_decimaldeprecatesamount. You should uselegs.amount_decimal.
Parameters
| Member | Type | Required | Enums | Description |
|---|---|---|---|---|
| venue | string | true | ALL, DBT, BYB, FTX |
The clearing venue of the Strategy. ALL returns all venues. |
| kind | string | true | ALL, FUTURE, SPOT_FUTURE |
Strategy instrument composite contract type. ALL returns all. |
| strategy_id | string | true | ALL, strategy_id |
Paradigm created unique Strategy identifier. ALL returns all. |
Response Schema
| Member | Type | Required | Description |
|---|---|---|---|
| method | string | true | Value will always be subscription to indicate message type. |
| channel | string | true | Channel the message was delivered upon. |
| data | object | true | Object of information relating to the message received. |
| > seq_no | string | true | The sequential number of the trade for the specific Strategy. |
| > id | string | true | The Paradigm created unique identifier of the Trade. |
| > strategy_id | string | true | The Paradigm created unique identifier of the Strategy. |
| > venue | string | true | The underlying venue the Strategy is cleared upon. Valid values include DBT and BYB. |
| > kind | string | true | Strategies of a specific contract type. Valid values include FUTURE. |
| > amount | integer | true | [DEPRECATED] The amount in the clearing_currency of the Strategy the trade was executed at. |
| > amount_decimal | string | true | The amount in the clearing_currency of the Strategy the trade was executed at. |
| > price | number | true | The price in the quote_currency of the Strategy the trade was executed at. |
| > strategy_name | string | true | A Paradigm created description of the composite instruments making up the Strategy. |
| > quote_currency | string | true | The currency the Strategy is priced in. Valid values include USD. |
| > executed_at | integer | true | The timestamp in unix nanoseconds since the epoch when the trade was executed on Paradigm. |
| > filled_at | integer | true | The timestamp in unix nanoseconds since the epoch when the trade was filled on Paradigm. -1 if the trade is not FILLED. |
| > side | string | true | The side the Strategy was executed. This is always from the Taker's perspective. Valid values include BUY and SELL. |
| > mark_price | string | true | The Strategy's underlying venue mark price in the quote_currency of the Strategy. |
| > legs | array of objects | true | |
| >> instrument_name | string | true | The name of the Instrument, normalized by Paradigm, to be used with Paradigm’s API. |
| >> amount | integer | true | [DEPRECATED] The amount of the Instrument traded in the clearing_currency of the Instrument. |
| >> amount_decimal | string | true | The amount of the Instrument traded in the clearing_currency of the Instrument. |
| >> price | string | true | The price of the Instrument traded in the quote_currency of the Instrument. |
| >> side | string | true | The side this Instrument is traded. This is always from the Taker's perspective. Valid values include BUY and SELL. |
| >> mark_iv | string | false | The implied volatility of the Instrument at the time of execution. Omitted if unavailable. |
FSPD: platform_state
An example when the
platform_state==UNAVAILABLE.
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"platform_state",
"data":{
"message_kind":"MARKET_AVAILABILITY",
"platform_state":"UNAVAILABLE",
"published_at":1652323465888104810,
"next_platform_state":"AVAILABLE_CANCEL_ONLY",
"next_platform_state_at":1652324400000000000
}
}
}
An example when the
platform_state==AVAILABLE_CANCEL_ONLY.
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"platform_state",
"data":{
"message_kind":"MARKET_AVAILABILITY",
"platform_state":"AVAILABLE_CANCEL_ONLY",
"published_at":1652323475415649306,
"next_platform_state":"AVAILABLE",
"next_platform_state_at":1652324400000000000
}
}
}
An example when the
platform_state==AVAILABLE.
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"platform_state",
"data":{
"message_kind":"MARKET_AVAILABILITY",
"platform_state":"AVAILABLE",
"published_at":1652323494426187360,
"next_platform_state":"UNAVAILABLE",
"next_platform_state_at":1653966000000000000
}
}
}
All updates relating to market availability are sent through the platform_state WebSocket Notifications channel.
The Product and Account Management team will communicate expectations around market availability including the next_platform_state and the timing by the next_platform_state_at key.
The platform_state will always transition in the following order: AVAILABLE -> UNAVAILABLE -> AVAILABLE_CANCEL_ONLY -> AVAILABLE.
Markets can only be in three market availability states:
- AVAILABLE - Normal Trading with no restrictions.
- UNAVAILABLE - No [POST] /orders, [POST] /orders/{order_id}/replace, [DELETE] /orders, and [DELETE] /orders/{order_id} requests are allowed. All [GET] requests are allowed. Markets are locked and no trading is able to occur.
- AVAILABLE_CANCEL_ONLY - Only [DELETE] /orders and [DELETE] /orders/{order_id} requests are allowed. All [GET] requests are allowed. Markets are locked and no trading is able to occur.
Response Schema
| Member | Type | Required | Description |
|---|---|---|---|
| method | string | true | Value will always be subscription to indicate message type. |
| channel | string | true | Channel the message was delivered upon. |
| data | object | true | Object of information relating to the message received. |
| > message_kind | string | true | The kind of message on the channel. Valid values include MARKET_AVAILABILITY. |
| > platform_state | string | true | The state of the market. Valid values include AVAILABLE, UNAVAILABLE, AVAILABLE_CANCEL_ONLY. |
| > published_at | int | true | Time of update in unix nanoseconds since the epoch. |
| > next_platform_state | string | true | The next expected platform_state. Valid values include AVAILABLE, UNAVAILABLE, AVAILABLE_CANCEL_ONLY. |
| > next_platform_state_at | int | true | Expected time of the next platform_state update in unix nanoseconds since the epoch. |
FSPD: venue_bbo.{strategy_id}
An example when of an update
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"venue_bbo.ALL",
"data":{
"id":"8955527560167434",
"min_price":"-2.05",
"max_price":"5.45",
"mark_price":"18.67",
"best_bid_amount":128778,
"best_bid_amount_decimal":"128778",
"best_bid_price":"34.75",
"best_ask_amount":53779,
"best_ask_amount_decimal":"53779",
"best_ask_price":"38.15",
"paradigm_best_bid_price":"34.75",
"paradigm_best_bid_amount":"128778",
"paradigm_best_ask_price":"38.15",
"paradigm_best_ask_amount":"53779",
"created_at":1629860358347412064,
"legs":[
{
"name":"ETH-PERPETUAL",
"mark_price":"3214.8"
},
{
"name":"ETH-24SEP21",
"mark_price":"3233.47"
}
]
}
}
}
All updates relating to Strategy screen data from the underlying venues are sent through the venue_bbo.{strategy_id} WebSocket Notifications channel.
This is a public channel and consumable by all.
best_bid_amount_decimaldeprecatesbest_bid_amount. You should usebest_bid_amount_decimal.best_ask_amount_decimaldeprecatesbest_ask_amount. You should usebest_ask_amount_decimal.
Parameters
| Member | Type | Required | Enums | Description |
|---|---|---|---|---|
| strategy_id | string | true | ALL, strategy_id |
Paradigm’s created unique Strategy identifier. |
Response Schema
| Member | Type | Required | Description |
|---|---|---|---|
| method | string | true | Value will always be subscription to indicate message type. |
| channel | string | true | Channel the message was delivered upon. |
| data | object | true | Object of information relating to the message received. |
| > id | string | true | Paradigm created unique identifier of the Strategy. |
| > min_price | string | true | The minimum price, in the quote_currency of the Strategy, the Strategy could be traded at. |
| > max_price | string | true | The maximum price, in the quote_currency of the Strategy, the Strategy could be traded at. |
| > created_at | integer | true | Time in unix nanoseconds since the epoch. |
| > mark_price | string | true | The underlying venue mark price of the Strategy as a result of the composite Instrument mark prices. |
| > best_bid_price | string | true | The best bid price of the Strategy as a result of the instruments' venue Order Books. |
| > best_bid_amount | integer | true | [DEPRECATED] The best bid amount of the Strategy as a result of the instruments' venue Order Books. |
| > best_bid_amount_decimal | string | true | The best bid amount of the Strategy as a result of the instruments' venue Order Books. |
| > best_ask_price | string | true | The best ask price of the Strategy as a result of the instruments' venue Order Books. |
| > best_ask_amount | integer | true | [DEPRECATED] The best ask amount of the Strategy as a result of the instruments' venue Order Books. |
| > best_ask_amount_decimal | string | true | The best ask amount of the Strategy as a result of the instruments' venue Order Books. |
| > paradigm_best_bid_price | string | true | The strategy's best bid price on Paradigm's orderbook. |
| > paradigm_best_bid_amount | string | true | The strategy's best bid amount on Paradigm's orderbook. |
| > paradigm_best_ask_price | string | true | The strategy's best ask price on Paradigm's orderbook. |
| > paradigm_best_ask_amount | string | true | The strategy's best ask amount on Paradigm's orderbook. |
| > legs | array of objects | true | |
| >> name | string | true | The name of the Instrument per Paradigm’s Standardized naming conventions. |
| >> mark_price | string | true | The mark price of the Instrument per the underlying venue’s mark price. |
Defi Auctions
VRFQ - REST Endpoints
VRFQ: [GET] /rfqs/
/rfqs/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/vrfq/rfqs/ \
-H 'Accept: application/json' \
-H 'Paradigm-API-Timestamp: <timestamp>' \
-H 'Paradigm-API-Signature: <signature>' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/vrfq/rfqs/
method = 'GET'
path = '/v1/vrfq/rfqs/'
payload = ''
timestamp, signature = sign_request(
secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(
f"{host}{path}",
headers=headers
)
print(response.status_code)
print(response.text)
{
"count": 2,
"next": null,
"results": [
{
"auction": {
"swap_id": 30,
"seller": "0x...",
"offered_token": "0x...",
"bidding_token": "0x...",
"min_price": "0.000001",
"total_size": "5"
},
"created": 1659332627432.214,
"currency": "USDC",
"description": "Put 13 May 22 2000 0.01x",
"domain": {
"chain_id": 42,
"contract_name": "RIBBON SWAP",
"version": "1",
"verifying_contract": "0x..."
},
"id": 15,
"legs": [
{
"instrument": "DEFI-RBN-ETH-WETH-USDC-13May22-2000-P",
"product_code": "USDC",
"ratio": "1",
"venue_instrument": "DEFI-RBN-ETH-WETH-USDC-13May22-2000-P"
}
],
"min_tick_size": "0.1",
"product_name": "RBN - USDC Option (ETH)",
"quantity": "0.01000000",
"quote_currency": "USDC",
"referrer": "0x...",
"status": "ACTIVE",
"taker": "AAAA",
"venue": "RBN"
},
{
"auction": {
"swap_id": 30,
"seller": "0x...",
"offered_token": "0x...",
"bidding_token": "0x...",
"min_price": "0.000001",
"total_size": "5"
},
"created": 1658999093574.449,
"currency": "USDC",
"description": "Put 13 May 22 2000 0.01x",
"domain": {
"chain_id": 42,
"contract_name": "RIBBON SWAP",
"version": "1",
"verifying_contract": "0x..."
},
"id": 14,
"legs": [
{
"instrument": "DEFI-RBN-ETH-WETH-USDC-13May22-2000-P",
"product_code": "USDC",
"ratio": "1",
"venue_instrument": "DEFI-RBN-ETH-WETH-USDC-13May22-2000-P"
}
],
"min_tick_size": "0.1",
"product_name": "RBN - USDC Option (ETH)",
"quantity": "0.01000000",
"quote_currency": "USDC",
"referrer": "0x...",
"status": "CANCELED",
"taker": "AAAA",
"venue": "RBN"
}
]
}
A [GET] /rfqs/ request allows you to return a paginated list of RFQs.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | Cursor value used to paginate through pages. |
| page_size | query | string | false | Number of RFQs returned per pagination. |
| status | query | string | false | List of status separated by comma. Valid values are: ACTIVE,CANCELED,COMPLETED,EXPIRED. Example /v1/vrfq/rfqs/?status=ACTIVE,COMPLETED. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | int | true | Total number of RFQs to paginate. |
| next | string | true | Pagination cursor value. |
| results | array of objects | true | |
| > auction | object | true | |
| >> swap_id | number | true | The Paradigm created unique identifier of the auction. |
| >> seller | string | true | Wallet address of the seller (the trader who initiates the auction). |
| >> offered_token | string | true | Address of the token offered by the seller, in hex format with 0x prefix. |
| >> bidding_token | string | true | Address of the token used by the buyer to bid for in the auction, in hex format with 0x prefix. |
| >> min_price | string | true | The minimum price the RFQ can be Traded at. |
| >> total_size | string | true | Total amount of contracts (tokens) of offered_token being sold in the auction. |
| > created | number | true | Time in unix milliseconds since the epoch when the RFQ was created. |
| > description | string | true | Paradigm created description of the RFQ. |
| > domain | object | true | |
| >> chain_id | number | true | The Paradigm unique identifier assigned to the blockchain (e.g. Ethereum, Avalanche, Solana). |
| >> contract_name | string | true | Name of the venue's smart contract. |
| >> version | string | true | Version of the venue's smart contract. |
| >> verifying_contract | string | true | Address of the venue smart contract used to settle the transaction, in hex format with 0x prefix. |
| > id | number | true | The Paradigm created unique identifier of the RFQ. |
| > legs | array of objects | true | |
| >> instrument | string | true | The Paradigm standardized name of the Instrument. |
| >> product_code | string | true | The Paradigm created product code of the Instrument. |
| >> ratio | string | true | The quantity multiple relative to other legs. |
| >> venue_instrument | string | true | The name of the Instrument for the underlying venue's naming convention. |
| > min_tick_size | string | true | Minimum tick size specified by the underlying venue's contract. |
| > product_name | string | true | The Paradigm created product name for the Instrument. |
| > quantity | string | true | The size of the trade in the contract units of the RFQ. |
| > referrer | string | true | Address of the Paradigm wallet used to receive the fee, in hex format with 0x prefix. |
| > status | string | true | Status of the RFQ. Valid values include ACTIVE, CANCELED, COMPLETED and EXPIRED |
| > taker | string | true | The Paradigm desk name of the Taker who created the RFQ. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 401 | N/A | "Invalid API Access Key." | You provided an invalid API Access Key. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
VRFQ: [GET] /quotes/
/quotes/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/vrfq/quotes/ \
-H 'Accept: application/json' \
-H 'Paradigm-API-Timestamp: <timestamp>' \
-H 'Paradigm-API-Signature: <signature>' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/vrfq/quotes/
method = 'GET'
path = '/v1/vrfq/quotes/'
payload = ''
timestamp, signature = sign_request(
secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(
f"{host}{path}",
headers=headers
)
print(response.status_code)
print(response.text)
/quotes/ Response example
{
"count": 2,
"next": null,
"results": [
{
"id": 9,
"created": 1659354419040.884,
"maker": "MMMM",
"price": "0.10000000",
"quantity": "0.01000000",
"rfq_id": 15,
"status": "OPEN",
"signed_bid": {
"buy_amount": "1000000",
"nonce": "132729633",
"referrer": "0x...",
"sell_amount": "1000",
"signature": "...",
"signer_wallet": "0x...",
"swap_id": 30
}
},
{
"id": 8,
"created": 1658999051597.919,
"maker": "MMMM",
"price": "0.10000000",
"quantity": "0.01000000",
"rfq_id": 13,
"status": "CLOSED",
"canceled": 1658999076341.906,
"canceled_reason": "RFQ_CANCELED",
"signed_bid": {
"buy_amount": "1000000",
"nonce": "397367878",
"referrer": "0x...",
"sell_amount": "1000",
"signature": "...",
"signer_wallet": "0x...",
"swap_id": 30
}
}
]
}
A [GET] /quotes/ request allows you to return a paginated list of all Quotes belonging to your trading desk.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | Cursor value used to paginate through pages. |
| page_size | query | string | false | Number of Quotes returned per pagination. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | int | true | Total number of Quotes to paginate. |
| next | string | true | Pagination cursor value. |
| results | array of objects | true | |
| > id | number | true | The Paradigm created unique identifier of the Quote. |
| > created | number | true | Time in unix milliseconds since the epoch when the Quote was created. |
| > maker | string | true | The Paradigm desk name of the Maker who created the Quote. |
| > price | string | true | The price of the Quote in the Quote Currency of the RFQ. |
| > quantity | string | true | The requested crossing quantity of the Quote. |
| > rfq_id | number | true | The Paradigm created unique identifier of the RFQ. |
| > status | string | true | Status of the Quote. Valid values include OPEN and CLOSED. |
| > canceled | number | false | The time in unix milliseconds since the epoch when the Quote was canceled. Missing if the Quote has not been canceled. |
| > canceled_reason | string | false | The reason of the Quote cancellation. Valid values are API_CREDENTIAL_DELETED, FAILED_TO_EXECUTE, MAINTENANCE, NOT_ENOUGH_QUANTITY, REMOVED_BY_USER, REPLACED_BY_USER, RFQ_CANCELED, RFQ_COMPLETED, RFQ_EXPIRATION and WEBSOCKET_DISCONNECT. Missing if the Quote has not been canceled. |
| > signed_bid | object | ||
| >> buy_amount | string | true | Total amount of contracts to be purchased by the buyer, typically the same as the total_size. |
| >> nonce | string | true | Arbitrary random or pseudo-random number, to be used just once. |
| >> referrer | string | true | Address of the Paradigm wallet used to receive the fee, in hex format with 0x prefix. |
| >> sell_amount | string | true | Total amount of sold contracts. |
| >> swap_id | number | true | The Paradigm created unique identifier of the auction. |
| >> signer_wallet | string | true | Address of the wallet who signed the message, in hex format with 0x prefix. |
| >> signature | string | true | ECDSA or EdDSA signature. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 401 | N/A | "Invalid API Access Key." | You provided an invalid API Access Key. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
VRFQ: [GET] /quotes/{quote_id}/
/quotes/{quote_id}/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/vrfq/quotes/9/ \
-H 'Accept: application/json' \
-H 'Paradigm-API-Timestamp: <timestamp>' \
-H 'Paradigm-API-Signature: <signature>' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/vrfq/quotes/{quote_id}/
method = 'GET'
path = '/v1/vrfq/quotes/9/'
payload = ''
timestamp, signature = sign_request(
secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(
f"{host}{path}",
headers=headers
)
print(response.status_code)
print(response.text)
/quotes/{quote_id}/ Response example
{
"id": 9,
"created": 1659354419040.884,
"maker": "MMMM",
"price": "0.10000000",
"quantity": "0.01000000",
"rfq_id": 15,
"status": "OPEN",
"signed_bid": {
"buy_amount": "1000000",
"nonce": "132729633",
"referrer": "0x...",
"sell_amount": "1000",
"signature": "...",
"signer_wallet": "0x...",
"swap_id": 30,
}
}
A [GET] /quotes/{quote_id}/ request allows you to return details about the given Quote.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | endpoint | string | true | The Paradigm created unique identifier of the Quote. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| id | number | true | The Paradigm created unique identifier of the Quote. |
| created | number | true | Time in unix milliseconds since the epoch when the Quote was created. |
| maker | string | true | The Paradigm desk name of the Maker. |
| price | string | true | The price of the Quote in the Quote Currency of the RFQ. |
| quantity | string | true | The requested crossing quantity of the Quote. |
| rfq_id | number | true | The Paradigm created unique identifier of the RFQ. |
| status | string | true | Status of the Quote. Valid values include OPEN and CLOSED. |
| canceled | number | false | The time in unix milliseconds since the epoch when the Quote was canceled. Missing if the Quote has not been canceled. |
| canceled_reason | string | false | The reason of the Quote cancellation. Valid values are API_CREDENTIAL_DELETED, FAILED_TO_EXECUTE, MAINTENANCE, NOT_ENOUGH_QUANTITY, REMOVED_BY_USER, REPLACED_BY_USER, RFQ_CANCELED, RFQ_COMPLETED, RFQ_EXPIRATION and WEBSOCKET_DISCONNECT. Missing if the Quote has not been canceled. |
| signed_bid | object | false | |
| > buy_amount | string | true | Total amount of contracts to be purchased by the buyer, typically the same as the total_size. |
| > nonce | string | true | Arbitrary random or pseudo-random number, to be used just once. |
| > referrer | string | true | Address of the Paradigm wallet used to receive the fee, in hex format with 0x prefix. |
| > sell_amount | string | true | Total amount of sold contracts. |
| > swap_id | number | true | The Paradigm created unique identifier of the auction. |
| > signer_wallet | string | true | Address of the wallet who signed the message, in hex format with 0x prefix. |
| > signature | string | true | ECDSA or EdDSA signature. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 401 | N/A | "Invalid API Access Key." | You provided an invalid API Access Key. |
| 400 | 32120 | "Unavailable quote" | You are not the desk who created the Quote. |
VRFQ: [GET] /rfqs/{rfq_id}/quotes/
/rfqs/{rfq_id}/quotes/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/vrfq/rfqs/15/quotes/ \
-H 'Accept: application/json' \
-H 'Paradigm-API-Timestamp: <timestamp>' \
-H 'Paradigm-API-Signature: <signature>' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/vrfq/rfqs/{rfq_id}/quotes/
method = 'GET'
path = '/v1/vrfq/rfqs/15/quotes/'
payload = ''
timestamp, signature = sign_request(
secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(
f"{host}{path}",
headers=headers
)
print(response.status_code)
print(response.text)
/rfqs/{rfq_id}/quotes/ Response example
{
"id": 15,
"bids": [
{
"id": 9,
"created": 1659354419040.884,
"maker": "MMMM",
"price": "0.10000000",
"quantity": "0.01000000",
"rfq_id": 15,
"status": "OPEN"
}
]
}
A [GET] /rfqs/{rfq_id}/quotes/ request allows you to return all active Quotes upon a specific RFQ.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | endpoint | string | true | The Paradigm created unique identifier of the Quote. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| id | number | true | Pagination cursor value. |
| bids | array of objects | true | |
| > id | number | true | The Paradigm created unique identifier of the Quote. |
| > created | number | true | Time in unix milliseconds since the epoch when the Quote was created. |
| > maker | string | true | The Paradigm desk name of the Maker who created the Quote. |
| > price | string | true | The price of the Quote in the Quote Currency of the RFQ. |
| > quantity | string | true | The requested crossing quantity of the Quote. |
| > rfq_id | number | true | The Paradigm created unique identifier of the RFQ. |
| > status | string | true | Status of the Quote. Valid values include CLOSE and OPEN. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 401 | N/A | "Invalid API Access Key." | You provided an invalid API Access Key. |
| 400 | 32115 | "Unavailable RFQ" | Requested RFQ is not available. |
VRFQ: [POST] /rfqs/{rfq_id}/quotes/
/rfqs/{rfq_id}/quotes/ Request example
# You can also use wget
curl -X POST https://api.testnet.paradigm.trade/v1/vrfq/rfqs/15/quotes/ \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Paradigm-API-Timestamp: <timestamp>' \
-H 'Paradigm-API-Signature: <signature>' \
-H 'Authorization: Bearer <access-key>' \
-d '{
"account": "<wallet-name>",
"nonce": 132729633,
"price": "0.1",
"signature": "<signature>",
"use_delegated_wallet": False
}'
# built ins
import base64
import hmac
import json
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# POST /v1/vrfq/rfqs/{rfq_id}/quotes/
method = 'POST'
path = '/v1/vrfq/rfqs/15/quotes/'
payload = {
"account": "<wallet-name>",
"nonce": 132729633,
"price": "0.1",
"signature": "<signature>",
"use_delegated_wallet": false
}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(
secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.post(
f"{host}{path}",
headers=headers,
json=payload
)
print(response.status_code)
print(response.text)
/rfqs/{rfq_id}/quotes/ Response example
{
"id": 9,
"created": 1659354419040.884,
"maker": "MMMM",
"price": "0.10000000",
"quantity": "0.01000000",
"rfq_id": 15,
"status": "OPEN",
"signed_bid": {
"buy_amount": "1000000",
"nonce": "132729633",
"referrer": "0x...",
"sell_amount": "1000",
"signature": "...",
"signer_wallet": "0x...",
"swap_id": 30
}
}
A [POST] /rfqs/{rfq_id}/quotes/ request allows you to create a Quote upon a specific RFQ.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| account | body | string | true | The name of the Exchange API Key entered on your Client Admin dashboard used to with the Quote. |
| nonce | body | number | true | Arbitrary random or pseudo-random number, to be used just once. |
| price | body | string | true | The price of the Quote in the Quote Currency of the RFQ. |
| signature | body | string | true | ECDSA or EdDSA signature (depending on blockchain) of the Quote. |
| use_delegated_wallet | body | boolean | true | Specify if the Quote is signed by using the delegated wallet or not. |
Response Schema
Status Code 201
| Name | Type | Required | Description |
|---|---|---|---|
| id | number | true | The Paradigm created unique identifier of the Quote. |
| created | number | true | Time in unix milliseconds since the epoch when the Quote was created. |
| maker | string | true | The Paradigm desk name of the Maker. |
| price | string | true | The price of the Quote in the Quote Currency of the RFQ. |
| quantity | string | true | The requested crossing quantity of the Quote. |
| rfq_id | number | true | The Paradigm created unique identifier of the RFQ. |
| status | string | true | Status of the Quote. Valid values include OPEN and CLOSED. |
| canceled | number | false | The time in unix milliseconds since the epoch when the Quote was canceled. Missing if the Quote has not been canceled. |
| canceled_reason | string | false | The reason of the Quote cancellation. Valid values are API_CREDENTIAL_DELETED, FAILED_TO_EXECUTE, MAINTENANCE, NOT_ENOUGH_QUANTITY, REMOVED_BY_USER, REPLACED_BY_USER, RFQ_CANCELED, RFQ_COMPLETED, RFQ_EXPIRATION and WEBSOCKET_DISCONNECT. Missing if the Quote has not been canceled. |
| signed_bid | object | true | |
| > buy_amount | string | true | Total amount of contracts to be purchased by the buyer, typically the same as the total_size. |
| > nonce | string | true | Arbitrary random or pseudo-random number, to be used just once. |
| > referrer | string | true | Address of the Paradigm wallet used to receive the fee, in hex format with 0x prefix. |
| > sell_amount | string | true | Total amount of sold contracts. |
| > swap_id | number | true | The Paradigm created unique identifier of the auction. |
| > signer_wallet | string | true | Address of the wallet who signed the message, in hex format with 0x prefix. |
| > signarure | string | true | ECDSA or EdDSA signature. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 401 | N/A | "Invalid API Access Key." | You provided an invalid API Access Key. |
| 400 | 32115 | "Unavailable RFQ" | Requested RFQ is not available. |
| 400 | 100 | "Invalid parameters" | The parameters that you sent are not correct. A detailed error is provided with the response. E.g. "data": { "price": [ "A valid number is required." ] } |
| 400 | 32116 | "Active quote already exists. Please cancel the active quote before submitting a new one." | Please cancel the active quote before submitting a new one and replace the active quote by using the PUT endpoint |
| 400 | 32124 | "Invalid bid" | Signature's origin does not match signer's address. Ensure you are using the correct wallet. |
VRFQ: [PUT] /rfqs/{rfq_id}/quotes/{quote_id}/
/rfqs/{rfq_id}/quotes/{quote_id}/ Request example
# You can also use wget
curl -X PUT https://api.testnet.paradigm.trade/v1/vrfq/rfqs/15/quotes/30/ \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Paradigm-API-Timestamp: <timestamp>' \
-H 'Paradigm-API-Signature: <signature>' \
-H 'Authorization: Bearer <access-key>' \
-d '{
"account": "<wallet-name>",
"nonce": 132729634,
"price": "0.1",
"signature": "<signature>",
"use_delegated_wallet": false
}'
# built ins
import base64
import hmac
import json
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# PUT /v1/vrfq/rfqs/{rfq_id}/quotes/{quote_id}/
method = 'PUT'
path = '/v1/vrfq/rfqs/15/quotes/30/'
payload = {
"account": "<wallet-name>",
"nonce": 132729634,
"price": "0.1",
"signature": "<signature>",
"use_delegated_wallet": False
}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(
secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.put(
f"{host}{path}",
headers=headers,
json=payload
)
print(response.status_code)
print(response.text)
/rfqs/{rfq_id}/quotes/{quote_id}/ Response example
{
"id": 10,
"created": 1659354419040.884,
"maker": "MMMM",
"price": "0.10000000",
"quantity": "0.01000000",
"rfq_id": 15,
"status": "OPEN",
"signed_bid": {
"buy_amount": "1000000",
"nonce": "132729634",
"referrer": "0x...",
"sell_amount": "1000",
"signer_wallet": "0x...",
"signature": "...",
"swap_id": 30
}
}
A [PUT] /rfqs/{rfq_id}/quotes/{quote_id}/ request allows you to replace a Quote upon a specific RFQ.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| rfq_id | endpoint | string | true | The unique Paradigm created identifier of the RFQ. |
| quote_id | endpoint | string | true | The unique Paradigm created identifier of the Quote being replaced. |
| account | body | string | true | The name of the Exchange API Key entered on your Client Admin dashboard used to with the Quote. |
| nonce | body | number | true | Arbitrary random or pseudo-random number, to be used just once. |
| price | body | string | true | The price of the Quote in the Quote Currency of the RFQ. |
| signature | body | string | true | ECDSA or EdDSA signature (depending on blockchain) of the Quote. |
| use_delegated_wallet | body | boolean | true | Specify if the Quote is signed by using the delegated wallet or not. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| id | number | true | The Paradigm created unique identifier of the Quote. |
| created | number | true | Time in unix milliseconds since the epoch when the Quote was created. |
| maker | string | true | The Paradigm desk name of the Maker. |
| price | string | true | The price of the Quote in the Quote Currency of the RFQ. |
| quantity | string | true | The requested crossing quantity of the Quote. |
| rfq_id | number | true | The Paradigm created unique identifier of the RFQ. |
| status | string | true | Status of the Quote. Valid values include OPEN and CLOSED. |
| canceled | number | false | The time in unix milliseconds since the epoch when the Quote was canceled. Missing if the Quote has not been canceled. |
| canceled_reason | string | false | The reason of the Quote cancellation. Valid values are API_CREDENTIAL_DELETED, FAILED_TO_EXECUTE, MAINTENANCE, NOT_ENOUGH_QUANTITY, REMOVED_BY_USER, REPLACED_BY_USER, RFQ_CANCELED, RFQ_COMPLETED, RFQ_EXPIRATION and WEBSOCKET_DISCONNECT. Missing if the Quote has not been canceled. |
| signed_bid | object | true | |
| > buy_amount | string | true | Total amount of contracts to be purchased by the buyer, typically the same as the total_size. |
| > nonce | string | true | Arbitrary random or pseudo-random number, to be used just once. |
| > referrer | string | true | Address of the Paradigm wallet used to receive the fee, in hex format with 0x prefix. |
| > sell_amount | string | true | Total amount of sold contracts. |
| > swap_id | number | true | The Paradigm created unique identifier of the auction. |
| > signer_wallet | string | true | Address of the wallet who signed the message, in hex format with 0x prefix. |
| > signature | string | true | ECDSA or EdDSA signature. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 401 | N/A | "Invalid API Access Key." | You provided an invalid API Access Key. |
| 400 | 32115 | "Unavailable RFQ" | Requested RFQ is not available. |
| 400 | 100 | "Invalid parameters" | The parameters that you sent are not correct. A detailed error is provided with the response. E.g. "data": { "price": [ "A valid number is required." ] } |
| 400 | 32124 | "Invalid bid" | Signature's origin does not match signer's address. Ensure you are using the correct wallet. |
| 400 | 32125 | "Duplicated nonce" | Nonce already used, specify a unique nonce. |
| 400 | 32120 | "Unavailable Quote" | Requested quote is not available. |
| 400 | 32134 | "Quote has been already closed" | Requested quote is already closed and cannot be replaced. |
VRFQ: [DELETE] /quotes/{quote_id}/
/quotes/{quote_id}/ Request example
# You can also use wget
curl -X DELETE https://api.testnet.paradigm.trade/v1/vrfq/quotes/15/ \
-H 'Paradigm-API-Timestamp: <timestamp>' \
-H 'Paradigm-API-Signature: <signature>' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# DELETE /v1/vrfq/quotes/{quote_id}/
method = 'DELETE'
path = '/v1/vrfq/quotes/15/'
payload = ''
timestamp, signature = sign_request(
secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.delete(
f"{host}{path}",
headers=headers
)
print(response.status_code)
print(response.text)
A [DELETE] /quotes/{quote_id}/ request allows you to cancel a Quote.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | endpoint | string | true | The Paradigm created unique identifier of the Quote. |
Response Schema
Status Code 204
There is no response schema for this endpoint. Success is indicated by the HTTP Status Code 204.
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 401 | N/A | "Invalid API Access Key." | You provided an invalid API Access Key. |
| 400 | 32120 | "Unavailable quote" | You are not the desk who created the Quote. |
VRFQ: [GET] /trades/
/trades/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/trades/ \
-H 'Accept: application/json' \
-H 'Paradigm-API-Timestamp: <timestamp>' \
-H 'Paradigm-API-Signature: <signature>' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/vrfq/trades/
method = 'GET'
path = '/v1/vrfq/trades/'
payload = ''
timestamp, signature = sign_request(
secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(
f"{host}{path}",
headers=headers
)
print(response.status_code)
print(response.text)
/trades/ Response example
{
"count": 1,
"next": null,
"results": [
{
"id": 1,
"description": "Put 13 May 22 2000 0.01x",
"price": "0.1",
"product_name": "RBN - USDC Option (ETH)",
"quantity": "0",
"quote_id": 10,
"quote_currency": "USDC",
"rfq_id": 15,
"status": "COMPLETED",
"traded": 1659357767734.968
}
]
}
A [GET] /trades/ request allows you to return a paginated list of Trades.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | Cursor value used to paginate through pages. |
| page_size | query | string | false | Number of Trades returned per pagination. |
| status | query | string | false | List of status separated by comma. Valid values are: PENDING,COMPLETED,REJECTED. Example /v1/vrfq/trades/?status=COMPLETED,REJECTED. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | int | true | Total number of Trades to paginate. |
| next | string | true | Pagination cursor value. |
| results | array of objects | true | |
| > id | number | true | The Paradigm created unique identifier of the Trade. |
| > description | string | true | Paradigm created description of the RFQ. |
| > price | string | true | The price the Trade was executed at in the Quote Currency of the RFQ. |
| > product_name | string | true | The Paradigm created product name for the Instrument. |
| > quantity | string | true | The size of the trade in contracts units of the RFQ. |
| > quote_id | number | true | The Paradigm created unique identifier of the executed Quote. |
| > quote_currency | string | true | The Quote Currency of the RFQ executed upon. |
| > rfq_id | number | true | The Paradigm created unique identifier of the RFQ. |
| > status | string | true | Status of the Trade. Valid values include COMPLETED, PENDING and REJECTED. |
| > traded | number | true | The time in unix milliseconds since the epoch when the trade was cleared and settled. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 401 | N/A | "Invalid API Access Key." | You provided an invalid API Access Key. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
VRFQ: [GET] /trades/{trade_id}/
/trades/{trade_id}/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/trades/1/ \
-H 'Accept: application/json' \
-H 'Paradigm-API-Timestamp: <timestamp>' \
-H 'Paradigm-API-Signature: <signature>' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/vrfq/trades/{trade_id}/
method = 'GET'
path = '/v1/vrfq/trades/1/'
payload = ''
timestamp, signature = sign_request(
secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(
f"{host}{path}",
headers=headers
)
print(response.status_code)
print(response.text)
/trades/ Response example
{
"id": 1,
"description": "Put 13 May 22 2000 0.01x",
"price": "0.1",
"product_name": "RBN - USDC Option (ETH)",
"quantity": "0",
"quote_id": 10,
"quote_currency": "USDC",
"rfq_id": 15,
"status": "COMPLETED",
"traded": 1659357767734.968,
"signed_bid": {
"buy_amount": "1000000",
"nonce": "255160029",
"referrer": "0x...",
"sell_amount": "1000",
"signer_wallet": "0x...",
"signature": "...",
"swap_id": 30
}
}
A [GET] /trades/{trade_id}/ request allows you to return details about a given Trade.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | endpoint | string | true | The Paradigm created unique identifier of the Quote. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| id | number | true | The Paradigm created unique identifier of the Trade. |
| description | string | true | Paradigm created description of the RFQ. |
| price | string | true | The price the Trade was executed at in the Quote Currency of the RFQ. |
| product_name | string | true | The Paradigm created product name for the Instrument. |
| quantity | string | true | The size of the trade in contracts units of the RFQ. |
| quote_id | number | true | The Paradigm created unique identifier of the executed Quote. |
| quote_currency | string | true | The Quote Currency of the RFQ executed upon. |
| rfq_id | number | true | The Paradigm created unique identifier of the RFQ. |
| status | string | true | Status of the Trade. Valid values include COMPLETED, PENDING and REJECTED. |
| traded | number | true | The time in unix milliseconds since the epoch when the trade was cleared and settled. |
| signed_bid | object | true | |
| > buy_amount | string | true | Total amount of contracts to be purchased by the buyer, typically the same as the total_size. |
| > nonce | string | true | Arbitrary random or pseudo-random number, to be used just once. |
| > referrer | string | true | Address of the Paradigm wallet used to receive the fee, in hex format with 0x prefix. |
| > sell_amount | string | true | Total amount of sold contracts. |
| > swap_id | number | true | The Paradigm created unique identifier of the auction. |
| > signer_wallet | string | true | Address of the wallet who signed the message, in hex format with 0x prefix. |
| > signature | string | true | ECDSA or EdDSA signature. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 401 | N/A | "Invalid API Access Key." | You provided an invalid API Access Key. |
| 400 | 32128 | "Unavailable trade" | You are not the desk involved in this Trade. |
VRFQ: [POST] /rfqs/{rfq_id}/pricing/
/rfqs/{rfq_id}/pricing/ Request example
# You can also use wget
curl -X POST https://api.testnet.paradigm.trade/v1/rfqs/15/pricing/ \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Paradigm-API-Timestamp: <timestamp>' \
-H 'Paradigm-API-Signature: <signature>' \
-H 'Authorization: Bearer <access-key>' \
-d '{
"account": "<wallet-name>",
"nonce": 132729635,
"price": "0.1",
"use_delegated_wallet": false
}'
# built ins
import base64
import hmac
import json
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# POST /v1/vrfq/rfqs/{rfq_id}/pricing/
method = 'POST'
path = '/v1/vrfq/rfqs/15/pricing/'
payload = {
"account": "<wallet-name>",
"nonce": 132729635,
"price": "0.1",
"use_delegated_wallet": False
}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(
secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.post(
f"{host}{path}",
headers=headers,
json=payload
)
print(response.status_code)
print(response.text)
/rfqs/{rfq_id}/pricing/ Response example
{
"buy_amount": "1000000",
"nonce": "132729635",
"referrer": "0x...",
"sell_amount": "1000",
"swap_id": 30,
"signer_wallet": "0x..."
}
A [POST] /rfqs/{rfq_id}/pricing/ request allows you to obtain a valid price for a signed bidding quote.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | endpoint | string | true | The Paradigm created unique identifier of the Quote. |
| account | body | string | true | The name of the Exchange API Key entered on your Client Admin dashboard used to with the Quote. |
| nonce | body | number | true | Arbitrary random or pseudo-random number, to be used just once. |
| price | body | string | true | The price of the Quote in the Quote Currency of the RFQ. |
| use_delegated_wallet | body | boolean | true | Specify if the Quote is signed by using the delegated wallet or not. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| buy_amount | string | true | Total amount of contracts to be purchased by the buyer, typically the same as the total_size. |
| nonce | string | true | Arbitrary random or pseudo-random number, to be used just once. |
| referrer | string | true | Address of the Paradigm wallet used to receive the fee, in hex format with 0x prefix. |
| sell_amount | string | true | Total amount of sold contracts. |
| swap_id | number | true | The Paradigm created unique identifier of the auction. |
| signer_wallet | string | true | Address of the wallet who signed the message, in hex format with 0x prefix. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 401 | N/A | "Invalid API Access Key." | You provided an invalid API Access Key. |
| 404 | N/A | "Not found." | Requested RFQ is not available. |
| 400 | 32125 | "Duplicated nonce" | Nonce already used, specify a unique nonce. |
VRFQ - WebSocket Notifications Channels
VRFQ: rfq
An example of the
rfqnotification received when an RFQ is created
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"channel": "rfq",
"data": {
"kind": "ADDED",
"rfq": {
"auction": {
"swap_id": 30,
"seller": "0x...",
"offered_token": "0x...",
"bidding_token": "0x...",
"min_price": "0.000001",
"total_size": "5"
},
"created": 1659369985489.624,
"currency": "USDC",
"description": "Put 13 May 22 2000 0.01x",
"domain": {
"chain_id": 42,
"contract_name": "RIBBON SWAP",
"version": "1",
"verifying_contract": "0x..."
},
"id": 18,
"legs": [
{
"instrument": "DEFI-RBN-ETH-WETH-USDC-13May22-2000-P",
"product_code": "USDC",
"ratio": "1",
"venue_instrument": "DEFI-RBN-ETH-WETH-USDC-13May22-2000-P"
}
],
"min_tick_size": "0.1",
"product_name": "RBN - USDC Option (ETH)",
"quantity": "0.01000000",
"quote_currency": "USDC",
"referrer": "0x...",
"status": "ACTIVE",
"taker": "AAAA",
"venue": "RBN"
}
}
}
}
An example of the
rfqnotification received when an RFQ is removed
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"channel": "rfq",
"data": {
"kind": "REMOVED",
"rfq": {
"auction": {
"swap_id": 30,
"seller": "0x...",
"offered_token": "0x...",
"bidding_token": "0x...",
"min_price": "0.000001",
"total_size": "5"
},
"created": 1659369880968.851,
"currency": "USDC",
"description": "Put 13 May 22 2000 0.01x",
"domain": {
"chain_id": 42,
"contract_name": "RIBBON SWAP",
"version": "1",
"verifying_contract": "0x..."
},
"id": 17,
"legs": [
{
"instrument": "DEFI-RBN-ETH-WETH-USDC-13May22-2000-P",
"product_code": "USDC",
"ratio": "1",
"venue_instrument": "DEFI-RBN-ETH-WETH-USDC-13May22-2000-P"
}
],
"min_tick_size": "0.1",
"product_name": "RBN - USDC Option (ETH)",
"quantity": "0.01000000",
"quote_currency": "USDC",
"referrer": "0x...",
"status": "CANCELED",
"taker": "AAAA",
"venue": "RBN",
"canceled": 1659369959411.0
}
}
}
}
An example of the
rfqnotification received when an RFQ is completed
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"channel": "rfq",
"data": {
"kind": "COMPLETED",
"rfq": {
"auction": {
"swap_id": 30,
"seller": "0x...",
"offered_token": "0x...",
"bidding_token": "0x...",
"min_price": "0.000001",
"total_size": "5"
},
"created": 1659369985489.624,
"currency": "USDC",
"description": "Put 13 May 22 2000 0.01x",
"domain": {
"chain_id": 42,
"contract_name": "RIBBON SWAP",
"version": "1",
"verifying_contract": "0x..."
},
"id": 18,
"legs": [
{
"instrument": "DEFI-RBN-ETH-WETH-USDC-13May22-2000-P",
"product_code": "USDC",
"ratio": "1",
"venue_instrument": "DEFI-RBN-ETH-WETH-USDC-13May22-2000-P"
}
],
"min_tick_size": "0.1",
"product_name": "RBN - USDC Option (ETH)",
"quantity": "0.01000000",
"quote_currency": "USDC",
"referrer": "0x...",
"status": "COMPLETED",
"taker": "PARA0",
"venue": "RBN"
}
}
}
}
All updates relating to RFQs are sent through the rfq WebSocket Notifications channel.
This is a public channel and consumable by all the Makers.
Notifications received through the rfq WebSocket channel can include RFQ creations, expirations, and completions.
| Member | Type | Required | Description |
|---|---|---|---|
| jsonrpc | string | true | The version of the JSON-RPC protocol. Always "2.0". |
| method | string | true | The name of the invoked method. Valid value is subscription. |
| params | object | true | |
| > channel | string | true | WebSocket Notification Channel message is received upon. Valid value is rfq. |
| > data | object | true | |
| >> kind | string | true | WS Action. Valid values include ADDED, COMPLETED, REMOVED. |
| >> rfq | object | true | |
| >>> auction | object | true | |
| >>>> swap_id | number | true | The Paradigm created unique identifier of the auction. |
| >>>> seller | string | true | Wallet address of the seller (the trader who initiates the auction). |
| >>>> offered_token | string | true | Address of the token offered by the seller, in hex format with 0x prefix. |
| >>>> bidding_token | string | true | Address of the token used by the buyer to bid for in the auction, in hex format with 0x prefix. |
| >>>> min_price | string | true | The minimum price the RFQ can be Traded at. |
| >>>> total_size | string | true | Total amount of contracts (tokens) of offered_token being sold in the auction. |
| >>> created | number | true | Time in unix milliseconds since the epoch when the RFQ was created. |
| >>> currency | string | true | The currency of the option being offered. |
| >>> description | string | true | Paradigm created description of the RFQ. |
| >>> domain | object | true | |
| >>>> chain_id | number | true | The Paradigm unique identifier assigned to the blockchain (e.g. Ethereum, Avalanche, Solana). |
| >>>> contract_name | string | true | Name of the venue's smart contract. |
| >>>> version | string | true | Version of the venue's smart contract. |
| >>>> verifying_contract | string | true | Address of the venue smart contract used to settle the transaction, in hex format with 0x prefix. |
| >>> id | number | true | The Paradigm created unique identifier of the RFQ. |
| >>> legs | array of objects | true | |
| >>>> instrument | string | true | The Paradigm standardized name of the Instrument. |
| >>>> product_code | string | true | The Paradigm created product code of the Instrument. |
| >>>> ratio | string | true | The quantity multiple relative to other legs. |
| >>>> venue_instrument | string | true | The name of the Instrument for the underlying venue's naming convention. |
| >>> min_tick_size | string | true | Minimum tick size specified by the underlying venue's contract. |
| >>> product_name | string | true | The Paradigm created product name for the Instrument. |
| >>> quantity | string | true | The size of the trade in the contract units of the RFQ. |
| >>> quote_currency | string | true | The currency which will be used to quote the RFQ. |
| >>> referrer | string | true | Address of the Paradigm wallet used to receive the fee, in hex format with 0x prefix. |
| >>> status | string | true | Status of the RFQ. Valid values include ACTIVE, CANCELED and COMPLETED. |
| >>> taker | string | true | The Paradigm desk name of the Taker who created the RFQ. |
| >>> venue | string | true | The underlying venue the RFQ is cleared and settled upon. Valid values include RBN. |
VRFQ: quote
An example of the
quotenotification received when a Quote is created
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"channel": "quote",
"data": {
"kind": "NEW",
"quote": {
"id": 12,
"created": 1659370032469.147,
"maker": "BLOO0",
"price": "0.10000000",
"quantity": "0.01000000",
"rfq_id": 18,
"status": "OPEN",
"signed_bid": {
"buy_amount": "1000000",
"nonce": "273494617",
"referrer": "0x...",
"sell_amount": "1000",
"signature": "...",
"signer_wallet": "0x...",
"swap_id": 30
}
}
}
}
}
An example of the
quotenotification received when an Order is created
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"channel": "quote",
"data": {
"kind": "PENDING_FILL",
"quote": {
"id": 12,
"created": 1659370032469.147,
"maker": "BLOO0",
"price": "0.10000000",
"quantity": "0.01000000",
"rfq_id": 18,
"status": "CLOSED",
"signed_bid": {
"buy_amount": "1000000",
"nonce": "273494617",
"referrer": "0x...",
"sell_amount": "1000",
"signature": "...",
"signer_wallet": "0x...",
"swap_id": 30
}
}
}
}
}
An example of the
quotenotification received when an Order is filled
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"channel": "quote",
"data": {
"kind": "FILLED",
"quote": {
"id": 12,
"created": 1659370032469.147,
"maker": "BLOO0",
"price": "0.10000000",
"quantity": "0.01000000",
"rfq_id": 18,
"status": "CLOSED",
"signed_bid": {
"buy_amount": "1000000",
"nonce": "273494617",
"referrer": "0x...",
"sell_amount": "1000",
"signature": "...",
"signer_wallet": "0x...",
"swap_id": 30
}
}
}
}
}
All updates relating to Quotes upon RFQs are sent through the quote WebSocket Notifications channel.
This is a private channel and only provides updates to the Maker who created the Quote.
Updates received through the quote WebSocket Notification channel can include newly created quotes, removed quotes, quotes pending settlement & clearing, quotes which are filled.
Workflow Steps:
- Maker creates Quote.
kind==NEW&status==OPEN. - Maker removes Quote.
kind==CANCELED&status==CLOSED. - Taker executes upon a Quote, but the Trade is rejected by the underlying venue.
kind==CANCELED&status==CLOSED. - Taker completely executes quote.
kind==FILLED&status==CLOSED.
| Member | Type | Required | Description |
|---|---|---|---|
| jsonrpc | string | true | The version of the JSON-RPC protocol. Always "2.0". |
| method | string | true | The name of the invoked method. Valid value is subscription. |
| params | object | true | |
| > channel | string | true | WebSocket Notification Channel message is received upon. Valid value is quote. |
| > data | object | true | |
| >> kind | string | true | The action of the message. Valid values include NEW, CANCELED, PENDING_FILL, FILLED. |
| >> quote | object | true | |
| >>> id | number | true | The Paradigm created unique identifier of the Quote. |
| >>> created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| >>> maker | string | true | The Paradigm desk name of the Maker. |
| >>> price | string | true | The price of the Quote in the Quote Currency of the RFQ. |
| >>> quantity | string | true | The requested crossing quantity of the Quote. |
| >>> rfq_id | number | true | The Paradigm created unique identifier of the RFQ the Quote is a child of. |
| >>> status | string | true | The current status of the Quote. Valid values include OPEN and CLOSED. |
| >>> signed_bid | object | ||
| >>>> buy_amount | string | true | Total amount of contracts to be purchased by the buyer, typically the same as the total_size. |
| >>>> nonce | string | true | Arbitrary random or pseudo-random number, to be used just once. |
| >>>> referrer | string | true | Address of the Paradigm wallet used to receive the fee, in hex format with 0x prefix. |
| >>>> sell_amount | string | true | Total amount of sold contracts. |
| >>>> swap_id | number | true | The Paradigm created unique identifier of the auction. |
| >>>> signer_wallet | string | true | Address of the wallet who signed the message, in hex format with 0x prefix. |
| >>>> signature | string | true | ECDSA or EdDSA signature. |
VRFQ: trade
An example of the
tradenotification received when a Trade is completed
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"channel": "trade",
"data": {
"kind": "COMPLETED",
"trade": {
"id": 2,
"description": "Put 13 May 22 2000 0.01x",
"price": "0.1",
"product_name": "RBN - USDC Option (ETH)",
"quantity": "0",
"quote_id": 12,
"quote_currency": "USDC",
"rfq_id": 18,
"status": "COMPLETED",
"traded": 1659370234769.133
}
}
}
Updates relating to Trades upon RFQs are sent through the trade WebSocket Notifications channel.
This is a private channel and only provides updates to the Maker of the Trade (matching of an Order and a Quote).
Updates received through the trade WebSocket Notification channel can include trade success and rejection at clearing & settlement.
| Member | Type | Required | Description |
|---|---|---|---|
| jsonrpc | string | true | The version of the JSON-RPC protocol. Always "2.0". |
| method | string | true | The name of the invoked method. Valid value is subscription. |
| params | object | true | |
| > channel | string | true | WebSocket Notification Channel message is received upon. Valid value is trade. |
| > data | object | true | |
| >> kind | string | true | The action of the WS Message. Valid values include COMPLETED and REJECTION. |
| >> trade | object | true | |
| >>> id | number | true | The Paradigm created unique identifier of the Trade. |
| >>> description | string | true | The Paradigm created description of the RFQ. |
| >>> price | string | true | The price the Trade was executed at in the Quote Currency of the RFQ. |
| >>> product_name | string | true | The Paradigm created product name for the Instrument. |
| >>> quantity | string | true | The size of the trade in contracts units of the RFQ. |
| >>> quote_id | number | true | The Paradigm created unique identifier of the Quote executed upon. |
| >>> quote_currency | string | true | The Quote Currency of the RFQ executed upon. |
| >>> rfq_id | number | true | The Paradigm created unique identifier of the RFQ. |
| >>> status | string | true | Trade status. Valid values include COMPLETED, REJECTED. |
| >>> traded | number | true | The time in unix milliseconds since the epoch when the trade was cleared and settled. |
Legacy
GRFQv1 - REST Endpoints
GRFQ: [GET] /instruments/
/instruments/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/grfq/instruments/ </span>
-H 'Content-Type: application/json' </span>
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/grfq/v1/instruments/
method = 'GET'
path = '/v1/grfq/instruments/?asset=BTC&kind=FUTURE'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/instruments/ Response example
{
"count": 1341,
"next": "cD05NjE0Nw==",
"results": [
{
"expiration": 1680854400000,
"greeks": null,
"base_currency": "ETH",
"margin_kind": "INVERSE",
"kind": "FUTURE",
"mark_price": "1718.3",
"name": "ETH-7APR23",
"option_kind": null,
"product_code": "AZ",
"strike": null,
"venue": "DBT",
"venue_name": "ETH-7APR23"
},
{
"expiration": 1680854400000,
"greeks": null,
"base_currency": "BTC",
"margin_kind": "INVERSE",
"kind": "FUTURE",
"mark_price": "27144.7",
"name": "BTC-7APR23",
"option_kind": null,
"product_code": "CF",
"strike": null,
"venue": "DBT",
"venue_name": "BTC-7APR23"
},
{
"expiration": 1703836800000,
"greeks": {
"delta": "0.46821",
"gamma": "0.00043",
"mark_price": "0.1437",
"theta": "-0.67045",
"vega": "6.03833",
"last_updated_at": 1679945359701
},
"base_currency": "ETH",
"margin_kind": "INVERSE",
"kind": "OPTION",
"mark_price": "0.1437",
"name": "ETH-29DEC23-2100-C",
"option_kind": "CALL",
"product_code": "EH",
"strike": "2100",
"venue": "DBT",
"venue_name": "ETH-29DEC23-2100-C"
},
{
"expiration": 1703836800000,
"greeks": {
"delta": "-0.52159",
"gamma": "2e-05",
"mark_price": "0.3911",
"theta": "-11.79815",
"vega": "95.74543",
"last_updated_at": 1679945357964
},
"base_currency": "BTC",
"margin_kind": "INVERSE",
"kind": "OPTION",
"mark_price": "0.3911",
"name": "BTC-29DEC23-34000-P",
"option_kind": "PUT",
"product_code": "DO",
"strike": "34000",
"venue": "DBT",
"venue_name": "BTC-29DEC23-34000-P"
}
]
}
A [GET] /instruments/ request allows you to return all available Instruments upon Paradigm. Instruments are the legs part of an RFQ.
Instrument names match the naming conventions of the underlying venue.
You must paginate to return the complete results.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | Cursor value used to paginate through pages. |
| asset | query | string | false | Base Currency of Instrument. Valid values include BTC, ETH, BCH, XRP, EOS. |
| ordering | query | string | false | How returned Instruments are sorted. Valid values include creation, expiration, and default. |
| page_size | query | string | false | Number of Instruments returned per pagination. |
| kind | query | string | false | The type of Instrument. Valid values include FUTURE and OPTION. |
| venue | query | string | false | The underlying venue the Instrument is cleared & settled upon. Valid values include DBT, BIT, BYB. |
| name | query | [string] | false | Paradigm Name of Instruments. Example /v1/grfq/instruments/?name=BTC-PERPETUAL,ETH-PERPETUAL. |
| include_greeks | query | boolean | false | Include greeks in the response. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | int | true | Total number of Instruments to paginate. |
| next | string | true | Pagination cursor value. |
| results | array of objects | true | |
| > base_currency | string | true | The currency the Instrument is exposed to. Valid values include BCH, BTC, ETH. |
| > margin_kind | string | true | The nature of how the contract is margined. Valid values include LINEAR, INVERSE. |
| > option_kind | string | true | The kind of Option. null if instrument is not an Option. Valid values include CALL, PUT, null. |
| > product_code | string | true | The Paradigm created unique two-letter code to represent the specific Instrument. |
| > name | string | true | The Paradigm standardized name of the Instrument. |
| > strike | string | true | Option Instrument Strike Price. null if kind == FUTURE. |
| > kind | string | true | The type of Instrument. Valid values include FUTURE and OPTION. |
| > venue | string | true | Underlying venue Instrument is cleared & settled upon. Valid values include DBT, BIT, BYB. |
| > expiration | number | true | Instrument expiration timestamp in unix milliseconds since the epoch. null if Instrument does not have an expiration. |
| > venue_name | string | true | The name of the Instrument per the underlying venue's naming conventions. |
| > mark_price | string | true | The mark price of the Instrument. |
| > greeks | object | false | The greeks of the Instrument. |
| >> delta | string | true | The delta of the Instrument. |
| >> gamma | string | true | The gamma of the Instrument. |
| >> theta | string | true | The theta of the Instrument. |
| >> vega | string | true | The vega of the Instrument. |
| >> mark_price | string | true | The mark price of the Instrument. Deprecated: please use the top level mark_price |
| >> last_updated_at | int | true | The timestamp in unix milliseconds since the epoch when the greek values were last updated. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 400 | 3005 | "Invalid filter parameter" | You provided invalid value to one or more filter parameters. |
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
GRFQ: [GET] /instruments/{venue}/{instrument_name}/
/instruments/{venue}/{instrument_name}/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/grfq/instruments/DBT/BTC-PERPETUAL/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/grfq/instruments/{venue}/{instrument_name}
method = 'GET'
path = '/v1/grfq/instruments/DBT/BTC-PERPETUAL/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/instruments/{venue}/{instrument_name}/ Response example
{
"expiration": 1703836800000,
"greeks": {
"delta": "-0.52159",
"gamma": "2e-05",
"mark_price": "0.3911",
"theta": "-11.79815",
"vega": "95.74543",
"last_updated_at": 1679945357964
},
"base_currency": "BTC",
"margin_kind": "INVERSE",
"kind": "OPTION",
"mark_price": "0.3911",
"name": "BTC-29DEC23-34000-P",
"option_kind": "PUT",
"product_code": "DO",
"strike": "34000",
"venue": "DBT",
"venue_name": "BTC-29DEC23-34000-P"
}
A [GET] /instruments/{venue}/{instrument_name}/ allows you to return information about a specific available Instrument.
Instruments are the legs part of an RFQ.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| venue | query | string | true | The underlying venue the Instrument is cleared & settled upon. Valid values include DBT, BIT, BYB. |
| name | query | string | true | Paradigm Instrument Name. |
| include_greeks | query | boolean | false | Include greeks in the response. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | int | true | Total number of Instruments to paginate. |
| next | string | true | Pagination cursor value. |
| results | array of objects | true | |
| > base_currency | string | true | The currency the Instrument is exposed to. Valid values include BCH, BTC, ETH. |
| > margin_kind | string | true | The nature of how the contract is margined. Valid values include LINEAR, INVERSE. |
| > option_kind | string | true | The kind of Option. null if instrument is not an Option. Valid values include CALL, PUT, null. |
| > product_code | string | true | The Paradigm created unique two-letter code to represent the specific Instrument. |
| > name | string | true | The Instrument name per the underlying venue's naming convention. |
| > strike | string | true | Option Instrument Strike Price. null if kind == FUTURE. |
| > kind | string | true | The type of Instrument. Valid values include FUTURE and OPTION. |
| > venue | string | true | Underlying venue Instrument is cleared & settled upon. Valid values include DBT, BIT, BYB. |
| > expiration | number | true | Instrument expiration timestamp in unix milliseconds since the epoch. null if Instrument does not have an expiration. |
| > venue_name | string | true | The name of the Instrument per the underlying venue's naming conventions. |
| > mark_price | string | true | The mark price of the Instrument. |
| > greeks | object | false | The greeks of the Instrument. |
| >> delta | string | true | The delta of the Instrument. |
| >> gamma | string | true | The gamma of the Instrument. |
| >> theta | string | true | The theta of the Instrument. |
| >> vega | string | true | The vega of the Instrument. |
| >> mark_price | string | true | The mark price of the Instrument. Deprecated: please use the top level mark_price |
| >> last_updated_at | int | true | The timestamp in unix milliseconds since the epoch when the greek values were last updated. |
Error Codes
| HTTP Status Code | Message | Meaning |
|---|---|---|
| 401 | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
GRFQ: [GET] /orders/
/orders/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/grfq/orders/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/grfq/orders/
method = 'GET'
path = '/v1/grfq/orders/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/orders/ Response example
{
"count":2,
"next":null,
"results":[
{
"client_order_id":"",
"rfq_id":551,
"id":379,
"filled_quantity":"0",
"filled_average_price":"0",
"limit_price":"0.1645",
"requested_quantity":"25",
"status":"CLOSED",
"side": "BUY",
"venue":"DBT"
},
{
"client_order_id":"",
"rfq_id":551,
"id":378,
"filled_quantity":"0",
"filled_average_price":"0",
"limit_price":"0.0642",
"requested_quantity":"25",
"satus":"CLOSED",
"side": "BUY",
"venue":"DBT"
}
]
}
A [GET] /orders/ request will return all the requesting user's and trading desks' Orders.
Orders are Taker interactions with the Quote Book. Quotes can be Taker & Maker interactions with the Quote Book.
You must paginate to return the complete series of results.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | The pagination cursor value. |
| page_size | query | string | false | Number of orders to return per page. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | int | true | The total number of Orders available from request. |
| next | string | true | The next pagination cursor. This value is null if there are no more pages. |
| results | array of objects | true | |
| > client_order_id | string | true | A unique user created identifier for the Order. |
| > rfq_id | int | true | The Paradigm created unique identifier of the parent RFQ. |
| > id | int | true | The Paradigm created unique identifier of the Order. |
| > filled_quantity | string | true | The amount of the Order cleared & settled in the contract units of the RFQ. |
| > filled_average_price | string | true | The average price of the filled quantity in the Quote Currency of the RFQ. |
| > limit_price | string | true | The price of the submitted Order in the Quote Currency of the RFQ. |
| > requested_quantity | string | true | The size of the Order in contract units of the RFQ. |
| > side | string | true | The direction the Order executed upon the RFQ. Valid values include BUY and SELL. |
| > status | string | true | The current status of the Order. Valid values include CLOSED. |
| > venue | string | true | Underlying venue RFQ is cleared & settled upon. Valid values include DBT, BIT, BYB. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
GRFQ: [GET] /orders/{order_id}/
/orders/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/grfq/orders/62/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/grfq/orders/{order_id}/
method = 'GET'
path = '/v1/grfq/orders/62/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/orders/ Response example
{
"client_order_id":"",
"rfq_id":589,
"id":432,
"filled_quantity":"0",
"filled_average_price":"0",
"limit_price":"2498",
"requested_quantity":"50000000000",
"side":"SELL",
"status":"CLOSED",
"venue":"DBT",
"trades":[
{
"product_code":"CF",
"quantity":"50000000000",
"price":"2498",
"id":479,
"mark_price":"2498.93",
"traded":1625193887212.47,
"action":"SELL",
"quote_currency":"USD",
"quote_id":152838,
"api_credential":"ParadigmTestNinetyFive"
}
]
}
A [GET] /orders/{order_id}/ request will one of the requesting user's and trading desks' Orders.
Orders are Taker interactions with the Quote Book. Quotes can be Taker & Maker interactions with the Quote Book.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | endpoint | string | true | The Paradigm created unique identifier of the Order. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| client_order_id | string | true | A unique user created identifier for the trade Order. |
| rfq_id | int | true | The Paradigm created unique identifier of the parent RFQ. |
| id | int | true | The Paradigm created unique identifier of the Order. |
| filled_quantity | string | true | The amount of the Order filled in the contract units of the RFQ. |
| filled_average_price | string | true | The average price of the filled quantity in the Quote Currency of the RFQ. |
| limit_price | string | true | The price of the submitted Order in the Quote Currency of the RFQ. |
| requested_quantity | string | true | The size of the Order in contract units of the RFQ. |
| side | string | true | The execution side of the Order on the RFQ. Valid values include BUY and SELL. |
| status | string | true | The current status of the Order. Valid values include CLOSED. |
| venue | string | true | Underlying venue Instrument is cleared & settled upon. Valid values include DBT, BIT, BYB. |
| trades | array of objects | true | |
| > product_codes | array of strings | true | The Paradigm Product Codes of the Trade. |
| > quantity | string | true | The amount of contracts of the RFQ traded. |
| > price | string | true | The price in the Quote Currency of the RFQ of the Trade. |
| > id | int | true | The Paradigm created unique identifier of the Trade. |
| > mark_price | string | true | The calculated mark price of the RFQ using the Venue's mark prices. |
| > traded | number | true | The time in unix milliseconds since the epoch when the trade was cleared & settled. |
| > action | string | true | The action taken on the Trade. valid values include BUY and SELL. |
| > quote_currency | string | true | The asset which is the Quote Currency of the RFQ. |
| > quote_id | int | true | The Paradigm created unique identifier of the Quote. |
| > api_credential | string | true | The name given the to the Exchange API Key entered on the Paradigm Client Admin dashboard. |
| > status | string | true | The status of the Trade. Valid values include PENDING, COMPLETED, REJECTED. |
Error Codes
| HTTP Status Code | Message | Meaning |
|---|---|---|
| 401 | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
GRFQ: [GET] /quotes/
/quotes/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/grfq/quotes/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/grfq/quotes/
method = 'GET'
path = '/v1/grfq/quotes/?page_size=10&side=BUY'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/quotes/ Response example
{
"count":5755,
"next":"cD0yMDIxLTA3LTI2KzA2JTNBMjMlM0ExOC4xMTc1NDMlMkIwMCUzQTAw",
"results":[
{
"id":2775578,
"created":1631587522444.227,
"maker":"DSK95",
"price":"0.08",
"remaining_quantity":"0",
"side":"SELL",
"status":"CLOSED",
"client_order_id":"",
"original_quantity":"25",
"filled_quantity":"25",
"rfq_id":2073,
"account":"ParadigmTestNinetyFive"
},
{
"id":2775577,
"created":1631587522410.562,
"maker":"DSK95",
"price":"0.0795",
"remaining_quantity":"0",
"side":"BUY",
"status":"CLOSED",
"client_order_id":"",
"original_quantity":"25",
"filled_quantity":"25",
"rfq_id":2073,
"account":"ParadigmTestNinetyFive"
},
{
"id":2775572,
"created":1631587470993.799,
"maker":"DSK95",
"price":"0.09",
"remaining_quantity":"24",
"side":"BUY",
"status":"CLOSED",
"client_order_id":"",
"order":{
"id":266218,
"client_order_id":"",
"filled_quantity":"26",
"filled_average_price":"0.0879",
"limit_price":"0.09",
"requested_quantity":"50",
"rfq_id":2073,
"side":"BUY",
"status":"CLOSED",
"venue":"DBT"
},
"original_quantity":"24",
"filled_quantity":"26",
"rfq_id":2073,
"account":"ParadigmTestNinetyFive"
},
{
"id":2775564,
"created":1631587437845.888,
"maker":"DSK95",
"price":"0.0879",
"remaining_quantity":"50",
"side":"SELL",
"status":"CLOSED",
"client_order_id":"",
"original_quantity":"50",
"filled_quantity":"0",
"rfq_id":2073,
"account":"ParadigmTestNinetyFive"
}
]
}
A [GET] /quotes/ request will return all the requesting user's and trading desks' Quotes.
Orders are Taker interactions with the Quote Book. Quotes can be Taker & Maker interactions with the Quote Book.
You must paginate to return the complete series of results.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | The pagination cursor value. |
| page_size | query | string | false | Number of Quotes to return per page. |
| rfq_id | query | string | false | The Paradigm created unique identifier of the RFQ. |
| side | query | string | false | The direction of the Quotes. Valid values include BUY and SELL. |
| status | query | string | false | The status of the Quotes. Valid values include OPEN and CLOSED. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | int | true | The total number of Quotes available to paginate over. |
| next | string | true | The next pagination cursor. This value is null if there are no more pages. |
| results | array of objects | true | |
| > created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| > last_activity | number | true | The time in unix milliseconds since the epoch when the Quote was updated. |
| > id | int | true | The Paradigm created unique identifier of the Quote. |
| > maker | string | true | The Paradigm desk name of the Maker. |
| > price | string | true | The price of the Quote in the Quote Currency of the Strategy. |
| > remaining_quantity | string | true | The total remaining Quote size in contract units of the RFQ. |
| > side | string | true | The direction of the Quote. Valid values include BUY and SELL. |
| > type | string | true | The Quote OrderType. Valid values include LIMIT. |
| > description | string | true | The RFQ strategy description. |
| > product_codes | array of strings | true | The RFQ product codes. |
| > status | string | true | The status of the Quote. Valid values include OPEN and CLOSED. |
| > client_order_id | string | true | A unique user created identifier for the Quote. |
| > order | object | false | Present if Quote crosses the existing market. |
| >> id | int | false | The Paradigm created unique identifier of the Order. |
| >> client_order_id | string | false | A unique user created identifier for the Order. |
| >> filled_quantity | string | false | The filled quantity of the Order in the contract units of the RFQ. |
| >> filled_average_price | string | false | The average filled price of the Order in the quote currency of the RFQ. |
| >> limit_price | string | false | The price of the Order in quote currency of the RFQ. |
| >> requested_quantity | string | false | The requested crossing quantity of the Order. |
| >> rfq_id | int | false | The Paradigm created unique identifier of the RFQ the Order is a child of. |
| >> side | string | false | The direction of the Order. Valid values include BUY and SELL. |
| >> status | string | false | The current status of the Order. Valid values include OPEN and CLOSED. |
| >> venue | string | false | Underlying venue RFQ is cleared & settled upon. Valid values include DBT, BIT, BYB. |
| > rfq_id | int | true | The Paradigm created unique identifier of the RFQ the Quote is a child of. |
| > original_quantity | string | true | The original Quote size in contract units of the RFQ. |
| > filled_quantity | string | true | The successfully executed size of the Quote in contract units of the RFQ. |
| > account | string | true | The name of the Exchange API Key entered on your Client Admin dashboard. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
GRFQ: [GET] /quotes/{quote_id}/
/quotes/{quote_id}/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/grfq/quotes/482199/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/grfq/quotes/{quote_id}/
method = 'GET'
path = '/v1/grfq/quotes/152780/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/quotes/{quote_id}/ Response example
{
"id":2775572,
"created":1631587470993.799,
"maker":"DSK95",
"price":"0.09",
"remaining_quantity":"24",
"side":"BUY",
"status":"CLOSED",
"client_order_id":"",
"order":{
"id":266218,
"client_order_id":"",
"filled_quantity":"26",
"filled_average_price":"0.0879",
"limit_price":"0.09",
"requested_quantity":"50",
"rfq_id":2073,
"side":"BUY",
"status":"CLOSED",
"venue":"DBT"
},
"original_quantity":"24",
"filled_quantity":"26",
"rfq_id":2073,
"canceled":1631587471003.939,
"account":"ParadigmTestNinetyFive"
}
A [GET] /quotes/{quote_id}/ request will return the requesting user's and trading desks' specified Quote.
Orders are Taker interactions with the Quote Book. Quotes can be Taker & Maker interactions with the Quote Book.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | endpoint | string | true | The Paradigm created unique Quote identifier. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| id | int | true | The Paradigm created unique identifier of the Quote. |
| maker | string | true | The Paradigm desk name of the Maker who created the Quote. |
| price | string | true | Price of the Quote in the Quote currency of the RFQ. |
| remaining_quantity | string | true | The total remaining size of the Quote in contract units of the RFQ. |
| side | string | true | The direction of the Quote. Valid values include BUY and SELL. |
| status | string | true | The status of the quote. Valid values include OPEN and CLOSED. |
| client_order_id | string | true | A unique user created identifier for the Quote. |
| order | object | false | Present if Quote crosses the existing market. |
| > id | int | false | The Paradigm created unique identifier of the Order. |
| > client_order_id | string | false | A unique user created identifier for the Order. |
| > filled_quantity | string | false | The filled quantity of the Order in the contract units of the RFQ. |
| > filled_average_price | string | false | The average filled price of the Order in the quote currency of the RFQ. |
| > limit_price | string | false | The price of the Order in quote currency of the RFQ. |
| > requested_quantity | string | false | The requested crossing quantity of the Order. |
| > rfq_id | int | false | The Paradigm created unique identifier of the RFQ the Order is a child of. |
| > side | string | false | The direction of the Order. Valid values include BUY and SELL. |
| > status | string | false | The current status of the Order. Valid values include OPEN and CLOSED. |
| > venue | string | false | Underlying venue RFQ is cleared & settled upon. Valid values include DBT, BIT, BYB. |
| rfq_id | int | true | The Paradigm created unique identifier of the RFQ the Quote is a child of. |
| original_quantity | string | true | The original size of the Quote in contract units of the RFQ. |
| filled_quantity | string | true | The successfully executed size of the Quote in contract units of the RFQ. |
| canceled | number | true | The time in unix milliseconds since the epoch when the Quote was canceled. null if Quote has not been canceled. |
| account | string | true | The name of the Exchange API Key entered on your Client Admin dashboard. |
Error Codes
| HTTP Status Code | Message | Meaning |
|---|---|---|
| 401 | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
GRFQ: [DELETE] /quotes/
/quotes/ Request example
# You can also use wget
curl -X DELETE https://api.testnet.paradigm.trade/v1/grfq/quotes/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# DELETE /v1/grfq/quotes/
method = 'DELETE'
path = '/v1/grfq/quotes/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.delete(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/quotes/ Response example
{
"successes":{
"count":2,
"details":[
152799,
152798
]
},
"failures":{
"count":0,
"details":[
]
}
}
A [DELETE] /quotes/ request cancels all active Quotes.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| rfq_id | query | string | false | The Paradigm created unique identifier of the RFQ. |
| side | query | string | false | Cancel all Quotes by side. Valid values include BUY and SELL. Cancels all Quotes regardless of side if not specified. |
| price | query | decimal | false | Cancel all Quotes matching the given price. |
| currency | query | string | false | Cancel all Quotes with exposure or price currency matching the given currency. Valid values include BTC, ETH, SOL, USD, USDC. |
Response Schema
Status Code 200
In the case of a failure to cancel any quote, the request will return an HTTP Status Code of 207
Quotes that are being processed (previously cancelled, under execution) at the time of request may be returned as failures
| Name | Type | Required | Description |
|---|---|---|---|
| successes | array of objects | true | Information about successful Quote cancellations. |
| > count | int | true | The number of OPEN Quotes that have now been canceled. |
| > details | array of objects | true | |
| >> id | int | true | The Paradigm created unique identifier of the Quote. |
| >> created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| >> price | string | true | The price in the Quote Currency of the RFQ of the Quote. |
| >> remaining_quantity | string | true | The remaining quantity of the Quote in the contract units of the Quote. |
| >> side | string | true | The direction of the Quote. Valid values include BUY and SELL. |
| >> status | string | true | The status of the Quote. Valid values include CLOSED. |
| failures | array of objects | true | Information about unsuccessful Quote cancellations. |
| > count | int | true | The number of OPEN Quotes that have failed to be canceled. |
| > details | array of objects | true | |
| >> id | int | true | The Paradigm created unique identifier of the Quote. |
| >> created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| >> price | string | true | The price in the Quote Currency of the RFQ of the Quote. |
| >> remaining_quantity | string | true | The remaining quantity of the Quote in the contract units of the Quote. |
| >> side | string | true | The direction of the Quote. Valid values include BUY and SELL. |
| >> status | string | true | The status of the Quote. Valid values include OPEN. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 400 | 3305 | "Invalid RFQ ID" | Unavailable/Invalid RFQ Id requested. |
| 400 | 3301 | "Invalid quote side. Must either be BUY or SELL." | Requested side query string value must be BUY or SELL. |
GRFQ: [DELETE] /quotes/{quote_id}/
/quotes/{quote_id}/ Request example
# You can also use wget
curl -X DELETE https://api.testnet.paradigm.trade/v1/grfq/quotes/15/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# DELETE /v1/grfq/quotes/{quote_id}/
method = 'DELETE'
path = '/v1/grfq/quotes/152797/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
response = requests.delete(host+path,
headers=headers)
print(response.status_code)
print(response.text)
A [DELETE] /quotes/{quote_id}/ request cancels an existing OPEN Quote created by the requesting user or user's trading desk.
You cannot cancel multiple Quotes with a single request using this endpoint.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | endpoint | string | true | The Paradigm unique identifier of the Quote the user would like to cancel. |
Response Schema
This request will return an HTTP Status Code of 204 to indicate success of operation.
Status Code 204
Schema below is solely for if the request resulted in a failed operation.
| Name | Type | Required | Description |
|---|---|---|---|
| code | int | true | Error Code. |
| message | string | true | The reason the request was unsuccessful. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 400 | 3306 | "Too late to cancel." | The requested quote_id is already CLOSED or unavailable to cancel. |
| 400 | 3308 | "Unavailable quote | You are not the desk who created the Quote. |
GRFQ: [GET] /rfqs/
/rfqs/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/grfq/rfqs/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/grfq/rfqs/
method = 'GET'
path = '/v1/grfq/rfqs/?rfq_id=57'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/rfqs/ Response example
{
"count":13,
"next":null,
"results":[
{
"id":586,
"venue":"DBT",
"created":1625183214149.205,
"description":"Put 9 Jul 21 32000",
"last_trade":null,
"latest_activity":1625183931073.739,
"legs":[
{
"instrument":"BTC-9JUL21-32000-P",
"product_code":"DO",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"DO"
],
"status":"ACTIVE",
"strategy_code": "PT"
},
{
"id":585,
"venue":"DBT",
"created":1625182846124.338,
"description":"PFly 3 Jul 21 32000/33000/34000",
"last_trade":null,
"latest_activity":1625183645052.5972,
"legs":[
{
"instrument":"BTC-3JUL21-32000-P",
"product_code":"DO",
"ratio":"1",
"side":"BUY"
},
{
"instrument":"BTC-3JUL21-33000-P",
"product_code":"DO",
"ratio":"2",
"side":"SELL"
},
{
"instrument":"BTC-3JUL21-34000-P",
"product_code":"DO",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"DO"
],
"status":"ACTIVE",
"strategy_code":"IY"
},
{
"id":583,
"venue":"DBT",
"created":1625181172208.664,
"description":"Call 3 Jul 21 32000",
"last_trade":null,
"latest_activity":1625182827211.0642,
"legs":[
{
"instrument":"BTC-3JUL21-32000-C",
"product_code":"DO",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"DO"
],
"status":"ACTIVE",
"strategy_code":"CL"
},
{
"id":584,
"venue":"DBT",
"created":1625182630789.73,
"description":"Call 16 Jul 21 34000",
"last_trade":null,
"latest_activity":1625182651464.818,
"legs":[
{
"instrument":"BTC-16JUL21-34000-C",
"product_code":"DO",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"DO"
],
"status":"ACTIVE",
"strategy_code":"CL"
},
{
"id":573,
"venue":"DBT",
"created":1625159972983.593,
"description":"Put 16 Jul 21 34000",
"last_trade":null,
"latest_activity":1625182626036.611,
"legs":[
{
"instrument":"BTC-16JUL21-34000-P",
"product_code":"DO",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"DO"
],
"status":"ACTIVE",
"strategy_code":"PT"
},
{
"id":576,
"venue":"DBT",
"created":1625163614843.893,
"description":"CFly 3 Jul 21 31000/32000/33000",
"last_trade":null,
"latest_activity":1625180836165.132,
"legs":[
{
"instrument":"BTC-3JUL21-31000-C",
"product_code":"DO",
"ratio":"1",
"side":"BUY"
},
{
"instrument":"BTC-3JUL21-32000-C",
"product_code":"DO",
"ratio":"2",
"side":"SELL"
},
{
"instrument":"BTC-3JUL21-33000-C",
"product_code":"DO",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"DO"
],
"status":"ACTIVE",
"strategy_code":"IB"
},
{
"id":581,
"venue":"BIT",
"created":1625174242789.779,
"description":"Straddle 3 Jul 21 1900",
"last_trade":null,
"latest_activity":1625180726439.838,
"legs":[
{
"instrument":"ETH-3JUL21-1900-P",
"product_code":"VT",
"ratio":"1",
"side":"BUY"
},
{
"instrument":"ETH-3JUL21-1900-C",
"product_code":"VT",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"VT"
],
"status":"ACTIVE",
"strategy_code":"ID"
},
{
"id":582,
"venue":"DBT",
"created":1625178072216.012,
"description":"Cstm +1 Call 3 Jul 21 32000\n -2 Put 3 Jul 21 33000\n +2 Call 9 Jul 21 34000\n -1 Put 9 Jul 21 35000",
"last_trade":null,
"latest_activity":1625178072216.1091,
"legs":[
{
"instrument":"BTC-3JUL21-32000-C",
"product_code":"DO",
"ratio":"1",
"side":"BUY"
},
{
"instrument":"BTC-3JUL21-33000-P",
"product_code":"DO",
"ratio":"2",
"side":"SELL"
},
{
"instrument":"BTC-9JUL21-34000-C",
"product_code":"DO",
"ratio":"2",
"side":"BUY"
},
{
"instrument":"BTC-9JUL21-35000-P",
"product_code":"DO",
"ratio":"1",
"side":"SELL"
}
],
"product_codes":[
"DO"
],
"status":"ACTIVE",
"strategy_code":"CM"
},
{
"id":575,
"venue":"DBT",
"created":1625160866037.8489,
"description":"Call 9 Jul 21 32000",
"last_trade":null,
"latest_activity":1625173436428.965,
"legs":[
{
"instrument":"BTC-9JUL21-32000-C",
"product_code":"DO",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"DO"
],
"status":"ACTIVE",
"strategy_code":"CL"
},
{
"id":578,
"venue":"DBT",
"created":1625167876394.6099,
"description":"Future 16 Jul 21",
"last_trade":null,
"latest_activity":1625172957461.732,
"legs":[
{
"instrument":"BTC-16JUL21",
"product_code":"CF",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"CF"
],
"status":"ACTIVE",
"strategy_code":"FT"
},
{
"id":580,
"venue":"DBT",
"created":1625172668390.126,
"description":"FSpd 25 Mar 22 / 24 Jun 22",
"last_trade":null,
"latest_activity":1625172668390.178,
"legs":[
{
"instrument":"BTC-25MAR22",
"product_code":"CF",
"ratio":"1",
"side":"SELL"
},
{
"instrument":"BTC-24JUN22",
"product_code":"CF",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"CF"
],
"status":"ACTIVE",
"strategy_code":"FS"
},
{
"id":579,
"venue":"DBT",
"created":1625172652154.217,
"description":"FSpd Perpetual / 24 Jun 22",
"last_trade":null,
"latest_activity":1625172652154.271,
"legs":[
{
"instrument":"BTC-PERPETUAL",
"product_code":"CF",
"ratio":"1",
"side":"SELL"
},
{
"instrument":"BTC-24JUN22",
"product_code":"CF",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"CF"
],
"status":"ACTIVE",
"strategy_code":"FS"
},
{
"id":577,
"venue":"BYB",
"created":1625164847566.429,
"description":"FSpd 24 Sep 21 / 31 Dec 21",
"last_trade":null,
"latest_activity":1625164847566.4849,
"legs":[
{
"instrument":"BTCUSDU21",
"product_code":"BB",
"ratio":"1",
"side":"SELL"
},
{
"instrument":"BTCUSDZ21",
"product_code":"BB",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"BB"
],
"status":"ACTIVE",
"strategy_code":"FS"
}
]
}
A [GET] /rfqs/ request returns information about ACTIVE RFQs.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | Cursor value, from the next key in the response, used to paginate through pages. |
| page_size | query | string | false | Number of RFQs to return per pagination. |
| product_codes | query | string | false | Paradigm Product Codes involved in RFQ. There can be multiple product codes. Example: /v1/grfq/rfqs/?product_codes=DO,CF |
| rfq_id | query | string | false | Paradigm created unique identifier for the RFQ. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | int | true | Total number of RFQs to paginate through from request. |
| next | string | true | Pagination cursor value. null if no more pages are available. |
| results | array of objects | true | |
| > id | int | true | The Paradigm created unique identifier of the RFQ. |
| > venue | string | true | The underlying venue the instruments are cleared & settled upon. Valid values include DBT, BIT, BYB. |
| > created | number | true | Time in unix milliseconds since the epoch when the RFQ was created. |
| > description | string | true | The description of the RFQ. |
| > last_trade | object | true | null if RFQ has never been Traded. |
| >> traded | number | false | Time in unix milliseconds since the epoch when the the Trade occurred. |
| >> quantity | string | false | The size of the trade in the contract units of the RFQ. |
| >> price | string | false | The price the RFQ was Traded at in the Quote Currency of the RFQ. |
| > latest_activity | number | true | Time in unix milliseconds since the epoch when the RFQ, it’s quotes and trades were last updated. |
| > legs | array of objects | true | |
| >> instrument | string | true | The Paradigm standardized name of the Instrument. |
| >> venue_instrument | string | true | Instrument name per the underlying venue's naming convention. |
| >> product_code | string | true | Paradigm Product Code of the Instrument. |
| >> ratio | string | true | The multiplier applied to the quantity that the quote applies. |
| >> side | string | true | The direction of the leg. Valid values include BUY and SELL. |
| > price | string | false | Price of Instrument if the Instrument is a hedge leg in RFQ. |
| > product_codes | array of strings | true | Paradigm Product Codes involved in the GRFQ. |
| > status | string | true | Status of the RFQ. Valid values include ACTIVE. |
| > strategy_code | string | true | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
GRFQ: [GET] /rfqs/{rfq_id}/
/rfqs/{rfq_id}/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/grfq/rfqs/20/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/grfq/rfqs/{rfq_id}/
method = 'GET'
path = '/v1/grfq/rfqs/581/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/rfqs/{rfq_id}/ Response example
{
"id":581,
"venue":"BIT",
"created":1625174242789.779,
"description":"Straddle 3 Jul 21 1900",
"last_trade":null,
"latest_activity":1625180726439.838,
"legs":[
{
"instrument":"ETH-3JUL21-1900-P",
"product_code":"VT",
"ratio":"1",
"side":"BUY"
},
{
"instrument":"ETH-3JUL21-1900-C",
"product_code":"VT",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"VT"
],
"status":"ACTIVE"
}
A [GET] /rfqs/{rfq_id}/ request returns information about a specific RFQ.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | endpoint | string | true | The Paradigm created unique identifier of the RFQ. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| id | int | true | The Paradigm created unique identifier of the RFQ. |
| venue | string | true | The underlying venue the instruments are cleared & settled upon. Valid values include DBT, BIT, BYB. |
| created | number | true | Time in unix milliseconds since the epoch when the RFQ was created. |
| description | string | true | The description of the RFQ. |
| last_trade | object | true | null if the RFQ has never been Traded. |
| > traded | number | false | Time in unix milliseconds since the epoch when the the Trade occurred. |
| > quantity | string | false | The size of the trade in the contract units of the RFQ. |
| > price | string | false | The price the RFQ was Traded at. |
| latest_activity | number | true | Time in unix milliseconds since the epoch when the RFQ, it’s quotes and trades were last updated. |
| legs | array of objects | true | |
| > instrument | string | true | The Paradigm standardized name of the Instrument. |
| > venue_instrument | string | true | Instrument name per the underlying venue's naming conventions. |
| > price | string | false | Price of Instrument if the Instrument is a hedge leg in RFQ. |
| > product_code | string | true | Paradigm Product Code of the Instrument. |
| > ratio | string | true | The multiplier applied to the quantity that the quote applies. |
| > side | string | true | The direction of the leg. Valid values include BUY and SELL. |
| product_codes | array of strings | true | Paradigm Product Codes involved in the RFQ. |
| status | string | true | Status of the RFQ. Valid values include ACTIVE and EXPIRED. |
| > strategy_code | string | true | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 400 | 3300 | "Unavailable RFQ" | Unavailable/invalid RFQ Id provided in request. |
GRFQ: [POST] /rfqs/
/rfqs/ Request example
# built ins
import base64
import hmac
import json
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# POST /v1/grfq/rfqs/
method = 'POST'
path = '/v1/grfq/rfqs/'
payload = {
"venue":"DBT",
"legs":[
{
"instrument":"BTC-PERPETUAL",
"price":23456.01,
"ratio":1,
"side":"BUY"
},
{
"instrument":"BTC-31DEC21",
"ratio":1,
"side":"SELL"
}
]
}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.post(host+path,
headers=headers,
json=payload)
print(response.status_code)
print(response.text)
/rfqs/ Response example
{
"id":588,
"venue":"DBT",
"created":1625187733890.315,
"description":"Cstm +1 Future Perpetual\n -1 Future 31 Dec 21",
"last_trade":null,
"latest_activity":1625187733890.388,
"legs":[
{
"instrument":"BTC-PERPETUAL",
"product_code":"CF",
"ratio":"1",
"side":"BUY"
},
{
"instrument":"BTC-31DEC21",
"product_code":"CF",
"ratio":"1",
"side":"SELL"
}
],
"product_codes":[
"CF"
],
"status":"ACTIVE",
"strategy_code":"CM"
}
A [POST] /rfqs/ request allows a user to create a new RFQ and/or return the RFQ's information if one already exists.
The response schema and response is the same if the requester creates a new RFQ or an RFQ already exists.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| venue | body | string | true | The underlying venue the Instruments in the RFQ are cleared & settled upon. Valid values include DBT, BIT, BYB. |
| legs | body | array of objects | true | The individual legs of the RFQ. |
| > instrument | body | string | true | The name of the Instrument per Paradigm's naming convention. |
| > price | body | string | false | The price of the leg in the Quote Currency of the Instrument if the leg is a hedge leg. |
| > ratio | body | sting | true | The quantity multiplier for the Strategy leg. |
| > side | body | string | true | The direction of the leg. Valid values include BUY and SELL. |
Response Schema
Status Code 201
| Name | Type | Required | Description |
|---|---|---|---|
| id | int | true | The Paradigm created unique identifier of the RFQ. |
| venue | string | true | The underlying RFQ venue the instruments are cleared & settled upon. Valid values include DBT, BIT, and BYB. |
| created | number | true | The time in unix milliseconds since the epoch when the RFQ was created. |
| description | string | true | The description of the RFQ. |
| last_trade | object | true | null if no Trades have occurred on the RFQ. |
| > traded | number | false | Time in unix milliseconds since the epoch when the the Trade occurred. |
| > quantity | string | false | The size of the trade in the contract units of the RFQ. |
| > price | string | false | The price the RFQ was Traded at. |
| latest_activity | number | true | The time in unix milliseconds since the epoch when the RFQ's quotes or trades were last updated. |
| legs | array of objects | true | |
| > instrument | string | true | The Paradigm standardized name of the RFQ leg. |
| > venue_instrument | string | true | The name of the Instrument per the underlying venue's naming convention. |
| > product_code | string | true | The Paradigm created product code of the Instrument in the leg. |
| > ratio | number | true | The multiplier of the quantity of the Instrument in the leg. |
| > side | string | true | The direction of the leg in the strategy. Valid values include BUY and SELL. |
| > price | string | false | The price of the leg in the Quote Currency of the Instrument. Only returned if the leg is a Hedge leg. |
| product_codes | array of strings | true | The Paradigm created product codes of the instrument legs. |
| status | string | true | The status of the RFQ. Valid values include ACTIVE. |
| > strategy_code | string | true | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 403 | N/A | "Your desk is not configured to trade in this venue's products" | Ensure you have the venue key in your request payload. If so, ask Sales to enable the payload for your Desk. |
| 400 | 1306 | "Invalid instrument" | An invalid Instrument name is part of the request. Use the Paradigm standardized instrument key value. |
| 400 | 3203 | "Invalid leg parameters" | There is an invalid leg parameter as part of your request. |
GRFQ: [POST] /rfqs/{rfq_id}/quotes/
/rfqs/{rfq_id}/quotes/ Request example
# built ins
import base64
import hmac
import time
import json
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# POST /v1/grfq/rfqs/{rfq_id}/quotes/
method = 'POST'
path = '/v1/grfq/rfqs/579/quotes/'
payload = {
"account": "ParadigmTestNinetyFive",
"client_order_id": "55",
"legs": [
{
"instrument": "BTC-PERPETUAL",
"price": "33000"
},
{
"instrument": "BTC-24JUN22",
"price": "33200"
}
],
"quantity": "1000000",
"side": "SELL"
}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.post(host+path,
headers=headers,
json=payload)
print(response.status_code)
print(response.text)
/rfqs/{rfq_id}/quotes/ Response example
{
"id":2776054,
"created":1631589942042.397,
"last_activity":1631589943042.397,
"maker":"DSK95",
"price":"0.09",
"remaining_quantity":"24",
"side":"BUY",
"status":"CLOSED",
"client_order_id":"stri1231321232121223231321132312213ng",
"order":{
"id":266318,
"client_order_id":"stri1231321232121223231321132312213ng",
"filled_quantity":"0",
"filled_average_price":"0",
"limit_price":"0.09",
"requested_quantity":"50",
"rfq_id":2073,
"side":"BUY",
"status":"OPEN",
"venue":"DBT"
},
"original_quantity":"24",
"filled_quantity":"0",
"rfq_id":2073,
"account":"ParadigmTestNinetyFive"
}
A [POST] /rfqs/{rfq_id}/quotes/ request creates a Quote upon a specific RFQ.
Takers & Makers use this endpoint to cross the existing market or create a resting Limit Order. Remaining amounts of the Quote remain on the Quote Book in the event of crossing.
If post_only == true and the submitted Quote crosses the existing market, the Quote is canceled in its entirety. This ensures you are always a Maker.
If a user submits a Quote which crosses the existing market, you will receive messages on both the quote and order JSON-RPCoverWebSockets Notification channels.
Takers are only able to execute two times every five seconds due to Paradigm's Market Maker Protection feature.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | endpoint | string | true | The unique Paradigm created identifier of the RFQ. |
| ioc | body | boolean | false | Create Immediate or Cancel (IoC) quote. |
| account | body | string | true | The name of the Exchange API Key entered on your Client Admin dashboard. |
| client_order_id | body | string | true | A unique user created identifier for the Quote. |
| legs | body | array of objects | true | Array of objects containing the strategy’s legs' quotes' attributes. |
| > instrument | body | string | true | The Paradigm standardized name of the Instrument. |
| > price | body | string | true | The price of the individual leg's Instrument. |
| quantity | body | string | true | The total quantity of the strategy in contract units of the RFQ. |
| side | body | string | true | The direction of the Quote. Valid values include BUY and SELL. |
| post_only | body | boolean | false | If true, the quote is canceled and never enters the Quote Book if it crosses the existing market. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| id | int | true | The Paradigm created unique identifier of the Quote. |
| created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| last_activity | number | true | The time in unix milliseconds since the epoch when the Quote was updated. |
| maker | string | true | The Paradigm desk name that created the Quote. |
| price | string | true | The price of the strategy in the Quote Currency of the RFQ. |
| remaining_quantity | string | true | Total size of the Quote in contract units of the RFQ remaining. |
| side | string | true | The direction of the Quote. Valid values include BUY and SELL. |
| status | string | true | The status of the Quote. Valid values include OPEN, CLOSED. |
| client_order_id | string | true | A unique user created identifier for the Quote. |
| order | object | false | Present if Quote crosses the existing market. |
| > id | int | false | The Paradigm created unique identifier of the Order. |
| > client_order_id | string | false | A unique user created identifier for the Order. |
| > filled_quantity | string | false | The filled quantity of the Order in the contract units of the RFQ. |
| > filled_average_price | string | false | The average filled price of the Order in the quote currency of the RFQ. |
| > limit_price | string | false | The price of the Order in quote currency of the RFQ. |
| > requested_quantity | string | false | The requested crossing quantity of the Order. |
| > rfq_id | int | false | The Paradigm created unique identifier of the RFQ the Order is a child of. |
| > side | string | false | The direction of the Order. Valid values include BUY and SELL. |
| > status | string | false | The current status of the Order. Valid values include OPEN and CLOSED. |
| > venue | string | false | Underlying venue RFQ is cleared & settled upon. Valid values include DBT, BIT, BYB. |
| original_quantity | string | true | Initial size of the Quote in contract units of the RFQ. |
| filled_quantity | string | true | The successfully executed size of the Quote in contract units of the RFQ. |
| rfq_id | int | true | The Paradigm created unique identifier of the RFQ the Quote is a child of. |
| account | string | true | The name of the Exchange API Key entered on your Client Admin dashboard. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 400 | 100 | "Invalid parameters" | Invalid parameters in request such as a non-unique client_order_id value. |
| 400 | 1302 | "Invalid account information" | The value provided with the account key should match the name given to the Exchange API key on the Paradigm Client Admin Dashboard. |
| 400 | 3203 | "Invalid leg parameters" | Ensure you are attempting to quote on the correct RFQ. Check your request format is correct. |
| 400 | 3303 | "An active BUY(SELL)-side quote already exists. Please cancel that quote before submitting a new quote." | Refer to error message. |
| 400 | 3304 | "Your Bid/Ask was canceled. It crossed the available Ask/Bid." | This occurs when you specify post_only == true and the submitted Quote crosses the market or if you cross your own existing Quote. |
| 400 | 3304 | "{instrument_name}. Bid/Ask price cannot be greater than Ask/Bid Price." | This occurs when the Bid/Ask price of a leg in the submitted Quote is greater than the Ask/Bid price of the same leg in an existing Quote. |
| 403 | N/A | "Maker Execution Limit Reached." | MMP has been triggered and the user must [PATCH] /v1/grfq/mmp/status to reset the protection to be able to quote. |
GRFQ: [PUT] /rfqs/{rfq_id}/quotes/{quote_id}/
/rfqs/{rfq_id}/quotes/{quote_id}/ Request example
# built ins
import base64
import hmac
import time
import json
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# PUT /v1/grfq/rfqs/{rfq_id}/quotes/{quote_id}/
method = 'PUT'
path = '/v1/grfq/rfqs/1230/quotes/45678/'
payload = {
"account": "ParadigmTestNinetyFive",
"client_order_id": "1223322132123123321",
"quantity": "5000000",
"side": "BUY",
"legs": [
{
"instrument": "BTC-PERPETUAL",
"price": "38501"
}
],
"post_only": True
}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.put(host+path,
headers=headers,
json=payload)
print(response.status_code)
print(response.text)
/rfqs/{rfq_id}/quotes/{quote_id}/ Response example
{
"id":2776054,
"created":1631589942042.397,
"last_activity":1631589942042.415,
"maker":"DSK95",
"price":"0.09",
"remaining_quantity":"24",
"side":"BUY",
"status":"CLOSED",
"client_order_id":"stri1231321232121223231321132312213ng",
"order":{
"id":266318,
"client_order_id":"stri1231321232121223231321132312213ng",
"filled_quantity":"0",
"filled_average_price":"0",
"limit_price":"0.09",
"requested_quantity":"50",
"rfq_id":2073,
"side":"BUY",
"status":"OPEN",
"venue":"DBT"
},
"original_quantity":"24",
"filled_quantity":"0",
"rfq_id":2073
}
A [PUT] /rfqs/{rfq_id}/quotes/{quote_id}/ request replaces an existing Quote upon a specific RFQ.
Takers & Makers use this endpoint to cross the existing market or update a resting Limit Order. Remaining amounts of the Quote remain on the Quote Book in the event of crossing.
If post_only == true and the submitted Quote crosses the existing market, the Quote is canceled in its entirety. This ensures you are always a Maker.
If a user submits a Quote which crosses the existing market, you will receive messages on both the quote and order JSON-RPCoverWebSockets Notification channels.
Important note: this endpoint serves as a replacement for both [PATCH] /rfqs/{rfq_id}/quotes/, and [PATCH] /rfqs/{rfq_id}/quotes/{quote_id}/ which are proposed for deprecation.
The [PATCH] /rfqs/{rfq_id}/quotes/ endpoint is not able to process the replacement correctly when quote layering is enabled and more than one quote is active.
The current new endpoint takes also the quote_id in the URL to handle the feature without any issues.
The [PATCH] /rfqs/{rfq_id}/quotes/{quote_id}/ endpoint is proposed for deprecation as a part of unification and standardization of methods used in our API.
We recommend to update all workflows in favor of this new version.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| rfq_id | endpoint | string | true | The unique Paradigm created identifier of the RFQ. |
| quote_id | endpoint | string | true | The unique Paradigm created identifier of the Quote being replaced. |
| account | body | string | true | The name of the Exchange API Key entered on your Client Admin dashboard. |
| client_order_id | body | string | true | A unique user created identifier for the Quote. |
| legs | body | array of objects | true | Array of objects containing the strategy’s legs' quotes' attributes. |
| > instrument | body | string | true | The Paradigm standardized name of the Instrument. |
| > price | body | string | true | The price of the individual leg's Instrument. |
| quantity | body | string | true | The total quantity of the strategy in contract units of the RFQ. |
| side | body | string | true | The direction of the Quote. Valid values include BUY and SELL. |
| post_only | body | boolean | false | If true, the quote is canceled and never enters the Quote Book if it crosses the existing market. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| id | int | true | The Paradigm created unique identifier of the Quote. |
| created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| last_activity | number | true | The time in unix milliseconds since the epoch when the Quote was updated. |
| maker | string | true | The Paradigm desk name that created the Quote. |
| price | string | true | The price of the strategy in the Quote Currency of the RFQ. |
| remaining_quantity | string | true | Total size of the Quote in contract units of the RFQ remaining. |
| side | string | true | The direction of the Quote. Valid values include BUY and SELL. |
| status | string | true | The status of the Quote. Valid values include OPEN, CLOSED. |
| client_order_id | string | true | A unique user created identifier for the Quote. |
| order | object | false | Present if Quote crosses the existing market. |
| > id | int | false | The Paradigm created unique identifier of the Order. |
| > client_order_id | string | false | A unique user created identifier for the Order. |
| > filled_quantity | string | false | The filled quantity of the Order in the contract units of the RFQ. |
| > filled_average_price | string | false | The average filled price of the Order in the quote currency of the RFQ. |
| > limit_price | string | false | The price of the Order in quote currency of the RFQ. |
| > requested_quantity | string | false | The requested crossing quantity of the Order. |
| > rfq_id | int | false | The Paradigm created unique identifier of the RFQ the Order is a child of. |
| > side | string | false | The direction of the Order. Valid values include BUY and SELL. |
| > status | string | false | The current status of the Order. Valid values include OPEN and CLOSED. |
| > venue | string | false | Underlying venue RFQ is cleared & settled upon. Valid values include DBT, BIT, BYB. |
| original_quantity | string | true | Initial size of the Quote in contract units of the RFQ. |
| filled_quantity | string | true | The successfully executed size of the Quote in contract units of the RFQ. |
| rfq_id | int | true | The Paradigm created unique identifier of the RFQ the Quote is a child of. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 400 | 100 | "Invalid parameters" | Invalid parameters in request such as a non-unique client_order_id value. |
| 400 | 1302 | "Invalid account information" | The value provided with the account key should match the name given to the Exchange API key on the Paradigm Client Admin Dashboard. |
| 400 | 3203 | "Invalid leg parameters" | Ensure you are attempting to quote on the correct RFQ. Check your request format is correct. |
| 400 | 3303 | "An active BUY(SELL)-side quote already exists. Please cancel that quote before submitting a new quote." | Refer to error message. |
| 400 | 3304 | "Your Bid/Ask was canceled. It crossed the available Ask/Bid." | This occurs when you specify post_only == true and the submitted Quote crosses the market or if you cross your own existing Quote. |
| 400 | 3304 | "{instrument_name}. Bid/Ask price cannot be greater than Ask/Bid Price." | This occurs when the Bid/Ask price of a leg in the submitted Quote is greater than the Ask/Bid price of the same leg in an existing Quote. |
| 403 | N/A | "Maker Execution Limit Reached." | MMP has been triggered and the user must [PATCH] /v1/grfq/mmp/status to reset the protection to be able to quote. |
GRFQ: [PATCH] /rfqs/{rfq_id}/quotes/{quote_id}/
/rfqs/{rfq_id}/quotes/ Request example
# built ins
import base64
import hmac
import time
import json
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# PATCH /v1/grfq/rfqs/{rfq_id}/quotes/{quote_id}/
method = 'PATCH'
path = '/v1/grfq/rfqs/1230/quotes/45678/'
payload = {
"account": "ParadigmTestNinetyFive",
"client_order_id": "1223322132123123321",
"quantity": "5000000",
"side": "BUY",
"legs": [
{
"instrument": "BTC-PERPETUAL",
"price": "38501"
}
],
"post_only": True
}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.patch(host+path,
headers=headers,
json=payload)
print(response.status_code)
print(response.text)
/rfqs/{rfq_id}/quotes/{quote_id}/ Response example
{
"id":2776054,
"created":1631589942042.397,
"last_activity":1631589942042.415,
"maker":"DSK95",
"price":"0.09",
"remaining_quantity":"24",
"side":"BUY",
"status":"CLOSED",
"client_order_id":"stri1231321232121223231321132312213ng",
"order":{
"id":266318,
"client_order_id":"stri1231321232121223231321132312213ng",
"filled_quantity":"0",
"filled_average_price":"0",
"limit_price":"0.09",
"requested_quantity":"50",
"rfq_id":2073,
"side":"BUY",
"status":"OPEN",
"venue":"DBT"
},
"original_quantity":"24",
"filled_quantity":"0",
"rfq_id":2073,
"account":"ParadigmTestNinetyFive"
}
Important note: this endpoint is proposed for deprecation, please use [PUT] /rfqs/{rfq_id}/quotes/{quote_id}/ instead.
A [PATCH] /rfqs/{rfq_id}/quotes/{quote_id}/ request replaces an existing Quote upon a specific RFQ.
Takers & Makers use this endpoint to cross the existing market or update a resting Limit Order. Remaining amounts of the Quote remain on the Quote Book in the event of crossing.
If post_only == true and the submitted Quote crosses the existing market, the Quote is canceled in its entirety. This ensures you are always a Maker.
If a user submits a Quote which crosses the existing market, you will receive messages on both the quote and order JSON-RPCoverWebSockets Notification channels.
Takers are only able to execute two times every five seconds due to Paradigm's Market Maker Protection feature.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| rfq_id | endpoint | string | true | The unique Paradigm created identifier of the RFQ. |
| quote_id | endpoint | string | true | The unique Paradigm created identifier of the Quote being replaced. |
| account | body | string | true | The name of the Exchange API Key entered on your Client Admin dashboard. |
| client_order_id | body | string | true | A unique user created identifier for the Quote. |
| legs | body | array of objects | true | Array of objects containing the strategy’s legs' quotes' attributes. |
| > instrument | body | string | true | The Paradigm standardized name of the Instrument. |
| > price | body | string | true | The price of the individual leg's Instrument. |
| quantity | body | string | true | The total quantity of the strategy in contract units of the RFQ. |
| side | body | string | true | The direction of the Quote. Valid values include BUY and SELL. |
| post_only | body | boolean | false | If true, the quote is canceled and never enters the Quote Book if it crosses the existing market. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| id | int | true | The Paradigm created unique identifier of the Quote. |
| created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| last_activity | number | true | The time in unix milliseconds since the epoch when the Quote was updated. |
| maker | string | true | The Paradigm desk name that created the Quote. |
| price | string | true | The price of the strategy in the Quote Currency of the RFQ. |
| remaining_quantity | string | true | Total size of the Quote in contract units of the RFQ remaining. |
| side | string | true | The direction of the Quote. Valid values include BUY and SELL. |
| status | string | true | The status of the Quote. Valid values include OPEN, CLOSED. |
| client_order_id | string | true | A unique user created identifier for the Quote. |
| order | object | false | Present if Quote crosses the existing market. |
| > id | int | false | The Paradigm created unique identifier of the Order. |
| > client_order_id | string | false | A unique user created identifier for the Order. |
| > filled_quantity | string | false | The filled quantity of the Order in the contract units of the RFQ. |
| > filled_average_price | string | false | The average filled price of the Order in the quote currency of the RFQ. |
| > limit_price | string | false | The price of the Order in quote currency of the RFQ. |
| > requested_quantity | string | false | The requested crossing quantity of the Order. |
| > rfq_id | int | false | The Paradigm created unique identifier of the RFQ the Order is a child of. |
| > side | string | false | The direction of the Order. Valid values include BUY and SELL. |
| > status | string | false | The current status of the Order. Valid values include OPEN and CLOSED. |
| > venue | string | false | Underlying venue RFQ is cleared & settled upon. Valid values include DBT, BIT, BYB. |
| original_quantity | string | true | Initial size of the Quote in contract units of the RFQ. |
| filled_quantity | string | true | The successfully executed size of the Quote in contract units of the RFQ. |
| rfq_id | int | true | The Paradigm created unique identifier of the RFQ the Quote is a child of. |
| account | string | true | The name of the Exchange API Key entered on your Client Admin dashboard. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 400 | 100 | "Invalid parameters" | Invalid parameters in request such as a non-unique client_order_id value. |
| 400 | 1302 | "Invalid account information" | The value provided with the account key should match the name given to the Exchange API key on the Paradigm Client Admin Dashboard. |
| 400 | 3203 | "Invalid leg parameters" | Ensure you are attempting to quote on the correct RFQ. Check your request format is correct. |
| 400 | 3303 | "An active BUY(SELL)-side quote already exists. Please cancel that quote before submitting a new quote." | Refer to error message. |
| 400 | 3304 | "Your Bid/Ask was canceled. It crossed the available Ask/Bid." | This occurs when you specify post_only == true and the submitted Quote crosses the market or if you cross your own existing Quote. |
| 400 | 3304 | "{instrument_name}. Bid/Ask price cannot be greater than Ask/Bid Price." | This occurs when the Bid/Ask price of a leg in the submitted Quote is greater than the Ask/Bid price of the same leg in an existing Quote. |
| 403 | N/A | "Maker Execution Limit Reached." | MMP has been triggered and the user must [PATCH] /v1/grfq/mmp/status to reset the protection to be able to quote. |
GRFQ: [POST] /pricing/
/pricing/ Request example
# built ins
import base64
import hmac
import time
import json
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# POST /v1/grfq/pricing/
method = 'POST'
path = '/v1/grfq/pricing/'
payload = {
"venue": "DBT",
"bid_price": "7950",
"ask_price": "9600",
"legs": [
{
"ratio": "1",
"instrument": "BTC-PERPETUAL",
"side": "BUY"
},
{
"ratio": "1",
"instrument": "BTC-31DEC21",
"side": "SELL"
}
]
}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.post(host+path,
headers=headers,
json=payload)
print(response.status_code)
print(response.text)
/pricing/ Response example
{
"bid_prices":[
"32655.32",
"24705.32"
],
"ask_prices":[
"33606.76",
"24006.76"
]
}
A [POST] /pricing/ request will return the individual leg prices of a proposed Quote.
This endpoint does not create a Quote or complete any operation upon the matching engine.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| venue | body | string | true | The underlying venue the Instruments in the RFQ are cleared & settled upon. Valid values include DBT, BIT, and BYB. |
| bid_price | body | string | true | The total price of the Quote when the side is equal to BUY. |
| ask_price | body | string | true | The total price of the Quote when the side is equal to SELL. |
| legs | body | array of objects | true | The individual legs of the RFQ. |
| > ratio | body | string | true | The quantity multiplier for the Strategy leg. |
| > instrument | body | string | true | The name of the leg's Instrument per the underlying venue's naming convention. |
| > side | body | string | true | The direction of the leg. Valid values include BUY and SELL. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| bid_prices | array of numbers | true | The individual leg prices of the BUY sided quote in the order legs proposed in the user’s request. |
| ask_prices | array of numbers | true | The individual leg prices of the SELL sided quote in the order legs proposed in the user’s request. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 400 | 3002 | "Invalid leg pricing parameters" | Invalid leg pricing parameters was requested. |
| 400 | 3304 | "Quote price {-2100.32} outside strategy price bands ({7902.18} / {9627.5})" |
Quote must be within these price bands. |
GRFQ: [GET] /rfqs/{rfq_id}/bbo
/rfqs/{rfq_id}/bbo Request example
# You can also use wget
curl -X POST https://api.testnet.paradigm.trade/v1/grfq/rfqs/131/bbo/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = 'Z9gBdD05yiHLotRCxrSeFTfC'
secret_key = b'9qgG7DU0XNaqF9n5Q35iQtL5Bv7JFNUffagT7/qC9jlH0exj'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/grfq/rfqs/{rfq_id}/bbo
method = 'GET'
path = '/v1/grfq/rfqs/579/bbo'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/rfqs/{rfq_id}/bbo Response example
{
"venue":"DBT",
"best_bid":{
"price":"-33118.5",
"quantity":"0"
},
"best_ask":{
"price":"-1118",
"quantity":"148640"
},
"greeks": {
"delta": "0.00466",
"gamma": "0.00001",
"theta": "-0.02436",
"vega": "0.20599",
},
"leg_prices":[
{
"instrument":"BTC-PERPETUAL",
"best_bid_price":"33118",
"best_bid_quantity":"148640",
"best_ask_price":"33118.5",
"best_ask_quantity":"491190",
"mark_price":"33077.21",
"timestamp":1625189984659,
"best_bid_iv": null,
"best_ask_iv": null,
"mark_price_iv": null,
"greeks": null,
},
{
"instrument":"BTC-24JUN22",
"best_bid_price":"0",
"best_bid_quantity":"0",
"best_ask_price":"32000",
"best_ask_quantity":"990000",
"mark_price":"31948.95",
"timestamp":1625189984174,
"best_bid_iv": "0.00",
"best_ask_iv": "110.18",
"mark_price_iv": "53.02",
"greeks": {
"delta": "0.00466",
"gamma": "0.00001",
"theta": "-0.02436",
"vega": "0.20599",
},
}
],
"mark_price":"-1128.26",
"product_code":"CF"
}
A [GET] /rfqs/{rfq_id}/bbo request returns the best Bid/Offer information from the underlying venue for a specific RFQ.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | endpoint | string | true | The Paradigm created unique identifier of the RFQ. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| venue | string | true | The underlying venue where the RFQ's Instruments are cleared & settled. Valid values include DBT, BIT, and BYB. |
| best_bid | array of objects | true | |
| > price | string | true | The calculated best bid price of the RFQ’s strategy per the legs' underlying screen price in the Quote Currency of the RFQ. |
| > quantity | string | true | The calculated best bid price of the RFQ’s strategy per the legs' underlying screen quantity in contract units of the RFQ. |
| best_ask | array of objects | true | |
| > price | string | true | The calculated best ask price of the RFQ’s strategy per the legs' underlying screen price in the Quote Currency of the RFQ. |
| > quantity | string | true | The calculated best ask price of the RFQ’s strategy per the legs' underlying screen quantity in contract units of the RFQ. |
| greeks | object | false | An object of variables used to assess the risk & exposure of a derivatives contract. |
| > delta | string | true | The delta value of the strategy. |
| > theta | string | true | The theta value of the strategy. |
| > vega | string | true | The vega value of the strategy. |
| > gamma | string | true | The gamma value of the strategy. |
| leg_prices | array of objects | true | |
| > instrument | string | true | The Paradigm standardized name of the Instrument. |
| > best_bid_price | string | true | The best bid on the underlying exchange’s Instrument Quote Book in the Quote Currency of the Instrument. |
| > best_bid_quantity | string | true | The best bid’s quantity on the underlying exchange’s Instrument Quote Book in contract units of the RFQ. |
| > best_ask_price | string | true | The best ask on the underlying exchange’s Instrument Quote Book in the Quote Currency of the Instrument. |
| > best_ask_quantity | string | true | The best ask’s quantity on the underlying exchange’s Instrument Quote Book in contract units of the RFQ. |
| > mark_price | string | true | The Mark price from the underlying exchange for specific Instrument in the Quote Currency of the Instrument. |
| > mark_price_iv | string | true | The Instrument’s mark price IV (implied volatility) from the underlying settlement venue. Set to null if the value is not available. |
| > best_bid_iv | string | true | The Instrument’s best bid IV (implied volatility) from the underlying settlement venue’s Order Books. Set to null if the value is not available. |
| > best_ask_iv | string | true | The Instrument’s best ask IV (implied volatility) from the underlying settlement venue’s Order Books. Set to null if the value is not available. |
| > timestamp | number | true | The time in unix milliseconds since the epoch when the data was returned from the underlying venue. |
| > greeks | object | false | An object of variables used to assess the risk & exposure of a derivatives contract. |
| >> delta | string | true | The delta value of the leg's Instrument. |
| >> theta | string | true | The theta value of the leg's Instrument. |
| >> vega | string | true | The vega value of the leg's Instrument. |
| >> gamma | string | true | The gamma value of the leg's Instrument. |
| mark_price | string | true | The calculated Mark Price of the strategy in the Quote Currency of the RFQ. |
| product_code | string | true | The Paradigm created Product Code of in the Instruments involved in the RFQ. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 400 | 3300 | "Unavailable RFQ" | RFQ is unavailable to be priced. |
GRFQ: [GET] /rfqs/{rfq_id}/quotes/
/rfqs/{rfq_id}/quotes/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/grfq/rfqs/131/quotes/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/grfq/rfqs/{rfq_id}/quotes/
method = 'GET'
path = '/v1/grfq/rfqs/576/quotes/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/rfqs/{rfq_id}/quotes/ Response example
{
"id":576,
"bids":[
{
"created":1625167826211.088,
"last_activity":1625167826211.088,
"id":152748,
"price":"0.0078",
"remaining_quantity":"29943.7",
"side":"BUY",
"status":"OPEN",
"legs": [{"price": "1234", "side": "SELL"},{"price": "1235", "side": "BUY"}]
}
],
"asks":[
{
"created":1625173113830.57,
"last_activity":1625173113830.57,
"id":152762,
"price":"0.0084",
"remaining_quantity":"33.7",
"side":"SELL",
"status":"OPEN",
"legs": [{"price": "1234", "side": "SELL"},{"price": "1235", "side": "BUY"}]
}
]
}
A [GET] /rfqs/{rfq_id}/quotes/ request returns the OPEN Quotes upon the RFQ.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | endpoint | string | true | The Paradigm created unique identifier of the RFQ. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| id | int | true | The Paradigm created unique identifier of the RFQ. |
| bids | array of objects | true | Empty array if no Quotes are available. |
| > created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| > last_activity | number | true | The time in unix milliseconds since the epoch when the Quote was updated. |
| > id | int | true | The Paradigm created unique identifier of the Quote. |
| > maker | string | false | The Paradigm Desk Name of the Maker who created the quote. Only visible if requester is the Maker. |
| > remaining_quantity | string | true | The total remaining size of the Quote in the contract units of the RFQ. |
| > price | string | true | The price of the Quote in the Quote Currency of the RFQ. |
| > side | string | true | The direction of the Quote. Valid values include BUY. |
| > status | string | true | The status of the Quote. Valid values include OPEN |
| > legs | array of objects | true | The price and side of the legs |
| >> price | string | true | The price of individual legs |
| >> side | string | true | The BUY or SELL side of the individual legs |
| asks | array of objects | true | Empty array if no Quotes are available. |
| > created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| > id | int | true | The Paradigm created unique identifier of the Quote. |
| > maker | string | false | The Paradigm Desk Name of the Maker who created the quote. Only visible if requester is the Maker. |
| > remaining_quantity | string | true | The total remaining size of the Quote in the contract units of the RFQ. |
| > price | string | true | The price of the Quote in the Quote Currency of the RFQ. |
| > side | string | true | The direction of the Quote. Valid values include SELL. |
| > status | string | true | The status of the Quote. Valid values include OPEN |
| > legs | array of objects | true | The price and side of the legs |
| >> price | string | true | The price of individual legs |
| >> side | string | true | The BUY or SELL side of the individual legs |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials |
| 400 | 3300 | "Unavailable RFQ" | RFQ is unavailable to be priced. |
GRFQ: [GET] /trades/
/trades/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/grfq/trades/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
import json
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/grfq/trades/
method = 'GET'
path = '/v1/grfq/trades/'
payload = {}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers,
json=payload)
print(response.status_code)
print(response.text)
/trades/ Response example
{
"count":909,
"next":"cD0yMDIxLTA3LTI3KzE2JTNBMjElM0EyMC40MTQ3MjMlMkIwMCUzQTAw",
"results":[
{
"id":1221,
"description":"FSpd Perpetual / 31 Dec 21",
"desk_role":"Maker",
"mark_price":"1544.18",
"order_id":1094,
"price":"1550",
"product_codes":[
"CF"
],
"quantity":"10000",
"quote_currency":"USD",
"quote_id":616016,
"rfq_id":1178,
"strategy_code":"FS",
"traded":1627440685659.369,
"venue":"DBT",
"action":"BUY",
"api_credential":"ParadigmTestNinetyFive",
"client_order_id":"",
"status":"COMPLETED"
},
{
"id":1219,
"description":"Cstm -13.3 Future Perpetual\n +1 Future 30 Jul 21\n +19.9 Future 6 Aug 21",
"mark_price":"289592.31",
"price":"289467.236",
"product_code":"CF",
"quantity":"586",
"quote_currency":"USD",
"rfq_id":1176,
"strategy_code":"CM",
"traded":1627419839512.485,
"venue":"DBT"
},
{
"id":1217,
"description":"Cstm +1 Put 30 Jul 21 38000\n -1 Put 30 Jul 21 40000",
"mark_price":"-0.0285",
"price":"-0.0005",
"product_code":"DO",
"quantity":"13",
"quote_currency":"BTC",
"rfq_id":1174,
"strategy_code":"CM",
"traded":1627418321044.7131,
"venue":"DBT"
},
{
"id":1216,
"description":"Cstm +1 Future Perpetual\n +1.7 Future 31 Dec 21\n +2.8 Future 24 Sep 21",
"mark_price":"210922.959",
"price":"211492",
"product_code":"BB",
"quantity":"5",
"quote_currency":"USD",
"rfq_id":1172,
"strategy_code":"CM",
"traded":1627402886964.928,
"venue":"BYB"
},
{
"id":1215,
"description":"Cstm +1 Future Perpetual\n +1.7 Future 31 Dec 21\n +2.8 Future 24 Sep 21",
"mark_price":"211042.936",
"price":"211492",
"product_code":"BB",
"quantity":"4",
"quote_currency":"USD",
"rfq_id":1172,
"strategy_code":"CM",
"traded":1627402880414.723,
"venue":"BYB"
}
]
}
A [GET] /trades/ request returns all completed Trades on Paradigm.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | The pagination page to return. Valid determined by the next key value in the response. |
| hide_public | query | string | false | Hide non-participant trades from results. Valid values include true and false. |
| page_size | query | string | false | The number of Trades to return per pagination. |
| status | query | string | false | The state of the Trades to return. Valid values include PENDING, COMPLETED, REJECTED. |
| product_codes | query | string | false | The Paradigm created Product Codes of the composite Instruments. The request can contain multiple codes such as ?product_codes=DO,CF. |
| strategies | query | string | false | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | int | true | Total number of Trades to paginate through from request. |
| next | string | true | null if no more pages to paginate. The value used for the cursor query string parameter to paginate pages. |
| results | array of objects | true | |
| > id | int | true | The Paradigm created unique identifier of the Trade. |
| > description | string | true | The description of the RFQ. |
| > desk_role | string | false | The role in the trade if the desk is either the Taker or the Maker of the trade. Valid values: Taker, Maker. |
| > mark_price | string | true | The mark price of the RFQ at execution in the Quote Currency of the RFQ using the underlying venue's mark price(s) of the RFQ. |
| > order_id | int | false | The Paradigm created unique identifier of the Order if the user is the Taker of the Trade. |
| > price | string | true | The price in the Quote Currency of the RFQ of the Trade. |
| > product_codes | array of strings | true | The Paradigm created product codes being traded in the RFQ. |
| > quantity | string | true | The size of the trade in contract units of the RFQ. |
| > quote_currency | string | true | The Quote Currency of the RFQ. |
| > rfq_id | int | true | The Paradigm created unique identifier of the RFQ. |
| > strategy_code | string | true | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
| > status | string | true | Trade status. Valid values include PENDING, COMPLETED, REJECTED. |
| > traded | number | true | The time in unix milliseconds since the epoch when the was cleared & settled at. |
| > venue | string | true | The underlying venue the Trade was cleared & settled upon. Valid values include DBT, BIT, BYB. |
| > action | string | false | The side of the Order. Only available if the requester is the Taker of the Trade. Valid values include BUY and SELL. |
| > api_credential | string | false | The name of the exchange API key used to execute upon the Quote. Only available if the requester is the Taker to the Trade. |
| > client_order_id | string | false | The user created Order label if the user is the Taker of the Trade. |
| > quote_id | int | false | The Paradigm created unique identifier of the executed Quote. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
GRFQ: [GET] /trades/{trade_id}/
/trades/{trade_id}/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/grfq/trades/50/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/grfq/trades/{trade_id}/
method = 'GET'
path = '/v1/grfq/trades/473/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/trades/{trade_id}/ Response example - User's Trade
COMPLETED
{
"id":1221,
"description":"FSpd Perpetual / 31 Dec 21",
"desk_role":"Taker",
"mark_price":"1544.18",
"order_id":1094,
"price":"1550",
"product_codes":[
"CF"
],
"quantity":"10000",
"quote_currency":"USD",
"quote_id":616016,
"rfq_id":1178,
"traded":1627440685659.369,
"venue":"DBT",
"action":"BUY",
"api_credential":"ParadigmTestNinetyFive",
"client_order_id":"",
"status":"COMPLETED",
"legs":[
{
"id":1989,
"instrument":"BTC-PERPETUAL",
"price":"39952.58",
"product_code":"CF",
"quantity":"10000",
"ratio":"1",
"side":"SELL",
"action":"SELL",
"exec_id":"77508944"
},
{
"id":1990,
"instrument":"BTC-31DEC21",
"price":"41502.58",
"product_code":"CF",
"quantity":"10000",
"ratio":"1",
"side":"BUY",
"action":"BUY",
"exec_id":"77508943"
}
]
}
/trades/{trade_id}/ Response example - User's Trade
REJECTED
{
"id":1220,
"description":"FSpd Perpetual / 31 Dec 21",
"desk_role":"Maker",
"mark_price":"1537.57",
"order_id":1093,
"price":"1550",
"product_codes":[
"CF"
],
"quantity":"10000",
"quote_currency":"USD",
"quote_id":616014,
"rfq_id":1178,
"traded":1627440566959.332,
"venue":"DBT",
"action":"BUY",
"api_credential":"ParadigmTestNinetyFive",
"client_order_id":"",
"status":"REJECTED",
"legs":[
{
"id":1987,
"instrument":"BTC-PERPETUAL",
"price":"39900.66",
"product_code":"CF",
"quantity":"10000",
"ratio":"1",
"side":"SELL",
"action":"SELL",
"exec_id":null
},
{
"id":1988,
"instrument":"BTC-31DEC21",
"price":"41450.66",
"product_code":"CF",
"quantity":"10000",
"ratio":"1",
"side":"BUY",
"action":"BUY",
"exec_id":null
}
]
}
/trades/{trade_id}/ Response example - User is not a counterparty on the trade, and trade is
COMPLETED
{
"id":587,
"description":"Call 22 Oct 21 52000",
"mark_price":"0.0788",
"price":"0.09",
"product_codes":[
"DO"
],
"quantity":"25",
"quote_currency":"BTC",
"rfq_id":1118,
"traded":1634064072771.3809,
"venue":"DBT",
"legs":[
{
"id":862,
"instrument":"BTC-22OCT21-52000-C",
"price":"0.09",
"product_code":"DO",
"quantity":"25",
"ratio":"1",
"side":"BUY"
}
]
}
A [GET] /trades/{trade_id}/ request returns a specific Trade on Paradigm.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | query | string | true | The Paradigm created unique identifier of the Trade. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | int | true | Total number of Trades to paginate through from request. |
| next | string | true | null if no more pages to paginate. The value used for the cursor query string parameter to paginate pages. |
| results | array of objects | true | |
| > id | int | true | The Paradigm created unique identifier of the Trade. |
| > description | string | true | The description of the RFQ. |
| > desk_role | string | false | The role in the trade if the desk is either the Taker or the Maker of the trade. Valid values: Taker, Maker. |
| > mark_price | string | true | The mark price of the RFQ at execution in the Quote Currency of the RFQ using the underlying venue's mark price(s) of the RFQ. |
| > price | string | true | The price in the Quote Currency of the RFQ of the Trade. |
| > product_codes | array of strings | true | The Paradigm created product codes being traded in the RFQ. |
| > quantity | string | true | The size of the trade in contract units of the RFQ. |
| > quote_currency | string | true | The Quote Currency of the RFQ. |
| > rfq_id | int | true | The Paradigm created unique identifier of the RFQ. |
| > traded | number | true | The time in unix milliseconds since the epoch when the was cleared & settled at. |
| > venue | string | true | The underlying venue the Trade was cleared & settled upon. Valid values include DBT, BIT, BYB. |
| > legs | array of objects | true | |
| >> id | int | false | The Paradigm created unique individual leg trade identifier. |
| >> instrument | string | true | The Paradigm standardized name of the Instrument. |
| >> quantity | string | true | The size of the leg traded in contract unit terms. |
| >> price | string | true | The price of the leg traded in the Quote Currency of the RFQ. |
| >> product_code | string | true | The Paradigm created product code of the Instrument traded. |
| >> ratio | string | true | The quantity multiplier relative to other Instrument legs. |
| >> side | string | false | The direction of the leg of the original RFQ. Valid values include BUY and SELL. This does not reveal the direction of the Trade. |
| >> action | string | false | The direction of the user for the specific leg of the RFQ. Valid values include BUY and SELL. |
| >> exec_id | string | false | The venue created unique identifier of the trade. |
| > api_credentials | string | false | The name of venue API key used by the user in the Trade. |
| > client_order_id | string | false | The user created unique identifier. |
| > status | string | true | If the trade successfully cleared & settled on the underlying venue. Valid values include COMPLETED and REJECTED. |
Error Codes
| HTTP Status Code | Message | Meaning |
|---|---|---|
| 401 | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 404 | "Not found." | Invalid Trade Id value requested. |
GRFQ: [GET] /trade_tape/
/trade_tape/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/grfq/trade_tape/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
import json
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/grfq/trade_tape/
method = 'GET'
path = '/v1/grfq/trade_tape/'
payload = {}
json_payload = json.dumps(payload)
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=json_payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers,
json=payload)
print(response.status_code)
print(response.text)
/trade_tape/ Response example
{
"count":909,
"next":"cD0yMDIxLTA3LTI3KzE2JTNBMjElM0EyMC40MTQ3MjMlMkIwMCUzQTAw",
"results":[
{
"id":1221,
"description":"FSpd Perpetual / 31 Dec 21",
"mark_price":"1544.18",
"price":"1550",
"product_codes":[
"CF"
],
"quantity":"10000",
"quote_currency":"USD",
"rfq_id":1178,
"strategy_code":"FS",
"traded":1627440685659.369,
"venue":"DBT",
"action":"BUY",
"instrument_kind":"FUTURE"
},
{
"id":1219,
"description":"Cstm -13.3 Future Perpetual\n +1 Future 30 Jul 21\n +19.9 Future 6 Aug 21",
"mark_price":"289592.31",
"price":"289467.236",
"product_codes":[
"CF"
],
"quantity":"586",
"quote_currency":"USD",
"rfq_id":1176,
"strategy_code":"CM",
"traded":1627419839512.485,
"venue":"DBT",
"action":"BUY",
"instrument_kind":"FUTURE"
},
]
}
A [GET] /trade_tape/ request returns all successfully cleared trades.
To return complete results, users must paginate by providing the response's next key value for the cursor query string parameter in the subsequent request.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | The pagination page to return. Valid determined by the next key value in the response. |
| page_size | query | string | false | The number of Trades to return per pagination. |
| product_codes | query | string | false | The Paradigm created Product Codes of the composite Instruments. The request can contain multiple codes such as ?product_codes=DO,CF. |
| strategies | query | string | false | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| count | int | true | Total number of Trades to paginate through from request. |
| next | string | true | null if no more pages to paginate. The value used for the cursor query string parameter to paginate pages. |
| results | array of objects | true | |
| > id | int | true | The Paradigm created unique identifier of the Trade. |
| > description | string | true | The description of the RFQ. |
| > mark_price | string | true | The mark price of the RFQ at execution in the Quote Currency of the RFQ using the underlying venue's mark price(s) of the RFQ. |
| > price | string | true | The price in the Quote Currency of the RFQ of the Trade. |
| > product_codes | array of strings | true | The Paradigm created product codes being traded in the RFQ. |
| > quantity | string | true | The size of the trade in contract units of the RFQ. |
| > quote_currency | string | true | The Quote Currency of the RFQ. |
| > rfq_id | int | true | The Paradigm created unique identifier of the RFQ. |
| > strategy_code | string | true | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
| > traded | number | true | The time in unix milliseconds since the epoch when the was cleared & settled at. |
| > venue | string | true | The underlying venue the Trade was cleared & settled upon. Valid values include DBT, BIT, BYB. |
| > instrument_kind | string | true | The type of contract. Valid values include FUTURE, OPTION. |
| > action | string | false | The side of the Order from the perspective of the Taker. |
Error Codes
| HTTP Status Code | Code | Message | Meaning |
|---|---|---|---|
| 400 | 3005 | "Invalid filter parameter" | You provided invalid value to one or more filter parameters. |
| 401 | N/A | "Authentication credentials provided were not provided." | You did not provide authentication credentials. |
| 404 | N/A | "Invalid cursor" | Use the string value from the next key in the first response to paginate. |
GRFQ: [GET] /mmp/status/
/mmp/status/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/grfq/mmp/status/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# GET /v1/grfq/mmp/status/
method = 'GET'
path = '/v1/grfq/mmp/status/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/mmp/status/ Response example
{
"rate_limit_hit": false
}
A [GET] /mmp/status/ request returns the desk's Market Maker Protection (MMP) status. MMP Status applies on both DRFQ and GRFQ.
This endpoint takes no parameters as part of the request.
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| rate_limit_hit | bool | true | A flag indicating if rate limit was hit |
GRFQ: [PATCH] /mmp/status/
/mmp/status/ Request example
# You can also use wget
curl -X PATCH https://api.testnet.paradigm.trade/v1/grfq/mmp/status/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
# PATCH /v1/grfq/mmp/status/
method = 'PATCH'
path = '/v1/grfq/mmp/status/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.patch(host+path,
headers=headers)
print(response.status_code)
print(response.text)
A [PATCH] /mmp/status/ resets the Market Maker Protection (MMP) if triggered and enables the user to create new Quotes. MMP Status applies on both DRFQ and GRFQ.
This endpoint takes no parameters as part of the request.
Response Schema
This request will return an HTTP Status Code of 204 to indicate success of operation.
Status Code 204
GRFQ: [GET] /platform_state/
/platform_state/ Request example
# You can also use wget
curl -X GET https://api.testnet.paradigm.trade/v1/grfq/platform_state/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-key>'
# built ins
import base64
import hmac
import time
# installed
import requests
access_key = '<access-key>'
secret_key = b'<secret-key>'
def sign_request(secret_key, method, path, body):
signing_key = base64.b64decode(secret_key)
timestamp = str(int(time.time() * 1000)).encode('utf-8')
message = b'\n'.join([timestamp, method.upper(), path, body])
digest = hmac.digest(signing_key, message, 'sha256')
signature = base64.b64encode(digest)
return timestamp, signature
# Request Host
host = 'https://api.testnet.paradigm.trade'
method = 'GET'
path = '/v1/grfq/platform_state/'
payload = ''
timestamp, signature = sign_request(secret_key=secret_key,
method=method.encode('utf-8'),
path=path.encode('utf-8'),
body=payload.encode('utf-8'),
)
headers = {
'Paradigm-API-Timestamp': timestamp,
'Paradigm-API-Signature': signature,
'Authorization': f'Bearer {access_key}'
}
# Send request
response = requests.get(host+path,
headers=headers)
print(response.status_code)
print(response.text)
/platform_state/ Response example
{
"platform_state":"AVAILABLE",
"published_at":1652323645414,
"next_platform_state":"UNAVAILABLE",
"next_platform_state_at":1653949623000
}
A [GET] /platform_state request allows the user to return the present market availability state.
The Product and Account Management team will communicate expectations around market availability including the next_platform_state and the timing by the next_platform_state_at response key.
Markets can only be in three market availability states:
AVAILABLE- Normal Trading with no restrictions.UNAVAILABLE- No [POST], [PUT], or [DELETE] requests are allowed. All [GET] requests are allowed. Markets are locked and no trading is able to occur.AVAILABLE_CANCEL_ONLY- No [POST] or [PUT] requests are allowed. All [GET] requests are allowed. Markets are locked and no trading is able to occur.
This endpoint takes no parameters as part of the request.
Response Schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| platform_state | string | true | The state of the market. Valid values include AVAILABLE, UNAVAILABLE, AVAILABLE_CANCEL_ONLY. |
| published_at | decimal | true | Time of update in unix milliseconds since the epoch. |
| next_platform_state | string | true | The next expected platform_state. Valid values include AVAILABLE, UNAVAILABLE, AVAILABLE_CANCEL_ONLY. |
| next_platform_state_at | decimal | true | Expected time of the next platform_state update in unix milliseconds since the epoch. |
GRFQv1 - WebSocket Notifications Channels
GRFQ: rfq
An example of the
rfqnotification received when an RFQ is created
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"rfq",
"data":{
"kind":"ADDED",
"rfq":{
"id":1232,
"created":1628038165427.771,
"description":"Call 4 Aug 21 39000",
"last_trade":null,
"latest_activity":1628038165427.839,
"product_codes":[
"DO"
],
"status":"ACTIVE",
"strategy_code": "CP",
"venue":"DBT",
"legs":[
{
"instrument":"BTC-4AUG21-39000-C",
"product_code":"DO",
"ratio":"1",
"venue_instrument":"BTC-4AUG21-39000-C",
"side":"BUY"
}
]
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
rfqnotification received when an RFQ expires
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"rfq",
"data":{
"kind":"REMOVED",
"rfq":{
"id":589,
"venue":"DBT",
"created":1625191497588.2312,
"description":"FSpd 2 Jul 21 / 25 Mar 22",
"last_trade":null,
"latest_activity":1625191497588.316,
"legs":[
{
"instrument":"BTC-2JUL21",
"venue_instrument":"BTC-2JUL21",
"product_code":"CF",
"ratio":"1",
"side":"SELL"
},
{
"instrument":"BTC-25MAR22",
"venue_instrument":"BTC-25MAR22",
"product_code":"CF",
"ratio":"1",
"side":"BUY"
}
],
"product_codes":[
"CF"
],
"status":"EXPIRED",
"strategy_code": "FS"
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
All updates relating to RFQs are sent through the rfq WebSocket Notifications channel.
This is a public channel and consumable by all.
Notifications received through the rfq WebSocket channel can include RFQ creations, expirations, and updates. Updates are used to update the latest_activity and last_trade fields while the rfq is active.
| Member | Type | Required | Description |
|---|---|---|---|
| channel | string | true | WebSocket Notification Channel message is received upon. Valid value is rfq. |
| data | object | true | |
| > kind | string | true | WS Action. Valid values include ADDED, REMOVED, UPDATED. |
| > rfq | object | true | |
| >> id | int | true | The Paradigm created unique identifier of the RFQ. |
| >> venue | string | true | The underlying venue the RFQ is cleared & settled upon. Valid values include DBT, BIT, and BYB. |
| >> created | number | true | Time in unix milliseconds since the epoch when the RFQ was created. |
| >> description | string | true | Paradigm created description of the RFQ. |
| >> last_trade | object | true | null if RFQ has not been traded. |
| >>> traded | number | false | Time in unix milliseconds since the epoch when the the Trade occurred. |
| >>> quantity | string | false | The size of the trade in the contract units of the RFQ. |
| >>> price | string | false | The price the RFQ was Traded at. |
| >> latest_activity | number | true | Time in unix milliseconds since the epoch when the RFQ was last acted upon. |
| >> legs | array of objects | true | |
| >>> instrument | string | true | The Paradigm standardized name of the Instrument. |
| >>> venue_instrument | string | true | The name of the Instrument per the underlying venue's naming convention. |
| >>> product_code | string | true | The Paradigm created product code of the Instrument. |
| >>> ratio | string | true | The quantity multiple relative to other legs. |
| >>> price | string | false | The price of the Instrument in the Quote Currency of the RFQ. |
| >>> side | string | true | The direction of the leg. Valid values include BUY and SELL. |
| >> product_codes | array of strings | true | Paradigm created product codes being traded in the RFQ. |
| >> status | string | true | Status of the RFQ. Valid values include ACTIVE and EXPIRED. |
| >> strategy_code | string | true | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
| meta | object | true | |
| > seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. |
| > seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired within seq_group |
GRFQ: quote_book
An example of the
quote_booknotification received when a Quote is newly added to the Quote Book
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"quote_book",
"data":{
"kind":"ADDED",
"quote":{
"remaining_quantity":"20000",
"side":"BUY",
"rfq_id":816,
"id":482396,
"price":"-9",
"status":"OPEN",
"created":1626155549137.585
"last_activity":1626155549137.600
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
quote_booknotification received when a Quote is removed from the Quote Book
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"quote_book",
"data":{
"kind":"REMOVED",
"quote":{
"id":482395,
"side":"SELL",
"created":1626155407461.441,
"last_activity":1626155407461.512,
"rfq_id":816,
"status":"CLOSED",
"price":"-13",
"remaining_quantity":"20000"
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
quote_booknotification received when a Quote is updated in the Quote Book
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"quote_book",
"data":{
"kind":"UPDATED",
"quote":{
"remaining_quantity":"1990000",
"side":"SELL",
"rfq_id":816,
"id":482399,
"price":"9",
"status":"OPEN",
"created":1626155762785.293
"last_activity":1626155762785.315
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
Updates relating to Quotes upon RFQs are sent through the quote_book WebSocket Notifications channel.
This is a public channel and is consumable by all. This is the channel you should use to create your own Quote Book & Executable Quote Book.
Updates received through the quote_book WebSocket Notification channel can include newly created quotes, removed quotes as well as updates to existing Quotes.
| Member | Type | Required | Description |
|---|---|---|---|
| channel | string | true | WebSocket Notification Channel message is received upon. |
| data | object | true | |
| > kind | string | true | The action of the message. Valid values include ADDED, REMOVED, UPDATED. |
| > quote | object | true | |
| > side | string | true | The side of the Quote from the Maker's perspective. Valid values include BUY and SELL. |
| > rfq_id | int | true | The Paradigm created unique identifier of the RFQ. |
| > id | int | true | The Paradigm created unique identifier of the Quote. |
| > price | string | true | The price in the Quote Currency of the RFQ. |
| > status | string | true | The status of the Quote. Valid values include OPEN, CLOSED. |
| > created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| > last_activity | number | true | The time in unix milliseconds since the epoch when the Quote was updated. |
| > remaining_quantity | string | true | The remaining Quantity upon the Quote in contract units of the RFQ. |
| meta | object | true | |
| > seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. |
| > seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired with seq_group. |
GRFQ: quote
An example of the
quotenotification received when a Quote is created
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"quote",
"data":{
"kind":"NEW",
"quote":{
"id":709037,
"status":"OPEN",
"maker":"DSK95",
"created":1628041444199.396,
"original_quantity":"50",
"filled_quantity":"0",
"rfq_id":1232,
"price":"0.004",
"remaining_quantity":"50",
"side":"BUY",
"client_order_id":"",
"account":"ParadigmTestNinetyFive"
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
quotenotification received when a Quote is canceled
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"quote",
"data":{
"kind":"CANCELED",
"quote":{
"id":2776215,
"order":{
"id":266357,
"client_order_id":"st121221",
"filled_quantity":"0",
"filled_average_price":"0",
"limit_price":"0.06",
"requested_quantity":"50",
"rfq_id":2073,
"side":"SELL",
"status":"OPEN",
"venue":"DBT"
},
"status":"CLOSED",
"maker":"DSK95",
"remaining_quantity":"22",
"side":"SELL",
"created":1631590685753.57,
"original_quantity":"22",
"filled_quantity":"0",
"client_order_id":"st12122",
"rfq_id":2073,
"price":"0.06",
"account":"ParadigmTestNinetyFive"
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
quotenotification received when a Quote is being executed upon
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"quote",
"data":{
"kind":"PENDING_FILL",
"quote":{
"original_quantity":"34",
"filled_quantity":"26",
"order":{
"id":266376,
"client_order_id":"st12122121",
"filled_quantity":"26",
"filled_average_price":"0.0904",
"limit_price":"0.1",
"requested_quantity":"60",
"rfq_id":2073,
"side":"BUY",
"status":"CLOSED",
"venue":"DBT"
},
"id":2776296,
"side":"BUY",
"price":"0.1",
"rfq_id":2073,
"created":1631591051681.613,
"status":"OPEN",
"client_order_id":"st121221",
"remaining_quantity":"7",
"maker":"DSK95",
"account":"ParadigmTestNinetyFive"
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
quotenotification received when a Quote has been partially filled
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"quote",
"data":{
"kind":"PARTIALLY_FILLED",
"quote":{
"rfq_id":816,
"id":482399,
"remaining_quantity":"1990000",
"status":"OPEN",
"client_order_id":"",
"price":"9",
"side":"SELL",
"created":1626155762785.2932,
"maker":"DSK95",
"original_quantity":"2000000"
"filled_quantity":"10000",
"account":"ParadigmTestNinetyFive"
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
quotenotification received when a Quote has been partially filled & is partially executed again
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"quote",
"data":{
"kind":"PENDING_FILL",
"quote":{
"maker":"DSK95",
"rfq_id":816,
"client_order_id":"",
"price":"-13",
"side":"SELL",
"id":482407,
"created":1626156440976.632,
"status":"OPEN",
"original_quantity":"50000",
"filled_quantity":"10000",
"remaining_quantity":"20000",
"account":"ParadigmTestNinetyFive"
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
quotenotification received when a Quote has been completely executed upon
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"quote",
"data":{
"kind":"PARTIALLY_FILLED",
"quote":{
"side":"BUY",
"rfq_id":2073,
"maker":"DSK95",
"status":"CLOSED",
"id":2776296,
"created":1631591051681.613,
"remaining_quantity":"7",
"order":{
"id":266376,
"client_order_id":"st12",
"filled_quantity":"26",
"filled_average_price":"0.0904",
"limit_price":"0.1",
"requested_quantity":"60",
"rfq_id":2073,
"side":"BUY",
"status":"CLOSED",
"venue":"DBT"
},
"price":"0.1",
"original_quantity":"34",
"filled_quantity":"26",
"client_order_id":"st12",
"account":"ParadigmTestNinetyFive"
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
All updates relating to Quotes upon RFQs are sent through the quote WebSocket Notifications channel.
This is a private channel and only provides updates to the Maker who created the Quote.
Updates received through the quote WebSocket Notification channel can include newly created quotes, removed quotes, quotes pending settlement & clearing, quotes which are partially filled as well as quotes which are completely filled.
Quotes which are executed upon and a rejection occurs at the underlying venue are canceled upon rejected. The remaining_quantity of the Quote is no longer available on the Quote Book. It does not matter which party is to blame, the Quote is kind == CANCELED and status == CLOSED.
Quotes which have been [PATCH] /rfqs/{rfq_id}/quotes/{quote_id}/ have the original quote kind == CANCELED and status == CLOSED and a new Quote with kind == NEW and status == OPEN.
Workflow Steps:
- Maker creates Quote.
kind==NEW&status==OPEN. - Taker partially executes upon Quote.
kind==PENDING_FILL&status==OPEN.- Upon finality at settlement & clearing, Maker receives
kind==PARTIALLY_FILLED&status==OPEN.
- Upon finality at settlement & clearing, Maker receives
- Taker partially executes upon already partially executed Quote.
kind==PENDING_FILL&status==OPEN.- Upon finality at settlement & clearing, Maker receives
kind==PARTIALLY_FILLED&status==OPEN.
- Upon finality at settlement & clearing, Maker receives
- Taker executes upon a Quote, but the Trade is rejected by the underlying venue.
kind==CANCELED&status==CLOSED. - Taker completely executes quote as so there is
0remaining_quantity.kind==FILLED&status==CLOSED.
| Member | Type | Required | Description |
|---|---|---|---|
| channel | string | true | WebSocket Notification Channel message is received upon. |
| data | object | true | |
| > kind | string | true | The action of the message. Valid values include NEW, CANCELED, PENDING_FILL, PARTIALLY_FILLED, FILLED. |
| > quote | object | true | |
| >> order | object | false | Present if Quote crosses the existing market. |
| >>> id | int | false | The Paradigm created unique identifier of the Order. |
| >>> client_order_id | string | false | A unique user created identifier for the Order. |
| >>> filled_quantity | string | false | The filled quantity of the Order in the contract units of the RFQ. |
| >>> filled_average_price | string | false | The average filled price of the Order in the quote currency of the RFQ. |
| >>> limit_price | string | false | The price of the Order in quote currency of the RFQ. |
| >>> requested_quantity | string | false | The requested crossing quantity of the Order. |
| >>> rfq_id | int | false | The Paradigm created unique identifier of the RFQ the Order is a child of. |
| >>> side | string | false | The direction of the Order. Valid values include BUY and SELL. |
| >>> status | string | false | The current status of the Order. Valid values include OPEN and CLOSED. |
| >>> venue | string | false | Underlying venue RFQ is cleared & settled upon. Valid values include DBT, BIT, BYB. |
| >> created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| >> client_order_id | string | false | A unique user created identifier for the Quote. Not present if th subscribed user is not the Maker. |
| >> id | int | true | The Paradigm created unique identifier of the Quote. |
| >> maker | string | true | The Paradigm desk name of the Maker. |
| >> original_quantity | string | true | The initial available quantity of the Quote in the contract units of the RFQ. |
| >> filled_quantity | string | true | The successfully executed size of the Quote in contract units of the RFQ. |
| >> price | string | true | The price of the Quote in the Quote Currency of the RFQ. |
| >> remaining_quantity | string | true | The remaining available quantity of the Quote in the contract units of the RFQ. |
| >> rfq_id | int | true | The Paradigm created unique identifier of the RFQ. |
| >> side | string | true | The side of the Quote. Valid values include BUY and SELL. |
| >> status | string | true | The status of the Quote. Valid values include OPEN and CLOSED. |
| >> account | string | true | The name of the Exchange API Key entered on your Client Admin dashboard. |
| venue_error | object | false | |
| > message | string | false | Example: "Deribit error: Trade rejected" |
| meta | object | true | |
| > seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. |
| > seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired with this identifier. |
GRFQ: order
An example of the
ordernotification received when an Order is Pending Fill
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"order",
"data":{
"kind":"PENDING_FILL",
"order":{
"id":1113,
"client_order_id":"",
"filled_quantity":"0",
"filled_average_price":"0",
"limit_price":"0.0054",
"requested_quantity":"25",
"rfq_id":1232,
"side":"BUY",
"status":"OPEN",
"venue":"DBT",
"quote":{
"side":"BUY",
"rfq_id":1232,
"status":"CLOSED",
"id":2776296,
"created":1631591051681.613,
"remaining_quantity":"0",
"price":"0.1",
"original_quantity":"0",
"filled_quantity":"0",
"client_order_id":""
}
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
ordernotification received when an Order has reached finality
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"order",
"data":{
"kind":"SUMMARY",
"order":{
"id":1113,
"client_order_id":"",
"filled_quantity":"25",
"filled_average_price":"0.0054",
"limit_price":"0.0054",
"requested_quantity":"25",
"rfq_id":1232,
"side":"BUY",
"status":"CLOSED",
"venue":"DBT",
"quote":{
"side":"BUY",
"rfq_id":1232,
"status":"CLOSED",
"id":2776296,
"created":1631591051681.613,
"remaining_quantity":"0",
"price":"0.1",
"original_quantity":"0",
"filled_quantity":"25",
"client_order_id":""
}
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
All updates relating to Orders upon RFQs are sent through the order WebSocket Notifications channel.
This is a private channel and only provides updates to the Taker who submitted the Order.
Updates received through the order WebSocket Notification channel can include a pending fill notification as well as a summary of an order's execution at finality. You will receive a single kind == PENDING_FILL and kind == SUMMARY per order execution regardless of the number of Quotes consumed.
It is important to be aware that executions can be rejected by exchanges. You should the difference between the requested_quantity and the filled_quantity in the messages to be aware of the success of the execution(s).
| Member | Type | Required | Description |
|---|---|---|---|
| channel | string | true | WebSocket Notification Channel message is received upon. |
| data | object | true | |
| > kind | string | true | The action of the message. Valid values include PENDING_FILL, SUMMARY. |
| > order | object | true | |
| >> id | int | true | The Paradigm created unique identifier of the Order. |
| >> client_order_id | string | true | The user created unique value associated with the Order. |
| >> filled_quantity | string | true | The filled quantity upon finality of the Order. |
| >> filled_average_price | string | true | The average price of the filled quantity of the Order upon finality. |
| >> limit_price | string | true | The price in the Quote currency of the RFQ of the Order. |
| >> requested_quantity | string | true | The requested quantity of the Order in the contract units of the RFQ. |
| >> rfq_id | int | true | The Paradigm created unique identifier of the RFQ. |
| >> side | string | true | The direction of the Order. Valid values include BUY and SELL. |
| >> status | string | true | The status of the Order. Valid values include OPEN, CLOSED. |
| >> venue | string | true | The underlying venue the trade was settled upon. Valid values include DBT, BIT, BYB. |
| >> quote | object | true | |
| >>> created | number | true | The time in unix milliseconds since the epoch when the Quote was created. |
| >>> client_order_id | string | false | A unique user created identifier for the Quote. |
| >>> id | int | true | The Paradigm created unique identifier of the Quote. |
| >>> maker | string | true | The Paradigm desk name of the Maker. |
| >>> original_quantity | string | true | The initial available quantity of the Quote in the contract units of the RFQ. |
| >>> filled_quantity | string | true | The successfully executed size of the Quote in contract units of the RFQ. |
| >>> price | string | true | The price of the Quote in the Quote Currency of the RFQ. |
| >>> remaining_quantity | string | true | The remaining available quantity of the Quote in the contract units of the RFQ. |
| >>> rfq_id | int | true | The Paradigm created unique identifier of the RFQ. |
| >>> side | string | true | The side of the Quote. Valid values include BUY and SELL. |
| >>> status | string | true | The status of the Quote. Valid values include OPEN and CLOSED. |
| meta | object | true | |
| > seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. |
| > seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired within seq_group |
GRFQ: trade
An example of the
tradenotification received when a Trade successfully settles and clears
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"trade",
"data":{
"kind":"CONFIRMATION",
"trade":{
"quote_id":709033,
"action":"BUY",
"id":1257,
"rfq_id":1232,
"order_id":1120,
"quantity":"25",
"product_codes":[
"DO"
],
"traded":1628040498333.169,
"api_credential":"ParadigmTestNinetySix",
"price":"0.0055",
"client_order_id":"",
"status":"COMPLETED",
"legs":[
{
"id":2044,
"instrument":"BTC-4AUG21-39000-C",
"price":"0.0055",
"product_code":"DO",
"quantity":"25",
"ratio":"1",
"side":"BUY",
"action":"BUY",
"exec_id":"78144401"
}
],
"venue":"DBT",
"mark_price":"0.0054",
"quote_currency":"BTC",
"description":"Call 4 Aug 21 39000",
"desk_role":"Maker"
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
An example of the
tradenotification received when a Trade is rejected at settlement and clearing
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"trade",
"data":{
"kind":"REJECTION",
"trade":{
"order_id":1121,
"quote_currency":"BTC",
"id":1258,
"mark_price":"0.0054",
"client_order_id":"",
"price":"0.0055",
"quote_id":709033,
"quantity":"25",
"traded":1628040604131.9612,
"action":"BUY",
"api_credential":"ParadigmTestNinetySix",
"status":"REJECTED",
"description":"Call 4 Aug 21 39000",
"desk_role":"Maker",
"product_codes":[
"DO"
],
"legs":[
{
"id":2045,
"instrument":"BTC-4AUG21-39000-C",
"price":"0.0055",
"product_code":"DO",
"quantity":"25",
"ratio":"1",
"side":"BUY",
"action":"BUY",
"exec_id":null
}
],
"venue":"DBT",
"rfq_id":1232
}
},
"venue_error":{
"message":"DBT Error: Trade refused by exchange"
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
Updates relating to Trades upon RFQs are sent through the trade WebSocket Notifications channel.
This is a private channel and only provides updates to the Taker & Maker of the Trade (matching of an Order and a Quote).
Updates received through the trade WebSocket Notification channel can include trade success and rejection at clearing & settlement.
| Member | Type | Required | Description |
|---|---|---|---|
| channel | string | true | WebSocket Notification Channel message is received upon. |
| data | object | true | |
| > kind | string | true | The action of the WS Message. Valid values include CONFIRMATION and REJECTION. |
| > trade | object | true | |
| >> api_credential | string | false | The name given the to the Exchange API Key entered on the Paradigm Client Admin dashboard. |
| >> description | false | true | The Paradigm created description of the RFQ. |
| >> desk_role | string | false | The role in the trade if the desk is either the Taker or the Maker of the trade. Valid values: Taker, Maker |
| >> client_order_id | string | true | A unique user created identifier for the Quote (Maker) or trade Order (Taker). |
| >> rfq_id | int | true | The Paradigm created unique identifier of the RFQ. |
| >> id | int | true | The Paradigm created unique identifier of the Trade. |
| >> mark_price | string | false | The calculated mark price of the RFQ from the underlying venue's mark prices in the Quote Currency of the RFQ. |
| >> order_id | int | false | The Paradigm created unique identifier of the Order that triggered execution. |
| >> price | string | false | The price the Trade was executed at in the Quote Currency of the RFQ. |
| >> product_codes | array of strings | false | The Paradigm created Product Codes of the trade. |
| >> quantity | string | false | The size of the trade in contracts units of the RFQ. |
| >> quote_currency | string | false | The Quote Currency of the RFQ executed upon. |
| >> quote_id | int | false | The Paradigm created unique identifier of the Quote executed upon. |
| >> action | string | false | The direction of the Trade from the perspective of the User. Valid values include BUY and SELL. |
| >> status | string | true | Trade status. Valid values include COMPLETED, REJECTED. |
| >> traded | number | false | The time in unix milliseconds since the epoch when the trade was cleared & settled. |
| >> venue | string | true | Venue the underlying RFQ clears and settles upon. Valid values include DBT, BIT, BYB. |
| >> legs | array of objects | true | |
| >>> id | int | true | The Paradigm created unique individual leg trade identifier. |
| >>> exec_id | string | false | The venue created leg trade execution identifier. Only available to participants of the trade. |
| >>> instrument | string | true | The Paradigm standardized name of the Instrument. |
| >>> quantity | string | true | The size of the leg traded in contract unit terms. |
| >>> price | string | true | The price of the leg traded in the Quote Currency of the RFQ. |
| >>> product_code | string | true | The Paradigm created product code of the Instrument traded. |
| >>> ratio | string | true | The quantity multiplier relative to other Instrument legs. |
| >>> side | string | true | The direction of the leg of the RFQ. Valid values include BUY, SELL. |
| >>> action | string | true | The direction of the leg from the user's perspective Traded. Valid values include BUY, SELL. |
| venue_error | object | false | Only present if the Trade was rejected by the underlying venue. |
| > message | string | false | Reason the trade was rejected by the underlying venue. |
| meta | object | true | |
| > seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. |
| > seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired with this identifier. |
GRFQ: trade_tape
An example of the
trade_tapenotification received when a trade settles & clears
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"trade_tape",
"data":{
"kind":"COMPLETED",
"trade":{
"id":1260,
"description":"Call 4 Aug 21 39000",
"mark_price":"0.0054",
"price":"0.0054",
"product_codes":[
"DO"
],
"quantity":"25",
"quote_currency":"BTC",
"rfq_id":1232,
"strategy_code":"CL",
"traded":1628041230769.151,
"venue":"DBT"
}
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
All updates relating to Trades upon RFQs are sent through the trade_tape WebSocket Notifications channel.
This is a public channel and provides updates about all Trades which are executed through Paradigm & successfully clear and settle on the underlying venue.
All notifications through the trade_tape WebSocket channel do not reveal Taker or Maker information or the side/action the RFQ/Order/Quote was executed.
| Member | Type | Required | Description |
|---|---|---|---|
| channel | string | true | WebSocket Notification Channel message is received upon. |
| data | object | true | |
| > kind | string | true | The action of the WS Message. Valid values include COMPLETED. |
| > trade | object | true | |
| >> id | int | true | The Paradigm created unique identifier of the Trade. |
| >> description | string | true | The Paradigm created description of the RFQ. |
| >> mark_price | string | true | The calculated mark price of the RFQ from the underlying venue's mark prices in the Quote Currency of the RFQ. |
| >> price | string | true | The price the Trade was executed at in the Quote Currency of the RFQ. |
| >> product_codes | array of strings | true | The Paradigm created Product Codes of the trade. |
| >> quantity | string | true | The size of the trade in contracts units of the RFQ. |
| >> quote_currency | string | true | The Quote Currency of the RFQ executed upon. |
| >> rfq_id | int | true | The Paradigm created unique identifier of the RFQ. |
| >> strategy_code | string | true | Strategy code of the RFQ. Valid values include CL, CB, CC, CR, CS, CM, FT, FS, PT, PB, PC, PR, PS, SD, SG, IC, IP, IB, IY, ID, IG, IS, VL, VT, FF, VF, FD, VD, CD, VC, PD, VP. |
| >> traded | number | true | The time in unix milliseconds since the epoch when the trade was cleared & settled. |
| >> venue | string | true | Venue the underlying RFQ clears and settles upon. Valid values include DBT, BIT, BYB. |
| meta | object | true | |
| > seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. |
| > seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired with this identifier. |
GRFQ: ticker.{rfq_id}
An example, of an update message
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"channel": "ticker",
"data": {
"rfq_id": 50114339,
"published": 1683044823761,
"best_ask": {
"price": "0",
"quantity": "0.0"
},
"best_bid": {
"price": "0.1000",
"quantity": "8.0"
},
"greeks": {
"delta": "0.00466",
"gamma": "0.00001",
"theta": "-0.02436",
"vega": "0.20599",
},
"mark_price": "0.2256",
"legs": [
{
"instrument": "BTC-30JUN23-25000-C",
"mark_price": "0.2256",
"best_bid": {
"price": "0.1000",
"quantity": "8.0"
},
"best_ask": {
"price": "0.0000",
"quantity": "0.0"
},
"best_bid_iv": "110.18",
"best_ask_iv": "0.00",
"mark_price_iv": "53.02",
"greeks": {
"delta": "0.00466",
"gamma": "0.00001",
"theta": "-0.02436",
"vega": "0.20599",
},
}
]
},
"meta": {
"seq_group": 1294173505,
"seq_num": 1187
}
}
}
All updates relating to an RFQ's composite instrument & structure market data are sent via the ticker.{rfq_id} WebSocket Notification Channel.
This is a public channel and consumable by all.
This channel publishes real-time updates of the underlying market data from the composite instruments' settlement venue.
Parameters
| Member | Type | Required | Enums | Description |
|---|---|---|---|---|
| rfq_id | string | true | rfq_id |
The Paradigm created rfq_id of the RFQ. |
Response Schema
| Member | Type | Required | Description |
|---|---|---|---|
| jsonrpc | string | true | Always 2.0. |
| method | string | true | The value will always be subscription to indicate message type. |
| params | object | true | |
| > channel | string | true | The Websocket channel the message was delivered upon. |
| > data | object | true | An object containing the update’s information. |
| >> rfq_id | string | true | The Paradigm created unique identifier of the RFQ. |
| >> published | number | true | The time in unix milliseconds since the epoch when the data was returned from the underlying venue. |
| >> best_bid | object | true | |
| >>> price | string | true | The calculated best bid price of the RFQ’s strategy per the legs' underlying screen price in the Quote Currency of the RFQ. |
| >>> quantity | string | true | The calculated best bid price of the RFQ’s strategy per the legs' underlying screen quantity in contract units of the RFQ. |
| >> best_ask | object | true | |
| >>> price | string | true | The calculated best ask price of the RFQ’s strategy per the legs' underlying screen price in the Quote Currency of the RFQ. |
| >>> quantity | string | true | The calculated best ask price of the RFQ’s strategy per the legs' underlying screen quantity in contract units of the RFQ. |
| >> mark_price | string | true | The calculated Mark Price of the strategy in the Quote Currency of the RFQ. |
| >> greeks | object | false | An object of variables used to assess the risk & exposure of a derivatives contract. |
| >>> delta | string | true | The delta value of the strategy. |
| >>> theta | string | true | The theta value of the strategy. |
| >>> vega | string | true | The vega value of the strategy. |
| >>> gamma | string | true | The gamma value of the strategy. |
| >> legs | Array of Objects | true | The composite Instruments of the RFQ. |
| >>> instrument | string | true | The Paradigm standardized name of the Instrument. |
| >>> mark_price | string | true | The Mark price from the underlying exchange for specific Instrument in the Quote Currency of the Instrument. |
| >>> mark_price_iv | string | true | The Instrument’s mark price IV (implied volatility) from the underlying settlement venue. Set to null if the value is not available. |
| >>> best_bid_iv | string | true | The Instrument’s best bid IV (implied volatility) from the underlying settlement venue’s Order Books. Set to null if the value is not available. |
| >>> best_ask_iv | string | true | The Instrument’s best ask IV (implied volatility) from the underlying settlement venue’s Order Books. Set to null if the value is not available. |
| >>> best_bid | object | true | |
| >>>> price | string | true | The best bid on the underlying exchange’s Instrument Quote Book in the Quote Currency of the Instrument. |
| >>>> quantity | string | true | The best bid’s quantity on the underlying exchange’s Instrument Quote Book in contract units of the RFQ. |
| >>> best_ask | object | true | |
| >>>> price | string | true | The best ask on the underlying exchange’s Instrument Quote Book in the Quote Currency of the Instrument. |
| >>>> quantity | string | true | The best ask’s quantity on the underlying exchange’s Instrument Quote Book in contract units of the RFQ. |
| >>> greeks | object | false | An object of variables used to assess the risk & exposure of a derivatives contract. |
| >>>> delta | string | true | The delta value of the leg's Instrument. |
| >>>> theta | string | true | The theta value of the leg's Instrument. |
| >>>> vega | string | true | The vega value of the leg's Instrument. |
| >>>> gamma | string | true | The gamma value of the leg's Instrument. |
| > meta | object | true | |
| >> seq_num | int | true | Incrementing sequence number, relevant to messages within the sequence_group/channel. |
| >> seq_group | int | true | Identifier for a channel group. Sequence numbers are only relevant paired within seq_group. |
GRFQ: platform_state
An example when the
platform_state==UNAVAILABLE.
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"platform_state",
"data":{
"platform_state":"UNAVAILABLE",
"published_at":1652323465888,
"next_platform_state":"AVAILABLE_CANCEL_ONLY",
"next_platform_state_at":1652324400000
}
}
}
An example when the
platform_state==AVAILABLE_CANCEL_ONLY.
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"platform_state",
"data":{
"platform_state":"AVAILABLE_CANCEL_ONLY",
"published_at":1652323475415,
"next_platform_state":"AVAILABLE",
"next_platform_state_at":1652324400000
}
}
}
An example when the
platform_state==AVAILABLE.
{
"jsonrpc":"2.0",
"method":"subscription",
"params":{
"channel":"platform_state",
"data":{
"platform_state":"AVAILABLE",
"published_at":1652323494426,
"next_platform_state":"UNAVAILABLE",
"next_platform_state_at":1653966000000
}
}
}
All updates relating to market availability are sent through the platform_state WebSocket Notifications channel.
The Product and Account Management team will communicate expectations around market availability including the next_platform_state and the timing by the next_platform_state_at response key.
Markets can only be in three market availability states:
AVAILABLE- Normal Trading with no restrictions.UNAVAILABLE- No [POST], [PUT], or [DELETE] requests are allowed. All [GET] requests are allowed. Markets are locked and no trading is able to occur.AVAILABLE_CANCEL_ONLY- No [POST] or [PUT] requests are allowed. All [GET] requests are allowed. Markets are locked and no trading is able to occur.
Response Schema
| Member | Type | Required | Description |
|---|---|---|---|
| method | string | true | Value will always be subscription to indicate message type. |
| channel | string | true | Channel the message was delivered upon. |
| data | object | true | Object of information relating to the message received. |
| > platform_state | string | true | The state of the market. Valid values include AVAILABLE, UNAVAILABLE, AVAILABLE_CANCEL_ONLY. |
| > published_at | int | true | Time of update in unix milliseconds since the epoch. |
| > next_platform_state | string | true | The next expected platform_state. Valid values include AVAILABLE, UNAVAILABLE, AVAILABLE_CANCEL_ONLY. |
| > next_platform_state_at | int | true | Expected time of the next platform_state update in unix milliseconds since the epoch. |
Message Sequence Numbers
WebSocket messages contain sequence numbers to help clients identify if
they have missed any messages during temporary disconnections or network errors. The sequence number
is included in the WebSocket messages under the meta field.
Message Structure with Sequence Numbers
WebSocket messages now include an additional meta field that contains the following properties:
| Member | Type | Description |
|---|---|---|
| seq_group | number | Unique identifier for the group of messages |
| seq_num | number | Sequence number of the message within the group |
Here's an example of a WebSocket message with sequence numbers:
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"channel": "rfq",
"data": {
},
"meta": {
"seq_group": 1692463499,
"seq_num": 1027
}
}
}
Handling Sequence Numbers
Clients should monitor the sequence numbers of the incoming messages to ensure they have not missed any messages. If a client detects a gap in the sequence numbers, it may have missed one or more messages and should take appropriate action, such as refreshing data from REST.
Sequences increase monotonically within the context of a sequence group. Sequences are only relevant within a sequence group, which represents a subscribed channel. Sequences may be re-used between sequence groups.
While messages are sent ordered according to their sequences, sequences are not guaranteed not to repeat.