Skip to main content
POST
/
contracts
/
pricing
Get Contract Pricing
curl --request POST \
  --url https://api-options.sandbox.rails.xyz/contracts/pricing \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "market": "BTC-3JUL26-62000-C",
  "side": "buy",
  "forward": "61665.1057145",
  "price": "150.00",
  "riskFreeRate": "0.05",
  "qty": "1"
}
'
import requests

url = "https://api-options.sandbox.rails.xyz/contracts/pricing"

payload = {
"market": "BTC-3JUL26-62000-C",
"side": "buy",
"forward": "61665.1057145",
"price": "150.00",
"riskFreeRate": "0.05",
"qty": "1"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
market: 'BTC-3JUL26-62000-C',
side: 'buy',
forward: '61665.1057145',
price: '150.00',
riskFreeRate: '0.05',
qty: '1'
})
};

fetch('https://api-options.sandbox.rails.xyz/contracts/pricing', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api-options.sandbox.rails.xyz/contracts/pricing",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'market' => 'BTC-3JUL26-62000-C',
'side' => 'buy',
'forward' => '61665.1057145',
'price' => '150.00',
'riskFreeRate' => '0.05',
'qty' => '1'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api-options.sandbox.rails.xyz/contracts/pricing"

payload := strings.NewReader("{\n \"market\": \"BTC-3JUL26-62000-C\",\n \"side\": \"buy\",\n \"forward\": \"61665.1057145\",\n \"price\": \"150.00\",\n \"riskFreeRate\": \"0.05\",\n \"qty\": \"1\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api-options.sandbox.rails.xyz/contracts/pricing")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"market\": \"BTC-3JUL26-62000-C\",\n \"side\": \"buy\",\n \"forward\": \"61665.1057145\",\n \"price\": \"150.00\",\n \"riskFreeRate\": \"0.05\",\n \"qty\": \"1\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api-options.sandbox.rails.xyz/contracts/pricing")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"market\": \"BTC-3JUL26-62000-C\",\n \"side\": \"buy\",\n \"forward\": \"61665.1057145\",\n \"price\": \"150.00\",\n \"riskFreeRate\": \"0.05\",\n \"qty\": \"1\"\n}"

response = http.request(request)
puts response.read_body
{
  "input": {
    "market": "BTC-3JUL26-62000-C",
    "side": "buy",
    "forward": "61665.1057145",
    "price": "150.00",
    "riskFreeRate": "0.05",
    "qty": "1"
  },
  "iv": "0.3041",
  "markPrice": "149.16",
  "delta": "0.3222",
  "gamma": "0.00050170",
  "vega": "8.4473",
  "theta": "-240.74",
  "rho": "-0.002176",
  "buyingPower": "10000.00",
  "estimatedFees": "18.50",
  "marginUsed": "174.75",
  "estimatedLiquidationPrice": "0.00",
  "newAvailableBalance": "9806.75"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
market
string
required

Option contract name, e.g. BTC-19JUN26-62000-C. Strike, expiry, and type are derived from it.

side
string
required

Order side: buy or sell.

forward
string
required

Forward price of the underlying (positive decimal).

price
string
required

Candidate option premium to evaluate (non-negative decimal). Implied volatility and Greeks are derived from it.

riskFreeRate
string
required

Annualized risk-free rate as a decimal, e.g. 0.05.

qty
string
required

Order quantity (positive decimal).

Response

200 - application/json

Pricing, Greeks, and order estimates

input
object

Echo of the request inputs.

iv
string

Implied volatility derived from the supplied price.

markPrice
string

Current mark price of the contract.

delta
string
gamma
string
vega
string
theta
string
rho
string
buyingPower
string

Buying power available for this order.

estimatedFees
string

Estimated fees for the order.

marginUsed
string

Margin the order would consume.

estimatedLiquidationPrice
string

Estimated liquidation price after the order.

newAvailableBalance
string

Projected available balance after the order.