GetPortfolio
curl --request POST \
--url https://api.fairground.fi/portfolio.v1.PortfolioService/GetPortfolio \
--header 'Authorization: Bearer <token>' \
--header 'Connect-Protocol-Version: <connect-protocol-version>' \
--header 'Content-Type: application/json' \
--data '
{
"owner": "<string>"
}
'{
"portfolio": {
"owner": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"totalMargin": 123,
"totalUnrealizedPnl": 123,
"totalRealizedPnl": 123,
"totalVolume": 123,
"totalFees": 123,
"totalProfit": 123,
"totalLoss": 123,
"totalTrades": "<string>",
"totalEquity": 123,
"maxDrawdown": 123,
"positions": [
{
"owner": "<string>",
"positionId": "<string>",
"marketId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"market": "<string>",
"marginType": "MARGIN_TYPE_ISOLATED",
"nominalSize": 123,
"entryPrice": 123,
"markPrice": 123,
"liquidationPrice": 123,
"allocatedMargin": 123,
"leverage": 123,
"unrealizedPnl": 123,
"reduceOnly": true,
"associatedOrders": [
{
"owner": "<string>",
"orderId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"marketId": "<string>",
"market": "<string>",
"type": "ORDER_TYPE_MARKET",
"thresholdPrice": 123,
"size": 123,
"leverage": 123,
"filledSize": 123,
"unfilledSize": 123,
"reduceOnly": true,
"canceled": true,
"initialMargin": 123,
"tickDecimals": 123,
"fees": 123,
"rebates": 123
}
],
"tickDecimals": 123,
"revenueSpent": 123,
"effectiveSize": 123
}
],
"orders": [
{
"owner": "<string>",
"orderId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"marketId": "<string>",
"market": "<string>",
"type": "ORDER_TYPE_MARKET",
"thresholdPrice": 123,
"size": 123,
"leverage": 123,
"filledSize": 123,
"unfilledSize": 123,
"reduceOnly": true,
"canceled": true,
"initialMargin": 123,
"tickDecimals": 123,
"fees": 123,
"rebates": 123
}
]
}
}PortfolioService
GetPortfolio
Get portfolio for a specific owner
POST
/
portfolio.v1.PortfolioService
/
GetPortfolio
GetPortfolio
curl --request POST \
--url https://api.fairground.fi/portfolio.v1.PortfolioService/GetPortfolio \
--header 'Authorization: Bearer <token>' \
--header 'Connect-Protocol-Version: <connect-protocol-version>' \
--header 'Content-Type: application/json' \
--data '
{
"owner": "<string>"
}
'{
"portfolio": {
"owner": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"totalMargin": 123,
"totalUnrealizedPnl": 123,
"totalRealizedPnl": 123,
"totalVolume": 123,
"totalFees": 123,
"totalProfit": 123,
"totalLoss": 123,
"totalTrades": "<string>",
"totalEquity": 123,
"maxDrawdown": 123,
"positions": [
{
"owner": "<string>",
"positionId": "<string>",
"marketId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"market": "<string>",
"marginType": "MARGIN_TYPE_ISOLATED",
"nominalSize": 123,
"entryPrice": 123,
"markPrice": 123,
"liquidationPrice": 123,
"allocatedMargin": 123,
"leverage": 123,
"unrealizedPnl": 123,
"reduceOnly": true,
"associatedOrders": [
{
"owner": "<string>",
"orderId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"marketId": "<string>",
"market": "<string>",
"type": "ORDER_TYPE_MARKET",
"thresholdPrice": 123,
"size": 123,
"leverage": 123,
"filledSize": 123,
"unfilledSize": 123,
"reduceOnly": true,
"canceled": true,
"initialMargin": 123,
"tickDecimals": 123,
"fees": 123,
"rebates": 123
}
],
"tickDecimals": 123,
"revenueSpent": 123,
"effectiveSize": 123
}
],
"orders": [
{
"owner": "<string>",
"orderId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"marketId": "<string>",
"market": "<string>",
"type": "ORDER_TYPE_MARKET",
"thresholdPrice": 123,
"size": 123,
"leverage": 123,
"filledSize": 123,
"unfilledSize": 123,
"reduceOnly": true,
"canceled": true,
"initialMargin": 123,
"tickDecimals": 123,
"fees": 123,
"rebates": 123
}
]
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Define the version of the Connect protocol. If omitted, use 1.
Available options:
1 Define the timeout, in ms
Body
application/json
Wallet address
Response
Success
Show child attributes
Show child attributes
⌘I