Skip to main content
POST
/
portfolio-margining
/
simulate
Calculate portfolio margin, pnl and greeks
curl --request POST \
  --url https://demo-futures.kraken.com/derivatives/api/v3/portfolio-margining/simulate \
  --header 'APIKey: <api-key>' \
  --header 'Authent: <api-key>'
import requests

url = "https://demo-futures.kraken.com/derivatives/api/v3/portfolio-margining/simulate"

headers = {
"APIKey": "<api-key>",
"Authent": "<api-key>"
}

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

print(response.text)
const options = {method: 'POST', headers: {APIKey: '<api-key>', Authent: '<api-key>'}};

fetch('https://demo-futures.kraken.com/derivatives/api/v3/portfolio-margining/simulate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
package main

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

func main() {

url := "https://demo-futures.kraken.com/derivatives/api/v3/portfolio-margining/simulate"

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

req.Header.Add("APIKey", "<api-key>")
req.Header.Add("Authent", "<api-key>")

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

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

fmt.Println(string(body))

}
{
  "maintenanceMargin": 123,
  "initialMargin": 123,
  "pnl": 123,
  "portfolioMarginBreakdown": {
    "totalCrossAssetNettedMarketRisk": 123,
    "totalMarketRisk": 123,
    "totalAbsoluteOptionPositionDeltaNotional": 123,
    "netPortfolioDelta": 123,
    "totalPremium": 123,
    "isBuyOnly": true,
    "futuresMaintenanceMargin": 123,
    "totalScenarioPnls": [
      123
    ]
  },
  "greeks": {},
  "result": "success",
  "serverTime": "2020-08-27T17:03:33.196Z"
}

Authorizations

APIKey
string
header
required

General API key with at least read-only access

Authent
string
header
required

Authentication string

Query Parameters

Response

200 - application/json

Simulated portfolio calculations

maintenanceMargin
number<double>
required
initialMargin
number<double>
required
pnl
number<double>
required
portfolioMarginBreakdown
object
required

Breakdown of components that make up the portfolio margin calculation.

greeks
object
required
result
enum<string>
required
Available options:
success
Example:

"success"

serverTime
string<date-time>
required

Server time in Coordinated Universal Time (UTC)

Example:

"2020-08-27T17:03:33.196Z"