NAV
shell

Welcome to Sparrow's API.

This documentation will list all available API endpoints for Sparrow users to interact with the platform.

Change Log

1st July 2020

Sparrow Environments

Sparrow have two API environments, Sparrow Sandbox and Sparrow Production. Sparrow Sandbox can be used for users to test their API before deploying the application to Sparrow Production.

Environment URL
Sandbox https://sparrowsandbox.com/
Production https://sparrowexchange.com/

Note:

API Keys

Environment URL
Sandbox https://api.sparrowsandbox.com/
Production https://api.sparrowexchange.com/

Before you start using Sparrow API, you will need to enable your API access by creating {{api_key_id}} and download your API RSA Private key in PEM format (api.pem).

In order to do so, you will need to login with your account and go to API Management > New API to submit your API Key request with the necessary privileges.

Sparrow API Key Creations

Once your API Key request has been submitted, you will receive an API Key Request confirmation email for you to confirm and download the API RSA Private key in PEM format (api.pem).

The private key can be opened by any text editor with the content looks like below:

-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAv1oaYMFaXX/FRrlNyDloizH/1W7cKJAGac9G0PCEZsFgcGBi
... ... 
ZwPHzaUUtebC6ge9rboRaRsS+wFYVU6OkdEVJIDasm4XMf+etS8=
-----END RSA PRIVATE KEY-----

Think of your API RSA Private key like a password:

You will also need {{api_key_id}}, which can be found in API Management > API Key ID. This will also be used to generate and sign access token for your application.

Authentication

All requests to Sparrow Private API and WebSocket endpoints are required to be signed with an API Key and JWT token.

This section will provide you how to use the API Key ID and RSA Private Key (api.pem) to generate and sign JWT token for your application.

To generate a signed JWT token, you will need:

  1. Your User ID (can be found under your Sparrow Dashboard Account tab)
  2. Your API Key ID (can be found under your Sparrow Dashboard API Management tab)
  3. Your RSA Private Key downloaded (api.pem)

You can sign and generate the token with any programming languages such as Python and Go. Below are some samples for your reference.

Python

Step 1: Import dependencies


import jwt
from datetime import datetime, timedelta

Step 2: Initialize the required variables

userId = Your User ID
apiKeyId = {{api_key_id}}
privateKey = Your RSA Private Key
expSec = Token expiry in seconds (max 5 minutes)

Step 3: Sign jwt and generate token

expiryTime = int((datetime.now() + timedelta(seconds=expSec)).timestamp())
currentTime = int((datetime.now().timestamp()))
tokenPayload = {'userId': userId, 'exp': expiryTime, 'iat': currentTime}
signedJwt = jwt.encode(tokenPayload, privateKey, algorithm='RS256')
signedJwt = signedJwt.decode('UTF-8')

# The value you obtained from `signedJwt` will be {{auth_token}} 
# for each API request to Sparrow Private API and WebSocket endpoints. 
# Below is a sample of the Authorization token for your reference:
eyJhbGciOiJSUzI1NiIsInR5cCI6
... ...
thjybpTcmmoalGz_9EHG048pCBCA

Step 4: Construct Your API Request Headers**

"Content-Type": "application/json",
"Authorization": signedJwt,
"api-key": {{api_key_id}}

Go

Step 1: Import dependencies

import {
    "bufio"
    "crypto/rsa"
    "crypto/x509"
    "os"
    jwt "github.com/dgrijalva/jwt-go"
    "encoding/pem"
}

Step 2: Read private key from file

func readPrivateKey(keyPath string) *rsa.PrivateKey {
    privateKeyFile, err := os.Open(keyPath)
    defer privateKeyFile.Close()
    if err != nil {
        log.Errorln(err)
        panic(err)
    }
    pemfileinfo, _ := privateKeyFile.Stat()
    var size = pemfileinfo.Size()
    pembytes := make([]byte, size)

    buffer := bufio.NewReader(privateKeyFile)
    _, err = buffer.Read(pembytes)

    data, _ := pem.Decode([]byte(pembytes))

    privateKeyImported, err := x509.ParsePKCS1PrivateKey(data.Bytes)

    if err != nil {
        panic(err)
    }

    return privateKeyImported
}

Step 3: Initialize the required variables

userId = Your User ID
apiKeyId = {{api_key_id}}
privateKey = Your RSA Private Key
expSec = Token expiry in seconds (max 5 minutes)

Step 4: Sign jwt and generate token

func newAuth(userID string, privateKey *rsa.PrivateKey, expSec int64) string {
    token := jwt.New(jwt.SigningMethodRS256)
    var payload = jwt.MapClaims{"exp": time.Now().Add(time.Second * time.Duration(expSec)).Unix(),
        "userId": userID, "iat": time.Now().Unix()}
    token.Claims = payload
    tokenString, err := token.SignedString(privateKey)

    if err != nil {
        log.Errorln(err)
        return ""
    }
    return tokenString
}
// The value you obtained from `tokenString` will be {{auth_token}} 
// for each API request to Sparrow Private API and WebSocket endpoints. Below is a sample of the Authorization token for your reference:

eyJhbGciOiJSUzI1NiIsInR5cCI6
... ... 
thjybpTcmmoalGz_9EHG048pCBCA

Step 5: Construct Your API Request Headers

"Content-Type": "application/json",
"Authorization": tokenString,
"api-key": {{api_key_id}}

Making Your First Call

Test that you have the headers setup by making a GET request to "wallets/balance" with the above API Request Headers obtained from the Authentication session. You should get a HTTP 200 OK response if your keys are correct.

NOTE:

You'll need to have the API Request Headers with Authorization token in all API requests to Sparrow Private API and WebSocket endpoints, except Public API endpoints where Authorization token is not required.

Wallet

Wallet Balance

curl --location --request GET 'https://api.sparrowexchange.com/wallets/balance' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID' \
--header 'Content-Type: application/json'

Example Response

[
  {
    "coin": "BTC",
    "coinName": "Bitcoin",
    "available": "2.35415896",
    "on_trade": "0",
    "total": "2.35415896",
    "withdrawable": true,
    "depositable": true,
    "market": "CRYPTO"
  },
  {
    "coin": "SP$",
    "coinName": "Sparrow Dollar",
    "available": "1.99",
    "on_trade": "0",
    "total": "1.999",
    "withdrawable": false,
    "depositable": false,
    "market": "CASH"
  },
  {
    "coin": "SPO",
    "coinName": "Sparrow Token",
    "available": "666.038320158102766833",
    "on_trade": "0",
    "total": "666.038320158102766833",
    "withdrawable": true,
    "depositable": true,
    "market": "CRYPTO"
  },
  {
    "coin": "ETH",
    "coinName": "Ethereum",
    "available": "0",
    "on_trade": "0",
    "total": "0",
    "withdrawable": true,
    "depositable": true,
    "market": "CRYPTO"
  },
  {
    "coin": "USDT",
    "coinName": "Tether",
    "available": "0",
    "on_trade": "0",
    "total": "0",
    "withdrawable": true,
    "depositable": true,
    "market": "CRYPTO"
  },
  {
    "coin": "PAX",
    "coinName": "Paxos Standard",
    "available": "0",
    "on_trade": "0",
    "total": "0",
    "withdrawable": true,
    "depositable": true,
    "market": "CRYPTO"
  },
  {
    "coin": "TUSD",
    "coinName": "TrueUSD",
    "available": "0",
    "on_trade": "0",
    "total": "0",
    "withdrawable": true,
    "depositable": true,
    "market": "CRYPTO"
  },
  {
    "coin": "USDC",
    "coinName": "USD Coin",
    "available": "0",
    "on_trade": "0",
    "total": "0",
    "withdrawable": true,
    "depositable": true,
    "market": "CRYPTO"
  },
  {
    "coin": "XRP",
    "coinName": "Ripple",
    "available": "0",
    "on_trade": "0",
    "total": "0",
    "withdrawable": true,
    "depositable": true,
    "market": "CRYPTO"
  },
  {
    "coin": "XLM",
    "coinName": "Stellar",
    "available": "0",
    "on_trade": "0",
    "total": "0",
    "withdrawable": true,
    "depositable": true,
    "market": "CRYPTO"
  }
]

URL Endpoint

GET https://api.sparrowexchange.com/wallets/balance

HEADERS

Parameter Default
Authorization Your Authorization Token
api-key Your API KEY ID
Content-Type application/json

Wallet Balance (Options Trading Pairs Only)

curl --location --request GET 'https://api.sparrowexchange.com/wallets/balance?filter=optionsTrading' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

Example Response

[
  {
    "coin": "BTC",
    "coinName": "Bitcoin",
    "available": "2.35415896",
    "on_trade": "0",
    "total": "2.35415896",
    "withdrawable": true,
    "depositable": true,
    "market": "CRYPTO"
  },
  {
    "coin": "SP$",
    "coinName": "Sparrow Dollar",
    "available": "1.99",
    "on_trade": "0",
    "total": "1.99",
    "withdrawable": false,
    "depositable": false,
    "market": "CASH"
  },
  {
    "coin": "SPO",
    "coinName": "Sparrow Token",
    "available": "666.038320158102766833",
    "on_trade": "0",
    "total": "666.038320158102766833",
    "withdrawable": true,
    "depositable": true,
    "market": "CRYPTO"
  },
  {
    "coin": "ETH",
    "coinName": "Ethereum",
    "available": "0",
    "on_trade": "0",
    "total": "0",
    "withdrawable": true,
    "depositable": true,
    "market": "CRYPTO"
  }
]

URL Endpoint

GET https://api.sparrowexchange.com/wallets/balance?filter=optionsTrading

HEADERS

Parameter Default
Authorization Your Authorization Token
api-key Your API KEY ID
Content-Type application/json

PARAMS

Parameter Default
filter optionsTrading

Options Trade

Display Options Trading Pairs

curl --location --request GET 'https://api.sparrowexchange.com/trades/pairs' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

Example Response

[
  {
    "pair": "ETH-SP$",
    "strikeStep": "10",
    "amountStep": "1",
    "unitPremiumStep": "0.01"
  },
  {
    "pair": "BTC-SP$",
    "strikeStep": "250",
    "amountStep": "0.1",
    "unitPremiumStep": "0.01"
  }
]

URL Endpoint

GET https://api.sparrowexchange.com/trades/pairs

HEADERS

Parameter Default
Authorization Your Authorization Token
api-key Your API KEY ID

Create new order with unitPremium

