curl --request GET \
--url https://staging.apimonaco.xyz/api/v1/accounts/me/portfolio \
--header 'X-Monaco-Signature: <api-key>'import requests
url = "https://staging.apimonaco.xyz/api/v1/accounts/me/portfolio"
headers = {"X-Monaco-Signature": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Monaco-Signature': '<api-key>'}};
fetch('https://staging.apimonaco.xyz/api/v1/accounts/me/portfolio', 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://staging.apimonaco.xyz/api/v1/accounts/me/portfolio",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Monaco-Signature: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://staging.apimonaco.xyz/api/v1/accounts/me/portfolio"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Monaco-Signature", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://staging.apimonaco.xyz/api/v1/accounts/me/portfolio")
.header("X-Monaco-Signature", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.apimonaco.xyz/api/v1/accounts/me/portfolio")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Monaco-Signature"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"period": "30d",
"volume": "231.81",
"totalTrades": "42",
"totalOrders": "56",
"feesPaid": "0.12",
"pnl": "-0.01",
"totalEquity": "280.93",
"spotEquity": "280.93",
"perpsEquity": "0.00",
"winLossRatio": 0.65,
"maxDrawdown": "0.00",
"unrealizedPnl": "12.34",
"totalPnl": "10.11",
"pnlBreakdown": {
"spotRealized": "3.21",
"spotUnrealized": "1.00",
"perpsRealized": "5.55",
"perpsUnrealized": "2.00",
"fundingPaid": "0.50",
"fees": "1.15"
}
}Get portfolio stats
Get portfolio stats.
Get aggregate portfolio statistics for the authenticated user, scoped by time period. Includes volume, PnL, fees, equity, and win/loss metrics.
curl --request GET \
--url https://staging.apimonaco.xyz/api/v1/accounts/me/portfolio \
--header 'X-Monaco-Signature: <api-key>'import requests
url = "https://staging.apimonaco.xyz/api/v1/accounts/me/portfolio"
headers = {"X-Monaco-Signature": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Monaco-Signature': '<api-key>'}};
fetch('https://staging.apimonaco.xyz/api/v1/accounts/me/portfolio', 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://staging.apimonaco.xyz/api/v1/accounts/me/portfolio",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Monaco-Signature: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://staging.apimonaco.xyz/api/v1/accounts/me/portfolio"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Monaco-Signature", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://staging.apimonaco.xyz/api/v1/accounts/me/portfolio")
.header("X-Monaco-Signature", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.apimonaco.xyz/api/v1/accounts/me/portfolio")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Monaco-Signature"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"period": "30d",
"volume": "231.81",
"totalTrades": "42",
"totalOrders": "56",
"feesPaid": "0.12",
"pnl": "-0.01",
"totalEquity": "280.93",
"spotEquity": "280.93",
"perpsEquity": "0.00",
"winLossRatio": 0.65,
"maxDrawdown": "0.00",
"unrealizedPnl": "12.34",
"totalPnl": "10.11",
"pnlBreakdown": {
"spotRealized": "3.21",
"spotUnrealized": "1.00",
"perpsRealized": "5.55",
"perpsUnrealized": "2.00",
"fundingPaid": "0.50",
"fees": "1.15"
}
}Authorizations
Ed25519 session-key request signing. Every authenticated request carries three headers: X-Monaco-PublicKey (64-char lowercase-hex session public key), X-Monaco-Timestamp (Unix milliseconds, within 30s of server time), and X-Monaco-Signature (hex ed25519 signature). The signature is over METHOD\npath?query\ntimestamp_ms\nSHA256_hex(body), where the body hash is the SHA-256 of the empty byte string when there is no body. Obtain the session keypair from POST /api/v1/auth/challenge followed by POST /api/v1/auth/verify.
Query Parameters
Response
OK
Period used for this query
"30d"
Total trade volume (sum of quoteVolume)
"231.81"
Number of trades in period
"42"
Number of orders in period
"56"
Total fees paid by user
"0.12"
Legacy realized PnL over the period, average-cost basis: gains/losses booked only when a position is reduced or closed, net of fees, with funding folded in. Excludes unrealized PnL on open positions. For the full PnL picture use totalPnl and pnlBreakdown, whose components follow the gross-of-fees convention instead.
"-0.01"
Total equity (sum of all balances)
"280.93"
Spot account equity
"280.93"
Perpetuals account equity
"0.00"
Position-level win rate: winning positions over winning + losing positions (break-even excluded). Each position (one flat->open->flat round-trip) is classified once by its net realized PnL after all fees, not per fill. Null when the period has no closed positions.
0.65
Maximum peak-to-trough drawdown on running PnL
"0.00"
Current unrealized PnL across open spot holdings (cost basis vs latest close) and open perp positions (entry vs mark). A live value, independent of the period parameter.
"12.34"
Current lifetime total PnL: realized + unrealized - fundingPaid - fees, with realized components gross of fees. A live value, independent of the period parameter; the addends are in pnlBreakdown.
"10.11"
Lifetime PnL components for the authenticated user. The fields satisfy totalPnl = (spotRealized + perpsRealized) + (spotUnrealized + perpsUnrealized) - fundingPaid - fees.
Show child attributes
Show child attributes
Was this page helpful?

