NAV
cURL JavaScript Python Go

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.

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
      }
    }
  ]
}

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

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_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 kindOPTION.
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.
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"
         ],
         "venues":[
            "DBT"
         ]
      },
      {
         "desk_name":"05J3",
         "firm_name":"062020",
         "groups":[
            "FAVORITE"
         ],
         "venues":[
            "DBT"
         ]
      },
      {
         "desk_name":"0729",
         "firm_name":"ParadigmShift",
         "groups":[

         ],
         "venues":[
            "DBT"
         ]
      },
      {
         "desk_name":"0817",
         "firm_name":"ParadigmShift",
         "groups":[

         ],
         "venues":[
            "DBT"
         ]
      },
      {
         "desk_name":"1234",
         "firm_name":"ParadigmShift",
         "groups":[

         ],
         "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).

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.

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.

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.

/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,
         "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",
               "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",
   "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",
         "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.
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.
> 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:

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, when state == 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, when state == 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, when state == 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, when state == 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.

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.

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",
         "legs":[
            {
               "instrument_id":184255,
               "instrument_name":"BTC-16DEC22",
               "price":"17204",
               "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",
         "legs":[
            {
               "instrument_id":184255,
               "instrument_name":"BTC-16DEC22",
               "price":"17204",
               "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",
         "legs":[
            {
               "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.

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

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.

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"
         ],
         "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"
      },
      {
         "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 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",
   "legs":[
      {
         "id":1987,
         "instrument":"BTC-PERPETUAL",
         "price":"39900.66",
         "product_code":"CF",