cURL
curl --request GET \ --url https://api.glider.fi/portfolio/:portfolioId/pnl \ --header 'X-API-KEY: <api-key>'
{ "success": true, "data": { "pnl": { "costBasis": { "[assetId]": { "amount": "<string>", "costBasisUsd": "<string>", "averagePrice": "<string>" } }, "realizedPnl": { "[assetId]": { "amount": "<string>", "realizedPnlUsd": "<string>" } }, "unrealizedPnl": { "[assetId]": { "amount": "<string>", "currentValueUsd": "<string>", "costBasisUsd": "<string>", "unrealizedPnlUsd": "<string>", "unrealizedPnlPercentage": "<string>" } }, "trades": [ { "id": "<string>", "timestamp": 123, "type": "<string>", "assetIn": {}, "assetOut": {}, "amountIn": "<string>", "amountOut": "<string>", "valueIn": "<string>", "valueOut": "<string>", "costBasis": "<string>", "realizedPnl": "<string>" } ], "summary": { "totalCostBasisUsd": "<string>", "totalRealizedPnlUsd": "<string>", "totalUnrealizedPnlUsd": "<string>", "totalPnlUsd": "<string>", "totalPnlPercentage": "<string>" } } }, "NOT_FOUND": {}, "UNAUTHORIZED": {}, "FORBIDDEN": {} }
Retrieve performance metrics for a portfolio
Show Properties
Show Cost Basis Object
Show Realized PnL Object
Show Unrealized PnL Object
Show Trade Object
Show Summary Object
curl -X GET "https://api.glider.fi/portfolio/port_1a2b3c4d5e6f/pnl?realtime=true" \ -H "X-API-KEY: YOUR_API_KEY"
{ "success": true, "data": { "pnl": { "costBasis": { "usdc-usd-coin": { "amount": "500000000", "costBasisUsd": "500.00", "averagePrice": "1.00" }, "weth-wrapped-ethereum": { "amount": "250000000000000000", "costBasisUsd": "500.00", "averagePrice": "2000.00" } }, "realizedPnl": { "usdc-usd-coin": { "amount": "0", "realizedPnlUsd": "0.00" } }, "unrealizedPnl": { "usdc-usd-coin": { "amount": "500000000", "currentValueUsd": "500.00", "costBasisUsd": "500.00", "unrealizedPnlUsd": "0.00", "unrealizedPnlPercentage": "0.00" }, "weth-wrapped-ethereum": { "amount": "250000000000000000", "currentValueUsd": "550.00", "costBasisUsd": "500.00", "unrealizedPnlUsd": "50.00", "unrealizedPnlPercentage": "10.00" } }, "summary": { "totalCostBasisUsd": "1000.00", "totalRealizedPnlUsd": "0.00", "totalUnrealizedPnlUsd": "50.00", "totalPnlUsd": "50.00", "totalPnlPercentage": "5.00" } } } }
realtime