curl --location --request POST 'https://api.sparrowexchange.com/trades/book/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID' \
--data-raw '{
    "action": "BUY",
    "type": "CALL",
    "lifetime": "GTD",
    "txFeeCoin": "SP$",
    "pair": "BTC-SP$",
    "strike": "8000",
    "amount": "1",
    "totalPremium": "200",
    "expiryDate": "2019-10-04T08:00"
}'

Example Body

{
    "action": "BUY",
    "type": "CALL",
    "lifetime": "GTD",
    "txFeeCoin": "SP$",
    "pair": "BTC-SP$",
    "strike": "8000",
    "amount": "1",
    "totalPremium": "200",
    "expiryDate": "2019-10-04T08:00:00.000Z"
}

Example Response

{
  "result": {
    "expiry_date": "4/10/2019",
    "iv": 1.1939,
    "option_price": 0.01,
    "quantity": 0.1,
    "spot": 7803,
    "strike": 80000
  },
  "status": "success"
}

URL Endpoint

POST https://api.sparrowexchange.com/trades/book/create

HEADERS

Parameter Default
Content-Type application/json
Authorization Your Authorization Token
api-key Your API KEY ID

Create new order with totalPremium

curl --location --request POST 'https://api.sparrowexchange.com/trades/book/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID' \
--data-raw '{
    "action": "BUY",
    "type": "PUT",
    "lifetime": "GTD",
    "txFeeCoin": "SP$",
    "pair": "BTC-SP$",
    "strike": "7000",
    "amount": "3",
    "totalPremium": "10",
    "expiryDate": "2019-04-20T08:00:00.000Z"
}'

Example Body

{
    "action": "BUY",
    "type": "PUT",
    "lifetime": "GTD",
    "txFeeCoin": "SP$",
    "pair": "BTC-SP$",
    "strike": "7000",
    "amount": "3",
    "totalPremium": "10",
    "expiryDate": "2019-10-04T08:00:00.000Z"
}

Example Response

{
  "result": {
    "expiry_date": "11/10/2019",
    "iv": 1.1939,
    "option_price": 0.01,
    "quantity": 0.1,
    "spot": 7803,
    "strike": 80000
  },
  "status": "success"
}

URL Endpoint

POST https://api.sparrowexchange.com/trades/book/create

HEADERS

Parameter Default
Content-Type application/json
Authorization Your Authorization Token
api-key Your API KEY ID

Create new order with tradeUnitPremium

curl --location --request POST 'https://api.sparrowexchange.com/trades/book/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID' \
--data-raw '{
    "action": "BUY",
    "type": "PUT",
    "lifetime": "GTD",
    "txFeeCoin": "SP$",
    "pair": "BTC-SP$",
    "strike": "7000",
    "amount": "10",
    "tradeUnitPremium": "0.2",
    "expiryDate": "2019-03-01T08:00:00.000Z"
}'

Example Body

{
    "action": "BUY",
    "type": "PUT",
    "lifetime": "GTD",
    "txFeeCoin": "SP$",
    "pair": "BTC-SP$",
    "strike": "7000",
    "amount": "10",
    "tradeUnitPremium": "0.2",
    "expiryDate": "2019-10-04T08:00:00.000Z"
}

Example Response

{
  "result": {
    "expiry_date": "11/10/2019",
    "iv": 1.1939,
    "option_price": 0.01,
    "quantity": 0.1,
    "spot": 7803,
    "strike": 80000
  },
  "status": "success"
}

URL Endpoint

POST https://api.sparrowexchange.com/trades/book/create

HEADERS

Parameter Default
Content-Type application/json
Authorization Your Authorization Token
api-key Your API KEY ID

Create new order without matching process

curl --location --request POST 'https://api.sparrowexchange.com/trades/book/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID' \
--data-raw '{
    "action": "BUY",
    "type": "PUT",
    "lifetime": "GTD",
    "txFeeCoin": "SP$",
    "pair": "BTC-SP$",
    "strike": "7000",
    "amount": "0.8",
    "unitPremium": "1",
    "expiryDate": "2019-03-10T08:00:00.000Z",
    "skipBidding": true
}'

Example Body

{
    "action": "BUY",
    "type": "PUT",
    "lifetime": "GTD",
    "txFeeCoin": "SP$",
    "pair": "BTC-SP$",
    "strike": "7000",
    "amount": "0.8",
    "unitPremium": "1",
    "expiryDate": "2019-10-04T08:00:00.000Z",
    "skipBidding": true
}

Example Response

{
  "result": {
    "expiry_date": "11/10/2019",
    "iv": 1.1939,
    "option_price": 0.01,
    "quantity": 0.1,
    "spot": 7803,
    "strike": 80000
  },
  "status": "success"
}

URL Endpoint

POST https://api.sparrowexchange.com/trades/book/create

HEADERS

Parameter Default
Content-Type application/json
Authorization Your Authorization Token
api-key Your API KEY ID

Create new bulk order with unitPremium

curl --location --request POST 'https://api.sparrowexchange.com/trades/book/bulkCreate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID' \
--data-raw '[
    {
        "action": "BUY",
        "type": "PUT",
        "lifetime": "GTD",
        "txFeeCoin": "SP$",
        "pair": "BTC-SP$",
        "strike": "7000",
        "amount": "1",
        "unitPremium": "2",
        "expiryDate": "2019-10-04T08:00:00.000Z"
    },
    {
        "action": "SELL",
        "type": "PUT",
        "lifetime": "GTD",
        "txFeeCoin": "SPO",
        "pair": "BTC-SP$",
        "strike": "6000",
        "amount": "2",
        "unitPremium": "2.5",
        "expiryDate": "2019-12-01T08:00:00.000Z"
    }
]'

Example Body

[
    {
        "action": "BUY",
        "type": "PUT",
        "lifetime": "GTD",
        "txFeeCoin": "SP$",
        "pair": "BTC-SP$",
        "strike": "7000",
        "amount": "1",
        "unitPremium": "2",
        "expiryDate": "2019-10-04T08:00:00.000Z"
    },
    {
        "action": "SELL",
        "type": "PUT",
        "lifetime": "GTD",
        "txFeeCoin": "SPO",
        "pair": "BTC-SP$",
        "strike": "6000",
        "amount": "2",
        "unitPremium": "2.5",
        "expiryDate": "2019-12-01T08:00:00.000Z"
    }
]

URL Endpoint

POST https://api.sparrowexchange.com/trades/book/bulkCreate

HEADERS

Parameter Default
Content-Type application/json
Authorization Your Authorization Token
api-key Your API KEY ID

Example Response

[
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "8000",
    "call": {
      "totalQuantity": "3",
      "maxBid": {
        "quantity": "1",
        "price": {
          "unitPremium": "307.44",
          "tradeUnitPremium": "30.744",
          "totalPremium": "307.44"
        },
        "impliedVolatility": "119.586292",
        "greeks": {
          "delta": "0.44551539755575087",
          "gamma": "0.0004513544127329389",
          "theta": "-17421.057502665175",
          "vega": "3.2623289499362587"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "8250",
    "call": {
      "totalQuantity": "1",
      "maxBid": {
        "quantity": "1",
        "price": {
          "unitPremium": "214.17",
          "tradeUnitPremium": "21.417",
          "totalPremium": "214.17"
        },
        "impliedVolatility": "117.992588",
        "greeks": {
          "delta": "0.3493781039763387",
          "gamma": "0.0003587379573724116",
          "theta": "-16101.110834773377",
          "vega": "3.0558761453717715"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-11T08:00:00.000Z",
    "strike": "8500",
    "call": {
      "totalQuantity": "0.1",
      "maxBid": {
        "quantity": "0.1",
        "price": {
          "unitPremium": "244.3",
          "tradeUnitPremium": "24.43",
          "totalPremium": "24.43"
        },
        "impliedVolatility": "92.162149",
        "greeks": {
          "delta": "0.3245546194179445",
          "gamma": "0.00025903867958489233",
          "theta": "-7420.420798469983",
          "vega": "4.89130212111081"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "9000",
    "call": {
      "totalQuantity": "19.5",
      "maxBid": null,
      "minAsk": {
        "quantity": "19.5",
        "price": {
          "unitPremium": "17.5",
          "tradeUnitPremium": "1.75",
          "totalPremium": "341.25"
        },
        "impliedVolatility": "84.591524",
        "greeks": {
          "delta": "0.06021156730496735",
          "gamma": "0.0000862361693246329",
          "theta": "-3721.4394036662957",
          "vega": "0.985187148023525"
        }
      },
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "9750",
    "call": {
      "totalQuantity": "0.1",
      "maxBid": null,
      "minAsk": {
        "quantity": "0.1",
        "price": {
          "unitPremium": "16.63",
          "tradeUnitPremium": "1.663",
          "totalPremium": "1.663"
        },
        "impliedVolatility": "118.826486",
        "greeks": {
          "delta": "0.04344833423026628",
          "gamma": "0.00004429923758647504",
          "theta": "-4039.034919879933",
          "vega": "0.7612003697120275"
        }
      },
      "openInterest": "3"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "10000",
    "call": {
      "totalQuantity": "0.8",
      "maxBid": {
        "quantity": "0.8",
        "price": {
          "unitPremium": "17.14",
          "tradeUnitPremium": "1.714",
          "totalPremium": "13.712"
        },
        "impliedVolatility": "130.182542",
        "greeks": {
          "delta": "0.04145904158414915",
          "gamma": "0.000038583612420825715",
          "theta": "-4253.108332603115",
          "vega": "0.73162465870199"
        }
      },
      "minAsk": null,
      "openInterest": "0.2"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "11500",
    "call": {
      "totalQuantity": "1",
      "maxBid": null,
      "minAsk": {
        "quantity": "1",
        "price": {
          "unitPremium": "221.65",
          "tradeUnitPremium": "22.165",
          "totalPremium": "221.65"
        },
        "impliedVolatility": "331.432859",
        "greeks": {
          "delta": "0.17566826271590297",
          "gamma": "0.00006421464969136541",
          "theta": "-31580.401043302005",
          "vega": "2.1338147539141272"
        }
      },
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-12-27T08:00:00.000Z",
    "strike": "9000",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "1"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-12-27T08:00:00.000Z",
    "strike": "9250",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "0.8"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2020-03-27T08:00:00.000Z",
    "strike": "10000",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "1"
    },
    "put": null
  }
]

Display Order Book

curl --location --request GET 'https://api.sparrowexchange.com/trades/book'

Example Response

[
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "8000",
    "call": {
      "totalQuantity": "3",
      "maxBid": {
        "quantity": "1",
        "price": {
          "unitPremium": "307.44",
          "tradeUnitPremium": "30.744",
          "totalPremium": "307.44"
        },
        "impliedVolatility": "119.586292",
        "greeks": {
          "delta": "0.44551539755575087",
          "gamma": "0.0004513544127329389",
          "theta": "-17421.057502665175",
          "vega": "3.2623289499362587"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "8250",
    "call": {
      "totalQuantity": "1",
      "maxBid": {
        "quantity": "1",
        "price": {
          "unitPremium": "214.17",
          "tradeUnitPremium": "21.417",
          "totalPremium": "214.17"
        },
        "impliedVolatility": "117.992588",
        "greeks": {
          "delta": "0.3493781039763387",
          "gamma": "0.0003587379573724116",
          "theta": "-16101.110834773377",
          "vega": "3.0558761453717715"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-11T08:00:00.000Z",
    "strike": "8500",
    "call": {
      "totalQuantity": "0.1",
      "maxBid": {
        "quantity": "0.1",
        "price": {
          "unitPremium": "244.3",
          "tradeUnitPremium": "24.43",
          "totalPremium": "24.43"
        },
        "impliedVolatility": "92.162149",
        "greeks": {
          "delta": "0.3245546194179445",
          "gamma": "0.00025903867958489233",
          "theta": "-7420.420798469983",
          "vega": "4.89130212111081"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "9000",
    "call": {
      "totalQuantity": "19.5",
      "maxBid": null,
      "minAsk": {
        "quantity": "19.5",
        "price": {
          "unitPremium": "17.5",
          "tradeUnitPremium": "1.75",
          "totalPremium": "341.25"
        },
        "impliedVolatility": "84.591524",
        "greeks": {
          "delta": "0.06021156730496735",
          "gamma": "0.0000862361693246329",
          "theta": "-3721.4394036662957",
          "vega": "0.985187148023525"
        }
      },
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "9750",
    "call": {
      "totalQuantity": "0.1",
      "maxBid": null,
      "minAsk": {
        "quantity": "0.1",
        "price": {
          "unitPremium": "16.63",
          "tradeUnitPremium": "1.663",
          "totalPremium": "1.663"
        },
        "impliedVolatility": "118.826486",
        "greeks": {
          "delta": "0.04344833423026628",
          "gamma": "0.00004429923758647504",
          "theta": "-4039.034919879933",
          "vega": "0.7612003697120275"
        }
      },
      "openInterest": "3"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "10000",
    "call": {
      "totalQuantity": "0.8",
      "maxBid": {
        "quantity": "0.8",
        "price": {
          "unitPremium": "17.14",
          "tradeUnitPremium": "1.714",
          "totalPremium": "13.712"
        },
        "impliedVolatility": "130.182542",
        "greeks": {
          "delta": "0.04145904158414915",
          "gamma": "0.000038583612420825715",
          "theta": "-4253.108332603115",
          "vega": "0.73162465870199"
        }
      },
      "minAsk": null,
      "openInterest": "0.2"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "11500",
    "call": {
      "totalQuantity": "1",
      "maxBid": null,
      "minAsk": {
        "quantity": "1",
        "price": {
          "unitPremium": "221.65",
          "tradeUnitPremium": "22.165",
          "totalPremium": "221.65"
        },
        "impliedVolatility": "331.432859",
        "greeks": {
          "delta": "0.17566826271590297",
          "gamma": "0.00006421464969136541",
          "theta": "-31580.401043302005",
          "vega": "2.1338147539141272"
        }
      },
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-12-27T08:00:00.000Z",
    "strike": "9000",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "1"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-12-27T08:00:00.000Z",
    "strike": "9250",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "0.8"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2020-03-27T08:00:00.000Z",
    "strike": "10000",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "1"
    },
    "put": null
  }
]

URL Endpoint

GET - https://api.sparrowexchange.com/trades/book

HEADERS

Parameter Default
Authorization Your Authorization Token
api-key Your API KEY ID

Display Order Book By Pair

curl --location --request GET 'https://api.sparrowexchange.com/trades/book/BTC-SP$'

Example Response

[
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "8000",
    "call": {
      "totalQuantity": "3",
      "maxBid": {
        "quantity": "1",
        "price": {
          "unitPremium": "307.44",
          "tradeUnitPremium": "30.744",
          "totalPremium": "307.44"
        },
        "impliedVolatility": "119.586292",
        "greeks": {
          "delta": "0.44551539755575087",
          "gamma": "0.0004513544127329389",
          "theta": "-17421.057502665175",
          "vega": "3.2623289499362587"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "8250",
    "call": {
      "totalQuantity": "1",
      "maxBid": {
        "quantity": "1",
        "price": {
          "unitPremium": "214.17",
          "tradeUnitPremium": "21.417",
          "totalPremium": "214.17"
        },
        "impliedVolatility": "117.992588",
        "greeks": {
          "delta": "0.3493781039763387",
          "gamma": "0.0003587379573724116",
          "theta": "-16101.110834773377",
          "vega": "3.0558761453717715"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-11T08:00:00.000Z",
    "strike": "8500",
    "call": {
      "totalQuantity": "0.1",
      "maxBid": {
        "quantity": "0.1",
        "price": {
          "unitPremium": "244.3",
          "tradeUnitPremium": "24.43",
          "totalPremium": "24.43"
        },
        "impliedVolatility": "92.162149",
        "greeks": {
          "delta": "0.3245546194179445",
          "gamma": "0.00025903867958489233",
          "theta": "-7420.420798469983",
          "vega": "4.89130212111081"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "9000",
    "call": {
      "totalQuantity": "19.5",
      "maxBid": null,
      "minAsk": {
        "quantity": "19.5",
        "price": {
          "unitPremium": "17.5",
          "tradeUnitPremium": "1.75",
          "totalPremium": "341.25"
        },
        "impliedVolatility": "84.591524",
        "greeks": {
          "delta": "0.06021156730496735",
          "gamma": "0.0000862361693246329",
          "theta": "-3721.4394036662957",
          "vega": "0.985187148023525"
        }
      },
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "9750",
    "call": {
      "totalQuantity": "0.1",
      "maxBid": null,
      "minAsk": {
        "quantity": "0.1",
        "price": {
          "unitPremium": "16.63",
          "tradeUnitPremium": "1.663",
          "totalPremium": "1.663"
        },
        "impliedVolatility": "118.826486",
        "greeks": {
          "delta": "0.04344833423026628",
          "gamma": "0.00004429923758647504",
          "theta": "-4039.034919879933",
          "vega": "0.7612003697120275"
        }
      },
      "openInterest": "3"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "10000",
    "call": {
      "totalQuantity": "0.8",
      "maxBid": {
        "quantity": "0.8",
        "price": {
          "unitPremium": "17.14",
          "tradeUnitPremium": "1.714",
          "totalPremium": "13.712"
        },
        "impliedVolatility": "130.182542",
        "greeks": {
          "delta": "0.04145904158414915",
          "gamma": "0.000038583612420825715",
          "theta": "-4253.108332603115",
          "vega": "0.73162465870199"
        }
      },
      "minAsk": null,
      "openInterest": "0.2"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "11500",
    "call": {
      "totalQuantity": "1",
      "maxBid": null,
      "minAsk": {
        "quantity": "1",
        "price": {
          "unitPremium": "221.65",
          "tradeUnitPremium": "22.165",
          "totalPremium": "221.65"
        },
        "impliedVolatility": "331.432859",
        "greeks": {
          "delta": "0.17566826271590297",
          "gamma": "0.00006421464969136541",
          "theta": "-31580.401043302005",
          "vega": "2.1338147539141272"
        }
      },
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-12-27T08:00:00.000Z",
    "strike": "9000",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "1"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-12-27T08:00:00.000Z",
    "strike": "9250",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "0.8"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2020-03-27T08:00:00.000Z",
    "strike": "10000",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "1"
    },
    "put": null
  }
]

URL Endpoint

GET https://api.sparrowexchange.com/trades/book/BTC-SP$

Display Order Book - Filter By Type

curl --location --request GET 'https://api.sparrowexchange.com/trades/book/BTC-SP$?type=call'

Example Response

[
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "8000",
    "call": {
      "totalQuantity": "3",
      "maxBid": {
        "quantity": "1",
        "price": {
          "unitPremium": "307.44",
          "tradeUnitPremium": "30.744",
          "totalPremium": "307.44"
        },
        "impliedVolatility": "119.586292",
        "greeks": {
          "delta": "0.44551539755575087",
          "gamma": "0.0004513544127329389",
          "theta": "-17421.057502665175",
          "vega": "3.2623289499362587"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "8250",
    "call": {
      "totalQuantity": "1",
      "maxBid": {
        "quantity": "1",
        "price": {
          "unitPremium": "214.17",
          "tradeUnitPremium": "21.417",
          "totalPremium": "214.17"
        },
        "impliedVolatility": "117.992588",
        "greeks": {
          "delta": "0.3493781039763387",
          "gamma": "0.0003587379573724116",
          "theta": "-16101.110834773377",
          "vega": "3.0558761453717715"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-11T08:00:00.000Z",
    "strike": "8500",
    "call": {
      "totalQuantity": "0.1",
      "maxBid": {
        "quantity": "0.1",
        "price": {
          "unitPremium": "244.3",
          "tradeUnitPremium": "24.43",
          "totalPremium": "24.43"
        },
        "impliedVolatility": "92.162149",
        "greeks": {
          "delta": "0.3245546194179445",
          "gamma": "0.00025903867958489233",
          "theta": "-7420.420798469983",
          "vega": "4.89130212111081"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "9000",
    "call": {
      "totalQuantity": "19.5",
      "maxBid": null,
      "minAsk": {
        "quantity": "19.5",
        "price": {
          "unitPremium": "17.5",
          "tradeUnitPremium": "1.75",
          "totalPremium": "341.25"
        },
        "impliedVolatility": "84.591524",
        "greeks": {
          "delta": "0.06021156730496735",
          "gamma": "0.0000862361693246329",
          "theta": "-3721.4394036662957",
          "vega": "0.985187148023525"
        }
      },
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "9750",
    "call": {
      "totalQuantity": "0.1",
      "maxBid": null,
      "minAsk": {
        "quantity": "0.1",
        "price": {
          "unitPremium": "16.63",
          "tradeUnitPremium": "1.663",
          "totalPremium": "1.663"
        },
        "impliedVolatility": "118.826486",
        "greeks": {
          "delta": "0.04344833423026628",
          "gamma": "0.00004429923758647504",
          "theta": "-4039.034919879933",
          "vega": "0.7612003697120275"
        }
      },
      "openInterest": "3"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "10000",
    "call": {
      "totalQuantity": "0.8",
      "maxBid": {
        "quantity": "0.8",
        "price": {
          "unitPremium": "17.14",
          "tradeUnitPremium": "1.714",
          "totalPremium": "13.712"
        },
        "impliedVolatility": "130.182542",
        "greeks": {
          "delta": "0.04145904158414915",
          "gamma": "0.000038583612420825715",
          "theta": "-4253.108332603115",
          "vega": "0.73162465870199"
        }
      },
      "minAsk": null,
      "openInterest": "0.2"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "11500",
    "call": {
      "totalQuantity": "1",
      "maxBid": null,
      "minAsk": {
        "quantity": "1",
        "price": {
          "unitPremium": "221.65",
          "tradeUnitPremium": "22.165",
          "totalPremium": "221.65"
        },
        "impliedVolatility": "331.432859",
        "greeks": {
          "delta": "0.17566826271590297",
          "gamma": "0.00006421464969136541",
          "theta": "-31580.401043302005",
          "vega": "2.1338147539141272"
        }
      },
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-12-27T08:00:00.000Z",
    "strike": "9000",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "1"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-12-27T08:00:00.000Z",
    "strike": "9250",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "0.8"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2020-03-27T08:00:00.000Z",
    "strike": "10000",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "1"
    },
    "put": null
  }
]

URL Endpoint

GET - https://api.sparrowexchange.com/trades/book/:pair?type={{type}}

PARAMS

Parameter type
type {{type}} CALL/PUT

PATH VARIABLE

Parameter value
pair BTC/SP$

Display Order Book - Filter By Strike

curl --location --request GET 'https://api.sparrowexchange.com/trades/book/BTC-SP$?minStrike=8000&maxStrike=10000'

Example Response

[
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "8000",
    "call": {
      "totalQuantity": "3",
      "maxBid": {
        "quantity": "1",
        "price": {
          "unitPremium": "307.44",
          "tradeUnitPremium": "30.744",
          "totalPremium": "307.44"
        },
        "impliedVolatility": "119.586292",
        "greeks": {
          "delta": "0.44551539755575087",
          "gamma": "0.0004513544127329389",
          "theta": "-17421.057502665175",
          "vega": "3.2623289499362587"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "8250",
    "call": {
      "totalQuantity": "1",
      "maxBid": {
        "quantity": "1",
        "price": {
          "unitPremium": "214.17",
          "tradeUnitPremium": "21.417",
          "totalPremium": "214.17"
        },
        "impliedVolatility": "117.992588",
        "greeks": {
          "delta": "0.3493781039763387",
          "gamma": "0.0003587379573724116",
          "theta": "-16101.110834773377",
          "vega": "3.0558761453717715"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-11T08:00:00.000Z",
    "strike": "8500",
    "call": {
      "totalQuantity": "0.1",
      "maxBid": {
        "quantity": "0.1",
        "price": {
          "unitPremium": "244.3",
          "tradeUnitPremium": "24.43",
          "totalPremium": "24.43"
        },
        "impliedVolatility": "92.162149",
        "greeks": {
          "delta": "0.3245546194179445",
          "gamma": "0.00025903867958489233",
          "theta": "-7420.420798469983",
          "vega": "4.89130212111081"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "9000",
    "call": {
      "totalQuantity": "19.5",
      "maxBid": null,
      "minAsk": {
        "quantity": "19.5",
        "price": {
          "unitPremium": "17.5",
          "tradeUnitPremium": "1.75",
          "totalPremium": "341.25"
        },
        "impliedVolatility": "84.591524",
        "greeks": {
          "delta": "0.06021156730496735",
          "gamma": "0.0000862361693246329",
          "theta": "-3721.4394036662957",
          "vega": "0.985187148023525"
        }
      },
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "9750",
    "call": {
      "totalQuantity": "0.1",
      "maxBid": null,
      "minAsk": {
        "quantity": "0.1",
        "price": {
          "unitPremium": "16.63",
          "tradeUnitPremium": "1.663",
          "totalPremium": "1.663"
        },
        "impliedVolatility": "118.826486",
        "greeks": {
          "delta": "0.04344833423026628",
          "gamma": "0.00004429923758647504",
          "theta": "-4039.034919879933",
          "vega": "0.7612003697120275"
        }
      },
      "openInterest": "3"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "10000",
    "call": {
      "totalQuantity": "0.8",
      "maxBid": {
        "quantity": "0.8",
        "price": {
          "unitPremium": "17.14",
          "tradeUnitPremium": "1.714",
          "totalPremium": "13.712"
        },
        "impliedVolatility": "130.182542",
        "greeks": {
          "delta": "0.04145904158414915",
          "gamma": "0.000038583612420825715",
          "theta": "-4253.108332603115",
          "vega": "0.73162465870199"
        }
      },
      "minAsk": null,
      "openInterest": "0.2"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "11500",
    "call": {
      "totalQuantity": "1",
      "maxBid": null,
      "minAsk": {
        "quantity": "1",
        "price": {
          "unitPremium": "221.65",
          "tradeUnitPremium": "22.165",
          "totalPremium": "221.65"
        },
        "impliedVolatility": "331.432859",
        "greeks": {
          "delta": "0.17566826271590297",
          "gamma": "0.00006421464969136541",
          "theta": "-31580.401043302005",
          "vega": "2.1338147539141272"
        }
      },
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-12-27T08:00:00.000Z",
    "strike": "9000",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "1"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-12-27T08:00:00.000Z",
    "strike": "9250",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "0.8"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2020-03-27T08:00:00.000Z",
    "strike": "10000",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "1"
    },
    "put": null
  }
]

URL Endpoint

GET - https://api.sparrowexchange.com/trades/book/:pair?minStrike=8000&maxStrike=10000

PARAMS

Parameter value
minStrike 8000
maxStrike 10000

PATH VARIABLE

Parameter value
pair BTC/SP$

Display Order Book - Filter By Expiry

curl --location --request GET 'https://api.sparrowexchange.com/trades/book/BTC-SP$?minExpiry=2019-10-02T02:00:00.000Z&maxExpiry=2019-11-11T08:00:00.000Z'

Example Response

[
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "8000",
    "call": {
      "totalQuantity": "3",
      "maxBid": {
        "quantity": "1",
        "price": {
          "unitPremium": "307.44",
          "tradeUnitPremium": "30.744",
          "totalPremium": "307.44"
        },
        "impliedVolatility": "119.586292",
        "greeks": {
          "delta": "0.44551539755575087",
          "gamma": "0.0004513544127329389",
          "theta": "-17421.057502665175",
          "vega": "3.2623289499362587"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "8250",
    "call": {
      "totalQuantity": "1",
      "maxBid": {
        "quantity": "1",
        "price": {
          "unitPremium": "214.17",
          "tradeUnitPremium": "21.417",
          "totalPremium": "214.17"
        },
        "impliedVolatility": "117.992588",
        "greeks": {
          "delta": "0.3493781039763387",
          "gamma": "0.0003587379573724116",
          "theta": "-16101.110834773377",
          "vega": "3.0558761453717715"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-11T08:00:00.000Z",
    "strike": "8500",
    "call": {
      "totalQuantity": "0.1",
      "maxBid": {
        "quantity": "0.1",
        "price": {
          "unitPremium": "244.3",
          "tradeUnitPremium": "24.43",
          "totalPremium": "24.43"
        },
        "impliedVolatility": "92.162149",
        "greeks": {
          "delta": "0.3245546194179445",
          "gamma": "0.00025903867958489233",
          "theta": "-7420.420798469983",
          "vega": "4.89130212111081"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "9000",
    "call": {
      "totalQuantity": "19.5",
      "maxBid": null,
      "minAsk": {
        "quantity": "19.5",
        "price": {
          "unitPremium": "17.5",
          "tradeUnitPremium": "1.75",
          "totalPremium": "341.25"
        },
        "impliedVolatility": "84.591524",
        "greeks": {
          "delta": "0.06021156730496735",
          "gamma": "0.0000862361693246329",
          "theta": "-3721.4394036662957",
          "vega": "0.985187148023525"
        }
      },
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "9750",
    "call": {
      "totalQuantity": "0.1",
      "maxBid": null,
      "minAsk": {
        "quantity": "0.1",
        "price": {
          "unitPremium": "16.63",
          "tradeUnitPremium": "1.663",
          "totalPremium": "1.663"
        },
        "impliedVolatility": "118.826486",
        "greeks": {
          "delta": "0.04344833423026628",
          "gamma": "0.00004429923758647504",
          "theta": "-4039.034919879933",
          "vega": "0.7612003697120275"
        }
      },
      "openInterest": "3"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "10000",
    "call": {
      "totalQuantity": "0.8",
      "maxBid": {
        "quantity": "0.8",
        "price": {
          "unitPremium": "17.14",
          "tradeUnitPremium": "1.714",
          "totalPremium": "13.712"
        },
        "impliedVolatility": "130.182542",
        "greeks": {
          "delta": "0.04145904158414915",
          "gamma": "0.000038583612420825715",
          "theta": "-4253.108332603115",
          "vega": "0.73162465870199"
        }
      },
      "minAsk": null,
      "openInterest": "0.2"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "11500",
    "call": {
      "totalQuantity": "1",
      "maxBid": null,
      "minAsk": {
        "quantity": "1",
        "price": {
          "unitPremium": "221.65",
          "tradeUnitPremium": "22.165",
          "totalPremium": "221.65"
        },
        "impliedVolatility": "331.432859",
        "greeks": {
          "delta": "0.17566826271590297",
          "gamma": "0.00006421464969136541",
          "theta": "-31580.401043302005",
          "vega": "2.1338147539141272"
        }
      },
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-12-27T08:00:00.000Z",
    "strike": "9000",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "1"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-12-27T08:00:00.000Z",
    "strike": "9250",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "0.8"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2020-03-27T08:00:00.000Z",
    "strike": "10000",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "1"
    },
    "put": null
  }
]

URL Endpoint

GET https://api.sparrowexchange.com/trades/book/:pair?minStrike=8000&maxStrike=10000

PARAMS

Parameter value
minExpiry 2019-10-02T02:00:00.000Z <- date in ISO String
maxExpiry 2019-11-11T08:00:00.000Z <- date in ISO String

PATH VARIABLE

Parameter value
pair BTC/SP$

Display Order Book Depth

curl --location --request GET 'https://api.sparrowexchange.com/trades/book/depth/:pair?type=call&strike=8000&expiry=2019-10-11T08:00:00.000Z'

Example Response

[
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "8000",
    "call": {
      "totalQuantity": "3",
      "maxBid": {
        "quantity": "1",
        "price": {
          "unitPremium": "307.44",
          "tradeUnitPremium": "30.744",
          "totalPremium": "307.44"
        },
        "impliedVolatility": "119.586292",
        "greeks": {
          "delta": "0.44551539755575087",
          "gamma": "0.0004513544127329389",
          "theta": "-17421.057502665175",
          "vega": "3.2623289499362587"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "8250",
    "call": {
      "totalQuantity": "1",
      "maxBid": {
        "quantity": "1",
        "price": {
          "unitPremium": "214.17",
          "tradeUnitPremium": "21.417",
          "totalPremium": "214.17"
        },
        "impliedVolatility": "117.992588",
        "greeks": {
          "delta": "0.3493781039763387",
          "gamma": "0.0003587379573724116",
          "theta": "-16101.110834773377",
          "vega": "3.0558761453717715"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-11T08:00:00.000Z",
    "strike": "8500",
    "call": {
      "totalQuantity": "0.1",
      "maxBid": {
        "quantity": "0.1",
        "price": {
          "unitPremium": "244.3",
          "tradeUnitPremium": "24.43",
          "totalPremium": "24.43"
        },
        "impliedVolatility": "92.162149",
        "greeks": {
          "delta": "0.3245546194179445",
          "gamma": "0.00025903867958489233",
          "theta": "-7420.420798469983",
          "vega": "4.89130212111081"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "9000",
    "call": {
      "totalQuantity": "19.5",
      "maxBid": null,
      "minAsk": {
        "quantity": "19.5",
        "price": {
          "unitPremium": "17.5",
          "tradeUnitPremium": "1.75",
          "totalPremium": "341.25"
        },
        "impliedVolatility": "84.591524",
        "greeks": {
          "delta": "0.06021156730496735",
          "gamma": "0.0000862361693246329",
          "theta": "-3721.4394036662957",
          "vega": "0.985187148023525"
        }
      },
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "9750",
    "call": {
      "totalQuantity": "0.1",
      "maxBid": null,
      "minAsk": {
        "quantity": "0.1",
        "price": {
          "unitPremium": "16.63",
          "tradeUnitPremium": "1.663",
          "totalPremium": "1.663"
        },
        "impliedVolatility": "118.826486",
        "greeks": {
          "delta": "0.04344833423026628",
          "gamma": "0.00004429923758647504",
          "theta": "-4039.034919879933",
          "vega": "0.7612003697120275"
        }
      },
      "openInterest": "3"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "10000",
    "call": {
      "totalQuantity": "0.8",
      "maxBid": {
        "quantity": "0.8",
        "price": {
          "unitPremium": "17.14",
          "tradeUnitPremium": "1.714",
          "totalPremium": "13.712"
        },
        "impliedVolatility": "130.182542",
        "greeks": {
          "delta": "0.04145904158414915",
          "gamma": "0.000038583612420825715",
          "theta": "-4253.108332603115",
          "vega": "0.73162465870199"
        }
      },
      "minAsk": null,
      "openInterest": "0.2"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "11500",
    "call": {
      "totalQuantity": "1",
      "maxBid": null,
      "minAsk": {
        "quantity": "1",
        "price": {
          "unitPremium": "221.65",
          "tradeUnitPremium": "22.165",
          "totalPremium": "221.65"
        },
        "impliedVolatility": "331.432859",
        "greeks": {
          "delta": "0.17566826271590297",
          "gamma": "0.00006421464969136541",
          "theta": "-31580.401043302005",
          "vega": "2.1338147539141272"
        }
      },
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-12-27T08:00:00.000Z",
    "strike": "9000",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "1"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-12-27T08:00:00.000Z",
    "strike": "9250",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "0.8"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2020-03-27T08:00:00.000Z",
    "strike": "10000",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "1"
    },
    "put": null
  }
]

URL Endpoint

GET https://api.sparrowexchange.com/trades/book/depth/:pair?type=call&strike=8000&expiry=2019-10-11T08:00:00.000Z

PARAMS

Parameter value
type Call
strike 8000
expiry 2019-10-11T08:00:00.000Z

PATH VARIABLE

Parameter value
pair BTC/SP$

Display Order Book Depth - Filter By Action

curl --location --request GET 'https://api.sparrowexchange.com/trades/book/BTC-SP$?action=BUY'

Example Response

[
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "8000",
    "call": {
      "totalQuantity": "3",
      "maxBid": {
        "quantity": "1",
        "price": {
          "unitPremium": "307.44",
          "tradeUnitPremium": "30.744",
          "totalPremium": "307.44"
        },
        "impliedVolatility": "119.586292",
        "greeks": {
          "delta": "0.44551539755575087",
          "gamma": "0.0004513544127329389",
          "theta": "-17421.057502665175",
          "vega": "3.2623289499362587"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "8250",
    "call": {
      "totalQuantity": "1",
      "maxBid": {
        "quantity": "1",
        "price": {
          "unitPremium": "214.17",
          "tradeUnitPremium": "21.417",
          "totalPremium": "214.17"
        },
        "impliedVolatility": "117.992588",
        "greeks": {
          "delta": "0.3493781039763387",
          "gamma": "0.0003587379573724116",
          "theta": "-16101.110834773377",
          "vega": "3.0558761453717715"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-11T08:00:00.000Z",
    "strike": "8500",
    "call": {
      "totalQuantity": "0.1",
      "maxBid": {
        "quantity": "0.1",
        "price": {
          "unitPremium": "244.3",
          "tradeUnitPremium": "24.43",
          "totalPremium": "24.43"
        },
        "impliedVolatility": "92.162149",
        "greeks": {
          "delta": "0.3245546194179445",
          "gamma": "0.00025903867958489233",
          "theta": "-7420.420798469983",
          "vega": "4.89130212111081"
        }
      },
      "minAsk": null,
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "9000",
    "call": {
      "totalQuantity": "19.5",
      "maxBid": null,
      "minAsk": {
        "quantity": "19.5",
        "price": {
          "unitPremium": "17.5",
          "tradeUnitPremium": "1.75",
          "totalPremium": "341.25"
        },
        "impliedVolatility": "84.591524",
        "greeks": {
          "delta": "0.06021156730496735",
          "gamma": "0.0000862361693246329",
          "theta": "-3721.4394036662957",
          "vega": "0.985187148023525"
        }
      },
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "9750",
    "call": {
      "totalQuantity": "0.1",
      "maxBid": null,
      "minAsk": {
        "quantity": "0.1",
        "price": {
          "unitPremium": "16.63",
          "tradeUnitPremium": "1.663",
          "totalPremium": "1.663"
        },
        "impliedVolatility": "118.826486",
        "greeks": {
          "delta": "0.04344833423026628",
          "gamma": "0.00004429923758647504",
          "theta": "-4039.034919879933",
          "vega": "0.7612003697120275"
        }
      },
      "openInterest": "3"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "10000",
    "call": {
      "totalQuantity": "0.8",
      "maxBid": {
        "quantity": "0.8",
        "price": {
          "unitPremium": "17.14",
          "tradeUnitPremium": "1.714",
          "totalPremium": "13.712"
        },
        "impliedVolatility": "130.182542",
        "greeks": {
          "delta": "0.04145904158414915",
          "gamma": "0.000038583612420825715",
          "theta": "-4253.108332603115",
          "vega": "0.73162465870199"
        }
      },
      "minAsk": null,
      "openInterest": "0.2"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-10-04T08:00:00.000Z",
    "strike": "11500",
    "call": {
      "totalQuantity": "1",
      "maxBid": null,
      "minAsk": {
        "quantity": "1",
        "price": {
          "unitPremium": "221.65",
          "tradeUnitPremium": "22.165",
          "totalPremium": "221.65"
        },
        "impliedVolatility": "331.432859",
        "greeks": {
          "delta": "0.17566826271590297",
          "gamma": "0.00006421464969136541",
          "theta": "-31580.401043302005",
          "vega": "2.1338147539141272"
        }
      },
      "openInterest": "0"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-12-27T08:00:00.000Z",
    "strike": "9000",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "1"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2019-12-27T08:00:00.000Z",
    "strike": "9250",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "0.8"
    },
    "put": null
  },
  {
    "pair": "BTC-SP$",
    "expiry": "2020-03-27T08:00:00.000Z",
    "strike": "10000",
    "call": {
      "totalQuantity": "0",
      "maxBid": null,
      "minAsk": null,
      "openInterest": "1"
    },
    "put": null
  }
]

URL Endpoint

GET https://api.sparrowexchange.com/trades/book/:pair?action=BUY

PARAMS

Parameter value
action Buy

PATH VARIABLE

Parameter value
pair BTC/SP$

Display user trades history

curl --location --request GET 'https://api.sparrowexchange.com/trades/book/own' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

Example Response

[
  {
    "id": "bd3335ea-90a4-4958-86a0-5ac800b2f767",
    "action": "BUY",
    "type": "CALL",
    "lifetime": "GTD",
    "strike": "8500",
    "amount": {
      "coin": "BTC",
      "amount": "0.1"
    },
    "unfilled": {
      "coin": "BTC",
      "amount": "0.1"
    },
    "premium": {
      "unitPremium": "244.3",
      "tradeUnitPremium": "24.43",
      "totalPremium": "24.43"
    },
    "asset": "BTC",
    "currency": "SP$",
    "createdAt": "2019-09-30T05:54:04.687Z",
    "expiry": "2019-10-11T08:00:00.000Z",
    "status": "BOOKED",
    "locked": {
      "txFee": {
        "coin": "SP$",
        "amount": "0.780946",
        "sp$Equivalent": "0.780946"
      },
      "tradeLock": null,
      "premium": {
        "unitPremium": "244.3",
        "tradeUnitPremium": "24.43",
        "totalPremium": "24.43"
      }
    },
    "matched": {
      "amount": null,
      "payoff": null,
      "tradeLock": null,
      "tradeRelease": null,
      "premium": null
    },
    "contracts": [],
    "orderType": "PREMIUM",
    "impliedVolatility": "0.92693938"
  },
  {
    "id": "73148dac-ebb7-4c65-85a2-cb37e2e88679",
    "action": "SELL",
    "type": "PUT",
    "lifetime": "GTC",
    "strike": "8000",
    "amount": {
      "coin": "BTC",
      "amount": "0.1"
    },
    "unfilled": {
      "coin": "BTC",
      "amount": "0.1"
    },
    "premium": {
      "unitPremium": "365.24",
      "tradeUnitPremium": "36.524",
      "totalPremium": "36.524"
    },
    "asset": "BTC",
    "currency": "SP$",
    "createdAt": "2019-09-25T07:27:28.936Z",
    "expiry": "2019-10-04T08:00:00.000Z",
    "status": "CANCELED",
    "locked": {
      "txFee": null,
      "tradeLock": null,
      "premium": null
    },
    "matched": {
      "amount": null,
      "payoff": null,
      "tradeLock": null,
      "tradeRelease": null,
      "premium": null
    },
    "contracts": [],
    "orderType": "PREMIUM",
    "impliedVolatility": "1.078306"
  }
]

URL Endpoint

GET https://api.sparrowexchange.com/trades/book/own

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

Display user trades history - custom

curl --location --request GET 'https://api.sparrowexchange.com/trades/book/own?orderby=expiry&order=asc' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

Example Response

[
  {
    "id": "bd3335ea-90a4-4958-86a0-5ac800b2f767",
    "action": "BUY",
    "type": "CALL",
    "lifetime": "GTD",
    "strike": "8500",
    "amount": {
      "coin": "BTC",
      "amount": "0.1"
    },
    "unfilled": {
      "coin": "BTC",
      "amount": "0.1"
    },
    "premium": {
      "unitPremium": "244.3",
      "tradeUnitPremium": "24.43",
      "totalPremium": "24.43"
    },
    "asset": "BTC",
    "currency": "SP$",
    "createdAt": "2019-09-30T05:54:04.687Z",
    "expiry": "2019-10-11T08:00:00.000Z",
    "status": "BOOKED",
    "locked": {
      "txFee": {
        "coin": "SP$",
        "amount": "0.780946",
        "sp$Equivalent": "0.780946"
      },
      "tradeLock": null,
      "premium": {
        "unitPremium": "244.3",
        "tradeUnitPremium": "24.43",
        "totalPremium": "24.43"
      }
    },
    "matched": {
      "amount": null,
      "payoff": null,
      "tradeLock": null,
      "tradeRelease": null,
      "premium": null
    },
    "contracts": [],
    "orderType": "PREMIUM",
    "impliedVolatility": "0.92686728"
  },
  ...
]

URL Endpoint

GET https://api.sparrowexchange.com/trades/book/own?orderby=expiry&order=asc

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

PARAMS

Parameter value
orderby expiry
order asc

Display user's bidding and processing trade orders

curl --location --request GET 'https://api.sparrowexchange.com/trades/book/own?status=open' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

Example Response

[
  {
    "id": "bd3335ea-90a4-4958-86a0-5ac800b2f767",
    "action": "BUY",
    "type": "CALL",
    "lifetime": "GTD",
    "strike": "8500",
    "amount": {
      "coin": "BTC",
      "amount": "0.1"
    },
    "unfilled": {
      "coin": "BTC",
      "amount": "0.1"
    },
    "premium": {
      "unitPremium": "244.3",
      "tradeUnitPremium": "24.43",
      "totalPremium": "24.43"
    },
    "asset": "BTC",
    "currency": "SP$",
    "createdAt": "2019-09-30T05:54:04.687Z",
    "expiry": "2019-10-11T08:00:00.000Z",
    "status": "BOOKED",
    "locked": {
      "txFee": {
        "coin": "SP$",
        "amount": "0.780946",
        "sp$Equivalent": "0.780946"
      },
      "tradeLock": null,
      "premium": {
        "unitPremium": "244.3",
        "tradeUnitPremium": "24.43",
        "totalPremium": "24.43"
      }
    },
    "matched": {
      "amount": null,
      "payoff": null,
      "tradeLock": null,
      "tradeRelease": null,
      "premium": null
    },
    "contracts": [],
    "orderType": "PREMIUM",
    "impliedVolatility": "0.93049904"
  }
]

URL Endpoint

GET https://api.sparrowexchange.com/trades/book/own?status=open

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

PARAMS

Parameter value
status open

Display user's bidding and processing trade orders - custom

curl --location --request GET 'https://api.sparrowexchange.com/trades/book/own?status=open&orderby=expiry&order=asc' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID

Example Response

[
  {
    "id": "bd3335ea-90a4-4958-86a0-5ac800b2f767",
    "action": "BUY",
    "type": "CALL",
    "lifetime": "GTD",
    "strike": "8500",
    "amount": {
      "coin": "BTC",
      "amount": "0.1"
    },
    "unfilled": {
      "coin": "BTC",
      "amount": "0.1"
    },
    "premium": {
      "unitPremium": "244.3",
      "tradeUnitPremium": "24.43",
      "totalPremium": "24.43"
    },
    "asset": "BTC",
    "currency": "SP$",
    "createdAt": "2019-09-30T05:54:04.687Z",
    "expiry": "2019-10-11T08:00:00.000Z",
    "status": "BOOKED",
    "locked": {
      "txFee": {
        "coin": "SP$",
        "amount": "0.780946",
        "sp$Equivalent": "0.780946"
      },
      "tradeLock": null,
      "premium": {
        "unitPremium": "244.3",
        "tradeUnitPremium": "24.43",
        "totalPremium": "24.43"
      }
    },
    "matched": {
      "amount": null,
      "payoff": null,
      "tradeLock": null,
      "tradeRelease": null,
      "premium": null
    },
    "contracts": [],
    "orderType": "PREMIUM",
    "impliedVolatility": "0.93049904"
  }
]

URL Endpoint

GET https://api.sparrowexchange.com/trades/book/own?status=open&orderby=expiry&order=asc

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

PARAMS

Parameter value
status open
orderby expiry
order asc

Display user's canceled & expired trade orders

curl --location --request GET 'https://api.sparrowexchange.com/trades/book/own?status=closed' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

Example Response

[
  {
    "id": "73148dac-ebb7-4c65-85a2-cb37e2e88679",
    "action": "SELL",
    "type": "PUT",
    "lifetime": "GTC",
    "strike": "8000",
    "amount": {
      "coin": "BTC",
      "amount": "0.1"
    },
    "unfilled": {
      "coin": "BTC",
      "amount": "0.1"
    },
    "premium": {
      "unitPremium": "365.24",
      "tradeUnitPremium": "36.524",
      "totalPremium": "36.524"
    },
    "asset": "BTC",
    "currency": "SP$",
    "createdAt": "2019-09-25T07:27:28.936Z",
    "expiry": "2019-10-04T08:00:00.000Z",
    "status": "CANCELED",
    "locked": {
      "txFee": null,
      "tradeLock": null,
      "premium": null
    },
    "matched": {
      "amount": null,
      "payoff": null,
      "tradeLock": null,
      "tradeRelease": null,
      "premium": null
    },
    "contracts": [],
    "orderType": "PREMIUM",
    "impliedVolatility": "1.078306"
  },
  ...
]

URL Endpoint

GET https://api.sparrowexchange.com/trades/book/own?status=closed

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

PARAMS

Parameter value
status closed

Display user's canceled & expired trade orders - custom

curl --location --request GET 'https://api.sparrowexchange.com/trades/book/own?status=closed&orderby=expiry&order=asc' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

Example Response

[
  {
    "id": "49c95251-6182-436e-9631-d39bf93ae225",
    "action": "BUY",
    "type": "CALL",
    "lifetime": "GTC",
    "strike": "11000",
    "amount": {
      "coin": "BTC",
      "amount": "0.1"
    },
    "unfilled": {
      "coin": "BTC",
      "amount": "0.1"
    },
    "premium": {
      "unitPremium": "46.72",
      "tradeUnitPremium": "4.672",
      "totalPremium": "4.672"
    },
    "asset": "BTC",
    "currency": "SP$",
    "createdAt": "2019-09-24T16:19:48.520Z",
    "expiry": "2019-10-04T08:00:00.000Z",
    "status": "CANCELED",
    "locked": {
      "txFee": null,
      "tradeLock": null,
      "premium": null
    },
    "matched": {
      "amount": null,
      "payoff": null,
      "tradeLock": null,
      "tradeRelease": null,
      "premium": null
    },
    "contracts": [],
    "orderType": "PREMIUM",
    "impliedVolatility": "0.66075075"
  },
  ...
]

URL Endpoint

GET https://api.sparrowexchange.com/trades/book/own?status=closed&orderby=expiry&order=asc

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

PARAMS

Parameter value
status closed
orderby expiry
order asc

Display user's buy trade orders

curl --location --request GET 'https://api.sparrowexchange.com/trades/book/own?filter=buy' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

Example Response

[
    {
      "id": "bd3335ea-90a4-4958-86a0-5ac800b2f767",
      "action": "BUY",
      "type": "CALL",
      "lifetime": "GTD",
      "strike": "8500",
      "amount": {
        "coin": "BTC",
        "amount": "0.1"
      },
      "unfilled": {
        "coin": "BTC",
        "amount": "0.1"
      },
      "premium": {
        "unitPremium": "244.3",
        "tradeUnitPremium": "24.43",
        "totalPremium": "24.43"
      },
      "asset": "BTC",
      "currency": "SP$",
      "createdAt": "2019-09-30T05:54:04.687Z",
      "expiry": "2019-10-11T08:00:00.000Z",
      "status": "BOOKED",
      "locked": {
        "txFee": {
          "coin": "SP$",
          "amount": "0.780946",
          "sp$Equivalent": "0.780946"
        },
        "tradeLock": null,
        "premium": {
          "unitPremium": "244.3",
          "tradeUnitPremium": "24.43",
          "totalPremium": "24.43"
        }
      },
      "matched": {
        "amount": null,
        "payoff": null,
        "tradeLock": null,
        "tradeRelease": null,
        "premium": null
      },
      "contracts": [],
      "orderType": "PREMIUM",
      "impliedVolatility": "0.93382661"
    },
  ...
]

URL Endpoint

GET https://api.sparrowexchange.com/trades/book/own?filter=buy

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

PARAMS

Parameter value
filter buy

Display user's buy trade orders - custom

curl --location --request GET 'https://api.sparrowexchange.com/trades/book/own?filter=buy&status=closed&orderby=expiry&order=asc' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

Example Response

[
    {
      "id": "bd3335ea-90a4-4958-86a0-5ac800b2f767",
      "action": "BUY",
      "type": "CALL",
      "lifetime": "GTD",
      "strike": "8500",
      "amount": {
        "coin": "BTC",
        "amount": "0.1"
      },
      "unfilled": {
        "coin": "BTC",
        "amount": "0.1"
      },
      "premium": {
        "unitPremium": "244.3",
        "tradeUnitPremium": "24.43",
        "totalPremium": "24.43"
      },
      "asset": "BTC",
      "currency": "SP$",
      "createdAt": "2019-09-30T05:54:04.687Z",
      "expiry": "2019-10-11T08:00:00.000Z",
      "status": "BOOKED",
      "locked": {
        "txFee": {
          "coin": "SP$",
          "amount": "0.780946",
          "sp$Equivalent": "0.780946"
        },
        "tradeLock": null,
        "premium": {
          "unitPremium": "244.3",
          "tradeUnitPremium": "24.43",
          "totalPremium": "24.43"
        }
      },
      "matched": {
        "amount": null,
        "payoff": null,
        "tradeLock": null,
        "tradeRelease": null,
        "premium": null
      },
      "contracts": [],
      "orderType": "PREMIUM",
      "impliedVolatility": "0.93382661"
    },
  ...
]

URL Endpoint

GET https://api.sparrowexchange.com/trades/book/own?filter=buy&status=closed&orderby=expiry&order=asc

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

PARAMS

Parameter value
filter buy
status closed
orderby expiry
order asc

Display user's sell trade orders

curl --location --request GET 'https://api.sparrowexchange.com/trades/book/own?filter=sell' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID''

Example Response

[
    {
    "id": "bd3335ea-90a4-4958-86a0-5ac800b2f767",
    "action": "BUY",
    "type": "CALL",
    "lifetime": "GTD",
    "strike": "8500",
    "amount": {
      "coin": "BTC",
      "amount": "0.1"
    },
    "unfilled": {
      "coin": "BTC",
      "amount": "0.1"
    },
    "premium": {
      "unitPremium": "244.3",
      "tradeUnitPremium": "24.43",
      "totalPremium": "24.43"
    },
    "asset": "BTC",
    "currency": "SP$",
    "createdAt": "2019-09-30T05:54:04.687Z",
    "expiry": "2019-10-11T08:00:00.000Z",
    "status": "BOOKED",
    "locked": {
      "txFee": {
        "coin": "SP$",
        "amount": "0.780946",
        "sp$Equivalent": "0.780946"
      },
      "tradeLock": null,
      "premium": {
        "unitPremium": "244.3",
        "tradeUnitPremium": "24.43",
        "totalPremium": "24.43"
      }
    },
    "matched": {
      "amount": null,
      "payoff": null,
      "tradeLock": null,
      "tradeRelease": null,
      "premium": null
    },
    "contracts": [],
    "orderType": "PREMIUM",
    "impliedVolatility": "0.94471709"
  },
  ...
]

URL Endpoint

GET https://api.sparrowexchange.com/trades/book/own?filter=sell

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

PARAMS

Parameter value
filter sell

Display user's buy trade orders - custom

curl --location --request GET 'https://api.sparrowexchange.com/trades/book/own?filter=sell&orderby=expiry&order=asc' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

Example Response

[
    {
    "id": "bd3335ea-90a4-4958-86a0-5ac800b2f767",
    "action": "BUY",
    "type": "CALL",
    "lifetime": "GTD",
    "strike": "8500",
    "amount": {
      "coin": "BTC",
      "amount": "0.1"
    },
    "unfilled": {
      "coin": "BTC",
      "amount": "0.1"
    },
    "premium": {
      "unitPremium": "244.3",
      "tradeUnitPremium": "24.43",
      "totalPremium": "24.43"
    },
    "asset": "BTC",
    "currency": "SP$",
    "createdAt": "2019-09-30T05:54:04.687Z",
    "expiry": "2019-10-11T08:00:00.000Z",
    "status": "BOOKED",
    "locked": {
      "txFee": {
        "coin": "SP$",
        "amount": "0.780946",
        "sp$Equivalent": "0.780946"
      },
      "tradeLock": null,
      "premium": {
        "unitPremium": "244.3",
        "tradeUnitPremium": "24.43",
        "totalPremium": "24.43"
      }
    },
    "matched": {
      "amount": null,
      "payoff": null,
      "tradeLock": null,
      "tradeRelease": null,
      "premium": null
    },
    "contracts": [],
    "orderType": "PREMIUM",
    "impliedVolatility": "0.94471709"
  },
  ...
]

URL Endpoint

GET https://api.sparrowexchange.com/trades/book/own?filter=sell&orderby=expiry&order=asc

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

PARAMS

Parameter value
filter sell
orderby expiry
order asc

Display user's single trade order with detail

curl --location --request GET 'https://api.sparrowexchange.com/trades/book/own/bd3335ea-90a4-4958-86a0-5ac800b2f767' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

Example Response

{
  "id": "bd3335ea-90a4-4958-86a0-5ac800b2f767",
  "action": "BUY",
  "type": "CALL",
  "lifetime": "GTD",
  "strike": "8500",
  "amount": {
    "coin": "BTC",
    "amount": "0.1"
  },
  "unfilled": {
    "coin": "BTC",
    "amount": "0.1"
  },
  "premium": {
    "unitPremium": "244.3",
    "tradeUnitPremium": "24.43",
    "totalPremium": "24.43"
  },
  "asset": "BTC",
  "currency": "SP$",
  "createdAt": "2019-09-30T05:54:04.687Z",
  "expiry": "2019-10-11T08:00:00.000Z",
  "status": "BOOKED",
  "locked": {
    "txFee": {
      "coin": "SP$",
      "amount": "0.780946",
      "sp$Equivalent": "0.780946"
    },
    "tradeLock": null,
    "premium": {
      "unitPremium": "244.3",
      "tradeUnitPremium": "24.43",
      "totalPremium": "24.43"
    }
  },
  "matched": {
    "amount": null,
    "payoff": null,
    "tradeLock": null,
    "tradeRelease": null,
    "premium": null
  },
  "contracts": [],
  "orderType": "PREMIUM",
  "impliedVolatility": "0.92780481"
}

URL Endpoint

GET https://api.sparrowexchange.com/trades/book/own/:tradeOrderId

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

PARAMS

Parameter value
tradeOrderId bd3335ea-90a4-4958-86a0-5ac800b2f767

Cancel an order

curl --location --request POST 'https://api.sparrowexchange.com/trades/book/cancel/c7f68417-839c-4c60-abdf-162e66327e48' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID' \
--data-raw ''

URL Endpoint

POST https://api.sparrowexchange.com/trades/book/cancel/:trade

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

PARAMS

Parameter value
trade c7f68417-839c-4c60-abdf-162e66327e48

Bulk Cancel Order

curl --location --request POST 'https://api.sparrowexchange.com/trades/book/bulkCancel' \
--header 'Content-Type: application/json' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID' \
--data-raw '{
    "tradeIds": [
        "80bc25a6-25a3-4424-9c1f-d46cbc88998f",
        "c74498aa-69ab-42f3-b3ef-1e930cdc7167"
    ]
}'

Example Body

{
    "tradeIds": [
        "80bc25a6-25a3-4424-9c1f-d46cbc88998f",
        "c74498aa-69ab-42f3-b3ef-1e930cdc7167"
    ]
}

URL Endpoint

POST https://api.sparrowexchange.com/trades/book/bulkCancel

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

Display user's trade contracts

curl --location --request GET 'https://api.sparrowexchange.com/trades/contracts/own' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

URL Endpoint

GET https://api.sparrowexchange.com/trades/contracts/own

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

Display user's active trade contracts

curl --location --request GET 'https://api.sparrowexchange.com/trades/contracts/own?status=active' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

URL Endpoint

GET https://api.sparrowexchange.com/trades/contracts/own?status=active

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

Params

Parameter value
status active

Display user's settled trade contracts

curl --location --request GET 'https://api.sparrowexchange.com/trades/contracts/own?status=settled' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

URL Endpoint

GET https://api.sparrowexchange.com/trades/contracts/own?status=settled

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

Params

Parameter value
status settled

Display user's buy trade contracts

curl --location --request GET 'https://api.sparrowexchange.com/trades/contracts/own?filter=buy' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

URL Endpoint

GET https://api.sparrowexchange.com/trades/contracts/own?filter=buy

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

Params

Parameter value
filter buy

Display user's sell trade contracts

curl --location --request GET 'https://api.sparrowexchange.com/trades/contracts/own?filter=sell' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

URL Endpoint

GET https://api.sparrowexchange.com/trades/contracts/own?filter=sell

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

Params

Parameter value
filter sell

Display user's trade contracts - custom

curl --location --request GET 'https://api.sparrowexchange.com/trades/contracts/own?filter=sell&status=settled' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

URL Endpoint

GET https://api.sparrowexchange.com/trades/contracts/own?filter=sell&status=settled

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

Params

Parameter value
filter sell
status settled

Display user's trade contracts (group by market)

curl --location --request GET 'https://api.sparrowexchange.com/trades/contracts/own?format=grouped' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

URL Endpoint

GET https://api.sparrowexchange.com/trades/contracts/own?format=grouped

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

Params

Parameter value
format grouped (list / grouped (default is list) refer to TRD-CN-1a)

Display all trade contracts

curl --location --request GET 'https://api.sparrowexchange.com/trades/contracts' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

By default, sorted by createdAt and status is ACTIVE

URL Endpoint

GET https://api.sparrowexchange.com/trades/contracts

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

Display all settled trade contracts

curl --location --request GET 'https://api.sparrowexchange.com/trades/contracts?status=settled' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

URL Endpoint

GET https://api.sparrowexchange.com/trades/contracts?status=settled

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

PARAMS

Parameter value
status settled

Display all put trade contracts

curl --location --request GET 'https://api.sparrowexchange.com/trades/contracts?type=put' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

URL Endpoint

GET https://api.sparrowexchange.com/trades/contracts?type=put

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

PARAMS

Parameter value
type put

Display all call trade contracts

curl --location --request GET 'https://api.sparrowexchange.com/trades/contracts?type=call' \
--header 'Authorization: Your Authorization Token' \
--header 'api-key: Your API Key ID'

URL Endpoint

GET https://api.sparrowexchange.com/trades/contracts?type=put

HEADERS

Parameter value
Authorization Your authorization key
api-key Your API Key ID

PARAMS

Parameter value
type put

Private WebSocket

Environment URL
Sandbox https://ws.sparrowsandbox.com/
Production https://ws.sparrowexchange.com/

HEAD - Streaming URL

curl --location --head 'https://ws.sparrowsandbox.com/stream?api-key=Your%20API%20Key%20ID&authorization=Your%20Authorization%20Token'

This is the URL of websocket to connect to. stream?api-key={{apiKeyId}}&authorization={{token}} api-key is user's api key authorization is the token signed with private key See API key section for details on how to generate authorization

URL Endpoint

https://ws.sparrowsandbox.com/stream?api-key=Your API Key ID&authorization=Your Authorization Token

HEADERS

Parameter Default
Content-Type application/json
Authorization Your Authorization Token

Pricing Data (API)

Environment URL
Sandbox https://pricing.sparrowsandbox.com/v1/
Production https://pricing.sparrowexchange.com/v1/

Ticker - Check system heartbeat

curl --location --request GET 'https://pricing.sparrowexchange.com/v1/heartbeat'

Example Response

{
  "message": {
    "connection": true
  },
  "status": "success"
}

URL Endpoint

GET https://pricing.sparrowexchange.com/v1/heartbeat

Return system status

Ticker - Check system timestamp

curl --location --request GET 'https://pricing.sparrowexchange.com/v1/time'

Example Response

{
  "message": {
    "serverTime": 1569549768803
  },
  "status": "success"
}

URL Endpoint

GET https://pricing.sparrowexchange.com/v1/time

Return the current timestamp in millseconds on server

Ticker - List of symbols

curl --location --request GET 'https://pricing.sparrowexchange.com/v1/symbols'

Example Response

{
  "result": {
    "symbols": [
      "BTC-SP$",
      "ETH-SP$"
    ]
  },
  "status": "success"
}

URL Endpoint

GET https://pricing.sparrowexchange.com/v1/tick/:symbol

Retrieves available trading symbols. This method can be used to see which symbols are available for trading.

Ticker - Price range within last 24 hours

curl --location --request GET 'https://pricing.sparrowexchange.com/v1/tick/price_range'

Example Response

{
  "result": [
    {
      "high": 8462.76,
      "low": 7731.83,
      "symbol": "BTC-SP$"
    },
    {
      "high": 170.98,
      "low": 152.37,
      "symbol": "ETH-SP$"
    }
  ],
  "status": "success"
}

URL Endpoint

GET https://pricing.sparrowexchange.com/v1/tick/price_range

Return ticker price and change comparing to price at 24 hour ago by number and percentage

Options - Last Settlement Price

curl --location --request GET 'https://pricing.sparrowexchange.com/v1/settlement'

Example Response

{
  "pricings": {
    "BTC-SP$": 7802.57,
    "ETH-SP$": 166.88
  },
  "settlementTime": "2019-09-30T08:00:00Z",
  "signature": "iQEcBAABAgAGBQJdkwD6AAoJEOhpe7MWsGgSrtcH/2s3n7BZUDzTLSwCz4EDk7c265pzciDJKMpxZSIFQfLTpQ52xTmbt+MSfvWlnrVBXlJWF5zTN7egjDrZCqqLiT6EXOg+xGdlJY51exoi9cJoI0VJatWA5sjANLje3QCl8xbpXWluwVeZqw159NM42U0Z01uH94DcidzkxXr4JL5WCmVbVN/RU9TmrZXS7F7FQ+IblMPEPYRCwsOYbAts4+FJ5B/Fxk3zXNOLEBxQrNatrSbTpxY/JxucXP/bxkT4s3RqOV1p2S0DSm0x9cA3gg5RpmWwFaX109lo5y9BEuzn0/zzCZ/tRI9lSH/gZr9MjcM84kqOjHOAhq0KiarOMFE==5wq6"
}

URL Endpoint

GET https://pricing.sparrowexchange.com/v1/settlement

Return last settlement price. It refreshes on fixed time(currently 8AM UTC) on daily basis.

Options - Historical settlement prices

curl --location --request GET 'https://pricing.sparrowexchange.com/v1/settlement_hist/:days'

Example Response

[
  {
    "settlement_time": "2019-09-26T08:00:00Z",
    "price": {
      "BTC-USD": 8376.68,
      "ETH-USD": 169.15
    }
  },
  {
    "settlement_time": "2019-09-25T08:00:00Z",
    "price": {
      "BTC-USD": 8357.81,
      "ETH-USD": 164.96
    }
  },
  {
    "settlement_time": "2019-09-24T08:00:00Z",
    "price": {
      "BTC-USD": 9736.85,
      "ETH-USD": 198.74
    }
  },
  {
    "settlement_time": "2019-09-23T08:00:00Z",
    "price": {
      "BTC-USD": 9894.95,
      "ETH-USD": 208.5
    }
  },
  {
    "settlement_time": "2019-09-22T08:00:00Z",
    "price": {
      "BTC-USD": 10001.7,
      "ETH-USD": 212.17
    }
  }
]

URL Endpoint

GET https://pricing.sparrowexchange.com/v1/settlement_hist/:days

Retrieve historical settlement prices up to 31 days

PARAMS

Parameter value
days 1 (up to 31)

Options - Upcoming settlement dates

curl --location --request GET 'https://pricing.sparrowexchange.com/v1/settlement_dates'

Example Response

{
  "result": {
    "settlement_dates": [
      "27/09/2019",
      "04/10/2019",
      "11/10/2019",
      "18/10/2019"
    ],
    "settlement_time": [
      "2019-09-27T08:00",
      "2019-10-04T08:00",
      "2019-10-11T08:00",
      "2019-10-18T08:00"
    ]
  },
  "status": "success"
}

URL Endpoint

GET https://pricing.sparrowexchange.com/v1/settlement_dates

Return upcoming settlement datetime

Options - Options Price

curl --location --request GET 'https://pricing.sparrowexchange.com/v1/option/price?symbol=BTC-SP$&strike=8500&expiry_date=11/10/2019&quantity=1.1&action=buy&type=call' \
--header 'Content-Type: application/json'

Example Response

{
  "result": {
    "expiry_date": "11/10/2019",
    "iv": 1.0393,
    "option_price": 505.93,
    "quantity": 1.1,
    "spot": 8018.15,
    "strike": 8500
  },
  "status": "success"
}

URL Endpoint

GET https://pricing.sparrowexchange.com/v1/option/price?symbol=:symbol&strike=:strike&expiry_date=:expiry_date&quantity=:quantity&action=:action&type=:type

Return option price. The strike and quantity should follow step size which vary from time and time.The unit for option price is SP$.iv is implied volatility at which price is calculated.

HEADERS

Parameter value
Content-Type application/json

PARAMS

Parameter value
symbol :symbol (symbol for option trading. symbol supported can be retrieved from /symbols)
strike :strike (strike price)
expiry_date :expiry_date (option expiry date in DD/MM/YYYY format)
quantity :quantity (option size)
action :action (buy or sell)
type :type (call or put)

Options - Current market iv

curl --location --request GET 'https://pricing.sparrowexchange.com/v1/option/iv?symbol=BTC-SP$&strike=8500&expiry_days=4&action=buy&type=call' \
--header 'Content-Type: application/json'

Example Response

{
  "action": "buy",
  "expiry_days": 4,
  "iv": 1.6643,
  "strike": 8500,
  "symbol": "BTC-SP$",
  "type": "call"
}

URL Endpoint

GET https://pricing.sparrowexchange.com/v1/option/iv?symbol=:symbol&strike=:strike&expiry_days=:expiry_days&action=:action&type=:type

Return current implied volatility

HEADERS

Parameter value
Content-Type application/json

PARAMS

Parameter value
symbol :symbol (symbol for option trading. symbol supported can be retrieved from /symbols)
strike :strike (strike price)
expiry_days :expiry_days (number of days from now to expiry date)
quantity :quantity (option size)
action :action (buy or sell)
type :type (call or put)

Pricing Data (Websocket)

The base endpoint is:

Production : https://pricing.sparrowexchange.com/v1/ws

Sandbox : https://pricing.sparrowsandbox.com/v1/ws

All symbols for streams areĀ uppercase

Please find sample scripts below with socket.io client library

Sample Scripts with socket.io client library

<!DOCTYPE HTML>
<html>
<head>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.2.0/socket.io.js"></script>
    <script type="text/javascript" charset="utf-8">
        $(document).ready(function() {
            var host = "https://pricing.sparrowexchange.com";

            // tick price and price change
            var ws_tick = host+"/v1/ws/tick"  
            var tick_socket = io.connect(ws_tick,{transports:["websocket"]}); 
            tick_socket.on('tick_change',function(message1) {
                        console.log(message1);
                    });

            // all OHLC data with identifier 'interval': 1T 5T 15T 30T 1H 4H 1D
            // ohlc_BTC-SP$ received messages for BTC. 
            // ohlc_ETH-SP$ eceived messages for ETH
            tick_socket.on('ohlc_BTC-SP$',function(message1) {
                         console.log('ohlc')
                         console.log(message1);
            //             // filter message by interval for further prcocess
                     });

             tick_socket.on('settlement_datetime',function(message1) {
                         console.log('settlement_datetime')
                         console.log(message1);
                     });

             tick_socket.emit('get_server_time',function(message1) {
                             console.log("get_server_time");
                             console.log(message1)
                         });

            ohlc_hist_req = {"symbol":"BTC-SP$","candle_no":100,"period":"1D","base_timestamp":1584682466823}
             tick_socket.emit('load_ohlc_hist',ohlc_hist_req,function(message1) {
                             console.log("load_ohlc_hist");
                             console.log(message1)
                         });

            // Get options premium  
            var ws_option = host+"/v1/ws/premium"  
            var option_socket = io.connect(ws_option,{transports:["websocket"]}); 
            var strike = 10000
            req_json = {"symbol": "BTC-SP$", "strike":strike,"expiry_date": "01/08/2020", "quantity": 2, "action": "BUY", "type": "CALL"};
            option_socket.emit('get_premium', req_json,function(message1) {
                             console.log("premium_update");
                             console.log(message1)
                         });
        });
    </script>
</head>
<body>
</body>
</html>

Options Pricing

get_premium

Channel url : /premium

Events : get_premium

Update frequency: when emit get_premium event

Calculate premium for options with specific symbol, strike, expiry date, quantity, buy/sell and call/put

Example Request

{
   "symbol":"BTC-SP$",
   "strike":10000,
   "expiry_date":"06/03/2020",
   "quantity":2,
   "action":"BUY",
   "type":"CALL"
}

Spot Pricing

tick_change

Channel url : /tick

Events : tick_change

Socket pushes tick price updates to clients

Update frequency: push updates every 3 seconds

settlement_datetime

Channel url : /tick

Events : settlement_datetime

Socket pushes all available settlement date and time to clients

Update frequency: once a week after weekly settlement

OHLC_withSymbol

Channel url : /tick

Events: ohlc_<symbol> following by symbol. Eg. ohlc_BTC-SP$

Socket pushes Kline/Candlestick ohlc updates to clients

Supported intervals: 1T, 5T, 15T, 30T, 1H, 4H, 1D

Example Request

{
    "symbol" : "BTC-SP$",
    "candle_no" : 100,
    "period" : "1D",
    "base_timestamp":1584682466823
}

get_server_time

Channel url : /tick

Socket pushes server time to clients

Update frequency: when emit get_server_time event

Questions/Comments

If you have any questions or comments, please let us know at [email protected].