{"format":"opendoc-document","version":1,"url":"https://docs.upscale.trade/developers/operations/getaccounttradingstats","title":"Get trading stats of the trader account","description":"GET /accounts/{accountId}/stats: Aggregates over the closed positions of the account: win rate, average profit and loss, risk reward ratio, max drawdown and average holding times.","kind":"api-operation","locale":"en","inLanguage":"en","lastModified":"2026-09-28T19:22:49.100Z","revision":"25c86f549328fcff320805d5945f4c9804e3927950d831e601d6e3b18c170f66","section":{"title":"Developers","url":"https://docs.upscale.trade/developers"},"representations":{"html":"https://docs.upscale.trade/developers/operations/getaccounttradingstats","markdown":"https://docs.upscale.trade/developers/operations/getaccounttradingstats.md","json":"https://docs.upscale.trade/developers/operations/getaccounttradingstats.json"},"translations":{"en":"https://docs.upscale.trade/developers/operations/getaccounttradingstats","ru":"https://docs.upscale.trade/ru/developers/operations/getaccounttradingstats","es":"https://docs.upscale.trade/es/developers/operations/getaccounttradingstats"},"operation":{"id":"getAccountTradingStats","method":"GET","path":"/accounts/{accountId}/stats","summary":"Get trading stats of the trader account","description":"Aggregates over the closed positions of the account: win rate, average profit and loss, risk-reward ratio, max drawdown and average holding times.\n\n- Responds with an empty body while the account has no closed positions yet.\n- Covers every phase the account has been through, not only the current one.","tags":["Accounts"],"deprecated":false,"parameters":[{"name":"accountId","location":"path","schema":{"type":"string · uuid","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid"},"properties":[],"variants":[]},"type":"string · uuid","required":true,"description":"Trader account identifier. Must belong to the caller.","example":"00000000-0000-4000-8000-000000000000"}],"bodies":[],"responses":[{"status":"200","description":"Response","mediaType":"application/json","properties":[{"name":"sumPnl","type":"string · int32","required":true,"description":"Realised pnl summed over every closed position, fp9 raw, before fees and funding.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Realised pnl summed over every closed position, fp9 raw, before fees and funding.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"sumFee","type":"string · int32","required":true,"description":"Trading fees paid over every closed position, fp9 raw.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Trading fees paid over every closed position, fp9 raw.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"sumFunding","type":"string · int32","required":true,"description":"Funding settled over every closed position, fp9 raw. Positive when the account received more than it paid.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Funding settled over every closed position, fp9 raw. Positive when the account received more than it paid.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"profit","type":"string · int32","required":true,"description":"Net result of the closed positions, fp9 raw: pnl minus fees plus funding. This is what the win rate splits on.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Net result of the closed positions, fp9 raw: pnl minus fees plus funding. This is what the win rate splits on.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"positionsCount","type":"number","required":true,"description":"Number of closed positions the statistics are built from.","example":"0","schema":{"type":"number","types":["number"],"description":"Number of closed positions the statistics are built from.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"profitablePositionsCount","type":"number","required":true,"description":"Closed positions that ended at or above break-even.","example":"0","schema":{"type":"number","types":["number"],"description":"Closed positions that ended at or above break-even.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"unprofitablePositionsCount","type":"number","required":true,"description":"Closed positions that ended below break-even.","example":"0","schema":{"type":"number","types":["number"],"description":"Closed positions that ended below break-even.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"winratePercent","type":"number","required":true,"description":"Share of closed positions that ended at or above break-even, in percent with two decimals.","example":"62.5","schema":{"type":"number","types":["number"],"description":"Share of closed positions that ended at or above break-even, in percent with two decimals.","example":62.5,"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"minProfit","type":"string · int32 · nullable","required":true,"description":"Smallest win among profitable positions, fp9 raw. Null when there is none.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Smallest win among profitable positions, fp9 raw. Null when there is none.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"minLoss","type":"string · int32 · nullable","required":true,"description":"Smallest loss among losing positions, fp9 raw (negative, closest to zero). Null when there is none.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Smallest loss among losing positions, fp9 raw (negative, closest to zero). Null when there is none.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"maxProfit","type":"string · int32 · nullable","required":true,"description":"Largest win, fp9 raw. Null when no position ended in profit.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Largest win, fp9 raw. Null when no position ended in profit.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"maxLoss","type":"string · int32 · nullable","required":true,"description":"Largest loss, fp9 raw (the most negative value). Null when no position ended in loss.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Largest loss, fp9 raw (the most negative value). Null when no position ended in loss.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"avgProfit","type":"string · int32 · nullable","required":true,"description":"Average win across profitable positions, fp9 raw. Null when there is none.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Average win across profitable positions, fp9 raw. Null when there is none.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"avgLoss","type":"string · int32 · nullable","required":true,"description":"Average loss across losing positions, fp9 raw (negative). Null when there is none.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Average loss across losing positions, fp9 raw (negative). Null when there is none.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"riskRewardRatio","type":"number[]","required":true,"description":"Average win over the absolute average loss. Null while no losing position exists to divide by.","schema":{"type":"number[]","types":["array"],"description":"Average win over the absolute average loss. Null while no losing position exists to divide by.","example":1.8,"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"maxDrawdownPercent","type":"number[]","required":true,"description":"Deepest equity drawdown of the account across all its phases, in percent with two decimals.","schema":{"type":"number[]","types":["array"],"description":"Deepest equity drawdown of the account across all its phases, in percent with two decimals.","example":12.34,"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"avgLongPositionHoldTime","type":"number[]","required":true,"description":"Average holding time of long positions, in seconds.","example":"[\n  0\n]","schema":{"type":"number[]","types":["array"],"description":"Average holding time of long positions, in seconds.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"avgShortPositionHoldTime","type":"number[]","required":true,"description":"Average holding time of short positions, in seconds.","example":"[\n  0\n]","schema":{"type":"number[]","types":["array"],"description":"Average holding time of short positions, in seconds.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"avgPositionHoldTime","type":"number[]","required":true,"description":"Average holding time across all closed positions, in seconds.","example":"[\n  0\n]","schema":{"type":"number[]","types":["array"],"description":"Average holding time across all closed positions, in seconds.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"medianPositionHoldTime","type":"number[]","required":true,"description":"Median holding time across all closed positions, in seconds.","example":"[\n  0\n]","schema":{"type":"number[]","types":["array"],"description":"Median holding time across all closed positions, in seconds.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"maxProfitablePositionHoldTime","type":"number[]","required":true,"description":"Longest a profitable position was held, in seconds.","example":"[\n  0\n]","schema":{"type":"number[]","types":["array"],"description":"Longest a profitable position was held, in seconds.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"maxUnprofitablePositionHoldTime","type":"number[]","required":true,"description":"Longest a losing position was held, in seconds.","example":"[\n  0\n]","schema":{"type":"number[]","types":["array"],"description":"Longest a losing position was held, in seconds.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"medianProfitablePositionHoldTime","type":"number[]","required":true,"description":"Median holding time of profitable positions, in seconds.","example":"[\n  0\n]","schema":{"type":"number[]","types":["array"],"description":"Median holding time of profitable positions, in seconds.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"medianUnprofitablePositionHoldTime","type":"number[]","required":true,"description":"Median holding time of losing positions, in seconds.","example":"[\n  0\n]","schema":{"type":"number[]","types":["array"],"description":"Median holding time of losing positions, in seconds.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"avgLeverageProfitablePosition","type":"number[]","required":true,"description":"Average leverage of profitable positions — notional over margin, as a plain multiple.","schema":{"type":"number[]","types":["array"],"description":"Average leverage of profitable positions — notional over margin, as a plain multiple.","example":12,"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"avgLeverageUnprofitablePosition","type":"number[]","required":true,"description":"Average leverage of losing positions — notional over margin, as a plain multiple.","schema":{"type":"number[]","types":["array"],"description":"Average leverage of losing positions — notional over margin, as a plain multiple.","example":20,"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"topMarket","type":"string[]","required":true,"description":"Base asset ticker of the most traded market, by number of closed positions. Null when nothing has been closed.","schema":{"type":"string[]","types":["array"],"description":"Base asset ticker of the most traded market, by number of closed positions. Null when nothing has been closed.","example":"BTC","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"string","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"topMarketPercent","type":"number[]","required":true,"description":"Share of closed positions that were on `topMarket`, in percent with two decimals.","schema":{"type":"number[]","types":["array"],"description":"Share of closed positions that were on `topMarket`, in percent with two decimals.","example":41.67,"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}}],"schema":{"type":"object","types":["object"],"reference":"#/components/schemas/AccountTradingStatsResponse","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[{"name":"sumPnl","type":"string · int32","required":true,"description":"Realised pnl summed over every closed position, fp9 raw, before fees and funding.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Realised pnl summed over every closed position, fp9 raw, before fees and funding.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"sumFee","type":"string · int32","required":true,"description":"Trading fees paid over every closed position, fp9 raw.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Trading fees paid over every closed position, fp9 raw.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"sumFunding","type":"string · int32","required":true,"description":"Funding settled over every closed position, fp9 raw. Positive when the account received more than it paid.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Funding settled over every closed position, fp9 raw. Positive when the account received more than it paid.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"profit","type":"string · int32","required":true,"description":"Net result of the closed positions, fp9 raw: pnl minus fees plus funding. This is what the win rate splits on.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Net result of the closed positions, fp9 raw: pnl minus fees plus funding. This is what the win rate splits on.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"positionsCount","type":"number","required":true,"description":"Number of closed positions the statistics are built from.","example":"0","schema":{"type":"number","types":["number"],"description":"Number of closed positions the statistics are built from.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"profitablePositionsCount","type":"number","required":true,"description":"Closed positions that ended at or above break-even.","example":"0","schema":{"type":"number","types":["number"],"description":"Closed positions that ended at or above break-even.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"unprofitablePositionsCount","type":"number","required":true,"description":"Closed positions that ended below break-even.","example":"0","schema":{"type":"number","types":["number"],"description":"Closed positions that ended below break-even.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"winratePercent","type":"number","required":true,"description":"Share of closed positions that ended at or above break-even, in percent with two decimals.","example":"62.5","schema":{"type":"number","types":["number"],"description":"Share of closed positions that ended at or above break-even, in percent with two decimals.","example":62.5,"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"minProfit","type":"string · int32 · nullable","required":true,"description":"Smallest win among profitable positions, fp9 raw. Null when there is none.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Smallest win among profitable positions, fp9 raw. Null when there is none.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"minLoss","type":"string · int32 · nullable","required":true,"description":"Smallest loss among losing positions, fp9 raw (negative, closest to zero). Null when there is none.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Smallest loss among losing positions, fp9 raw (negative, closest to zero). Null when there is none.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"maxProfit","type":"string · int32 · nullable","required":true,"description":"Largest win, fp9 raw. Null when no position ended in profit.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Largest win, fp9 raw. Null when no position ended in profit.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"maxLoss","type":"string · int32 · nullable","required":true,"description":"Largest loss, fp9 raw (the most negative value). Null when no position ended in loss.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Largest loss, fp9 raw (the most negative value). Null when no position ended in loss.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"avgProfit","type":"string · int32 · nullable","required":true,"description":"Average win across profitable positions, fp9 raw. Null when there is none.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Average win across profitable positions, fp9 raw. Null when there is none.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"avgLoss","type":"string · int32 · nullable","required":true,"description":"Average loss across losing positions, fp9 raw (negative). Null when there is none.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Average loss across losing positions, fp9 raw (negative). Null when there is none.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"riskRewardRatio","type":"number[]","required":true,"description":"Average win over the absolute average loss. Null while no losing position exists to divide by.","schema":{"type":"number[]","types":["array"],"description":"Average win over the absolute average loss. Null while no losing position exists to divide by.","example":1.8,"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"maxDrawdownPercent","type":"number[]","required":true,"description":"Deepest equity drawdown of the account across all its phases, in percent with two decimals.","schema":{"type":"number[]","types":["array"],"description":"Deepest equity drawdown of the account across all its phases, in percent with two decimals.","example":12.34,"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"avgLongPositionHoldTime","type":"number[]","required":true,"description":"Average holding time of long positions, in seconds.","example":"[\n  0\n]","schema":{"type":"number[]","types":["array"],"description":"Average holding time of long positions, in seconds.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"avgShortPositionHoldTime","type":"number[]","required":true,"description":"Average holding time of short positions, in seconds.","example":"[\n  0\n]","schema":{"type":"number[]","types":["array"],"description":"Average holding time of short positions, in seconds.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"avgPositionHoldTime","type":"number[]","required":true,"description":"Average holding time across all closed positions, in seconds.","example":"[\n  0\n]","schema":{"type":"number[]","types":["array"],"description":"Average holding time across all closed positions, in seconds.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"medianPositionHoldTime","type":"number[]","required":true,"description":"Median holding time across all closed positions, in seconds.","example":"[\n  0\n]","schema":{"type":"number[]","types":["array"],"description":"Median holding time across all closed positions, in seconds.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"maxProfitablePositionHoldTime","type":"number[]","required":true,"description":"Longest a profitable position was held, in seconds.","example":"[\n  0\n]","schema":{"type":"number[]","types":["array"],"description":"Longest a profitable position was held, in seconds.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"maxUnprofitablePositionHoldTime","type":"number[]","required":true,"description":"Longest a losing position was held, in seconds.","example":"[\n  0\n]","schema":{"type":"number[]","types":["array"],"description":"Longest a losing position was held, in seconds.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"medianProfitablePositionHoldTime","type":"number[]","required":true,"description":"Median holding time of profitable positions, in seconds.","example":"[\n  0\n]","schema":{"type":"number[]","types":["array"],"description":"Median holding time of profitable positions, in seconds.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"medianUnprofitablePositionHoldTime","type":"number[]","required":true,"description":"Median holding time of losing positions, in seconds.","example":"[\n  0\n]","schema":{"type":"number[]","types":["array"],"description":"Median holding time of losing positions, in seconds.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"avgLeverageProfitablePosition","type":"number[]","required":true,"description":"Average leverage of profitable positions — notional over margin, as a plain multiple.","schema":{"type":"number[]","types":["array"],"description":"Average leverage of profitable positions — notional over margin, as a plain multiple.","example":12,"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"avgLeverageUnprofitablePosition","type":"number[]","required":true,"description":"Average leverage of losing positions — notional over margin, as a plain multiple.","schema":{"type":"number[]","types":["array"],"description":"Average leverage of losing positions — notional over margin, as a plain multiple.","example":20,"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"topMarket","type":"string[]","required":true,"description":"Base asset ticker of the most traded market, by number of closed positions. Null when nothing has been closed.","schema":{"type":"string[]","types":["array"],"description":"Base asset ticker of the most traded market, by number of closed positions. Null when nothing has been closed.","example":"BTC","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"string","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"topMarketPercent","type":"number[]","required":true,"description":"Share of closed positions that were on `topMarket`, in percent with two decimals.","schema":{"type":"number[]","types":["array"],"description":"Share of closed positions that were on `topMarket`, in percent with two decimals.","example":41.67,"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"number","types":["number"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}}],"variants":[]},"exampleDiagnostic":"Body.riskRewardRatio must be array Body.maxDrawdownPercent must be array Body.avgLeverageProfitablePosition must be array","headers":[]},{"status":"401","description":"Unauthorized","properties":[],"headers":[]},{"status":"403","description":"The account belongs to another user (`account_access_denied`), or the request is authenticated with an API key while `api_trading` is disabled on the account (`api_trading_not_enabled`).","properties":[],"headers":[]},{"status":"404","description":"No account with this identifier.","properties":[],"headers":[]},{"status":"429","description":"Rate limit of the API key exceeded (`api_key_rate_limit_exceeded`). `Retry-After` says when to come back; the body carries the bucket (`read` / `write`), the window that tripped, its limit and `retryAt`.","properties":[],"headers":[]}],"security":[{"name":"bearer","type":"http · bearer","description":"Personal API key, prefixed with `usk_`.","required":true,"scopes":[]}],"codeSamples":[{"label":"cURL","language":"bash","source":"curl --request GET 'https://api.upscale.trade/accounts/{accountId}/stats' \\\n  --header 'Accept: application/json' \\\n  --header 'Authorization: Bearer YOUR_API_KEY'"},{"label":"JavaScript","language":"javascript","source":"const response = await fetch(\"https://api.upscale.trade/accounts/{accountId}/stats\", {\n  method: \"GET\",\n  headers: {\n    \"Accept\": \"application/json\",\n    \"Authorization\": \"Bearer YOUR_API_KEY\"\n  },\n});\nconsole.log(response.status, await response.text());"},{"label":"Python","language":"python","source":"import requests\n\nresponse = requests.request(\n    \"GET\",\n    \"https://api.upscale.trade/accounts/{accountId}/stats\",\n    headers={\"Accept\":\"application/json\",\"Authorization\":\"Bearer YOUR_API_KEY\"},\n    timeout=30,\n)\nprint(response.status_code, response.text)"}]},"breadcrumbs":[{"title":"What is Prop Trading","url":"https://docs.upscale.trade"},{"title":"Developers","url":"https://docs.upscale.trade/developers"},{"title":"Get trading stats of the trader account","url":"https://docs.upscale.trade/developers/operations/getaccounttradingstats"}],"headings":[{"depth":2,"id":"authorization","title":"Authorization"},{"depth":2,"id":"parameters","title":"Parameters"},{"depth":2,"id":"examples","title":"Examples"},{"depth":2,"id":"responses","title":"Responses"}],"markdown":"# Get trading stats of the trader account\n\n`GET /accounts/{accountId}/stats`\n\nAggregates over the closed positions of the account: win rate, average profit and loss, risk-reward ratio, max drawdown and average holding times.\n\n- Responds with an empty body while the account has no closed positions yet.\n- Covers every phase the account has been through, not only the current one.\n\n## Authorization\n\nbearer: http · bearer (required). Personal API key, prefixed with `usk_`.\n\n## Parameters\n\n- path: accountId (string · uuid; required). Trader account identifier. Must belong to the caller.\n\nType: string · uuid\n\nformat: uuid\n\n## Example · cURL\n\n```bash\ncurl --request GET 'https://api.upscale.trade/accounts/{accountId}/stats' \\\n  --header 'Accept: application/json' \\\n  --header 'Authorization: Bearer YOUR_API_KEY'\n```\n\n## Example · JavaScript\n\n```javascript\nconst response = await fetch(\"https://api.upscale.trade/accounts/{accountId}/stats\", {\n  method: \"GET\",\n  headers: {\n    \"Accept\": \"application/json\",\n    \"Authorization\": \"Bearer YOUR_API_KEY\"\n  },\n});\nconsole.log(response.status, await response.text());\n```\n\n## Example · Python\n\n```python\nimport requests\n\nresponse = requests.request(\n    \"GET\",\n    \"https://api.upscale.trade/accounts/{accountId}/stats\",\n    headers={\"Accept\":\"application/json\",\"Authorization\":\"Bearer YOUR_API_KEY\"},\n    timeout=30,\n)\nprint(response.status_code, response.text)\n```\n\n## Response 200 · AccountTradingStatsResponse\n\n**200** application/json — Response\n\nBody.riskRewardRatio must be array Body.maxDrawdownPercent must be array Body.avgLeverageProfitablePosition must be array\n\nSchema: AccountTradingStatsResponse\n\nType: object\n\nRequired fields: sumPnl, sumFee, sumFunding, profit, positionsCount, profitablePositionsCount, unprofitablePositionsCount, winratePercent, minProfit, minLoss, maxProfit, maxLoss, avgProfit, avgLoss, riskRewardRatio, maxDrawdownPercent, avgLongPositionHoldTime, avgShortPositionHoldTime, avgPositionHoldTime, medianPositionHoldTime, maxProfitablePositionHoldTime, maxUnprofitablePositionHoldTime, medianProfitablePositionHoldTime, medianUnprofitablePositionHoldTime, avgLeverageProfitablePosition, avgLeverageUnprofitablePosition, topMarket, topMarketPercent\n\nRequired field types: sumPnl (string · int32; required), sumFee (string · int32; required), sumFunding (string · int32; required), profit (string · int32; required), positionsCount (number; required), profitablePositionsCount (number; required), unprofitablePositionsCount (number; required), winratePercent (number; required), minProfit (string · int32 · nullable; required), minLoss (string · int32 · nullable; required), maxProfit (string · int32 · nullable; required), maxLoss (string · int32 · nullable; required), avgProfit (string · int32 · nullable; required), avgLoss (string · int32 · nullable; required), riskRewardRatio (number[]; required), maxDrawdownPercent (number[]; required), avgLongPositionHoldTime (number[]; required), avgShortPositionHoldTime (number[]; required), avgPositionHoldTime (number[]; required), medianPositionHoldTime (number[]; required), maxProfitablePositionHoldTime (number[]; required), maxUnprofitablePositionHoldTime (number[]; required), medianProfitablePositionHoldTime (number[]; required), medianUnprofitablePositionHoldTime (number[]; required), avgLeverageProfitablePosition (number[]; required), avgLeverageUnprofitablePosition (number[]; required), topMarket (string[]; required), topMarketPercent (number[]; required)\n\n- sumPnl (string · int32; required)\n\nsumPnl example: 1000000000\n\nsumPnl.Type: string · int32\n\nsumPnl.Realised pnl summed over every closed position, fp9 raw, before fees and funding.\n\nsumPnl.format: int32\n\nsumPnl.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- sumFee (string · int32; required)\n\nsumFee example: 1000000000\n\nsumFee.Type: string · int32\n\nsumFee.Trading fees paid over every closed position, fp9 raw.\n\nsumFee.format: int32\n\nsumFee.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- sumFunding (string · int32; required)\n\nsumFunding example: 1000000000\n\nsumFunding.Type: string · int32\n\nsumFunding.Funding settled over every closed position, fp9 raw. Positive when the account received more than it paid.\n\nsumFunding.format: int32\n\nsumFunding.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- profit (string · int32; required)\n\nprofit example: 1000000000\n\nprofit.Type: string · int32\n\nprofit.Net result of the closed positions, fp9 raw: pnl minus fees plus funding. This is what the win rate splits on.\n\nprofit.format: int32\n\nprofit.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- positionsCount (number; required)\n\npositionsCount example: 0\n\npositionsCount.Type: number\n\npositionsCount.Number of closed positions the statistics are built from.\n\n- profitablePositionsCount (number; required)\n\nprofitablePositionsCount example: 0\n\nprofitablePositionsCount.Type: number\n\nprofitablePositionsCount.Closed positions that ended at or above break-even.\n\n- unprofitablePositionsCount (number; required)\n\nunprofitablePositionsCount example: 0\n\nunprofitablePositionsCount.Type: number\n\nunprofitablePositionsCount.Closed positions that ended below break-even.\n\n- winratePercent (number; required)\n\nwinratePercent example: 62.5\n\nwinratePercent.Type: number\n\nwinratePercent.Share of closed positions that ended at or above break-even, in percent with two decimals.\n\n- minProfit (string · int32 · nullable; required)\n\nminProfit example: 1000000000\n\nminProfit.Type: string · int32 · nullable\n\nminProfit.Smallest win among profitable positions, fp9 raw. Null when there is none.\n\nminProfit.format: int32\n\nminProfit.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- minLoss (string · int32 · nullable; required)\n\nminLoss example: 1000000000\n\nminLoss.Type: string · int32 · nullable\n\nminLoss.Smallest loss among losing positions, fp9 raw (negative, closest to zero). Null when there is none.\n\nminLoss.format: int32\n\nminLoss.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- maxProfit (string · int32 · nullable; required)\n\nmaxProfit example: 1000000000\n\nmaxProfit.Type: string · int32 · nullable\n\nmaxProfit.Largest win, fp9 raw. Null when no position ended in profit.\n\nmaxProfit.format: int32\n\nmaxProfit.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- maxLoss (string · int32 · nullable; required)\n\nmaxLoss example: 1000000000\n\nmaxLoss.Type: string · int32 · nullable\n\nmaxLoss.Largest loss, fp9 raw (the most negative value). Null when no position ended in loss.\n\nmaxLoss.format: int32\n\nmaxLoss.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- avgProfit (string · int32 · nullable; required)\n\navgProfit example: 1000000000\n\navgProfit.Type: string · int32 · nullable\n\navgProfit.Average win across profitable positions, fp9 raw. Null when there is none.\n\navgProfit.format: int32\n\navgProfit.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- avgLoss (string · int32 · nullable; required)\n\navgLoss example: 1000000000\n\navgLoss.Type: string · int32 · nullable\n\navgLoss.Average loss across losing positions, fp9 raw (negative). Null when there is none.\n\navgLoss.format: int32\n\navgLoss.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- riskRewardRatio (number[]; required)\n\nriskRewardRatio.Type: number[]\n\nriskRewardRatio.Average win over the absolute average loss. Null while no losing position exists to divide by.\n\nriskRewardRatio.[]Type: number\n\n- maxDrawdownPercent (number[]; required)\n\nmaxDrawdownPercent.Type: number[]\n\nmaxDrawdownPercent.Deepest equity drawdown of the account across all its phases, in percent with two decimals.\n\nmaxDrawdownPercent.[]Type: number\n\n- avgLongPositionHoldTime (number[]; required)\n\navgLongPositionHoldTime example: [\n  0\n]\n\navgLongPositionHoldTime.Type: number[]\n\navgLongPositionHoldTime.Average holding time of long positions, in seconds.\n\navgLongPositionHoldTime.[]Type: number\n\n- avgShortPositionHoldTime (number[]; required)\n\navgShortPositionHoldTime example: [\n  0\n]\n\navgShortPositionHoldTime.Type: number[]\n\navgShortPositionHoldTime.Average holding time of short positions, in seconds.\n\navgShortPositionHoldTime.[]Type: number\n\n- avgPositionHoldTime (number[]; required)\n\navgPositionHoldTime example: [\n  0\n]\n\navgPositionHoldTime.Type: number[]\n\navgPositionHoldTime.Average holding time across all closed positions, in seconds.\n\navgPositionHoldTime.[]Type: number\n\n- medianPositionHoldTime (number[]; required)\n\nmedianPositionHoldTime example: [\n  0\n]\n\nmedianPositionHoldTime.Type: number[]\n\nmedianPositionHoldTime.Median holding time across all closed positions, in seconds.\n\nmedianPositionHoldTime.[]Type: number\n\n- maxProfitablePositionHoldTime (number[]; required)\n\nmaxProfitablePositionHoldTime example: [\n  0\n]\n\nmaxProfitablePositionHoldTime.Type: number[]\n\nmaxProfitablePositionHoldTime.Longest a profitable position was held, in seconds.\n\nmaxProfitablePositionHoldTime.[]Type: number\n\n- maxUnprofitablePositionHoldTime (number[]; required)\n\nmaxUnprofitablePositionHoldTime example: [\n  0\n]\n\nmaxUnprofitablePositionHoldTime.Type: number[]\n\nmaxUnprofitablePositionHoldTime.Longest a losing position was held, in seconds.\n\nmaxUnprofitablePositionHoldTime.[]Type: number\n\n- medianProfitablePositionHoldTime (number[]; required)\n\nmedianProfitablePositionHoldTime example: [\n  0\n]\n\nmedianProfitablePositionHoldTime.Type: number[]\n\nmedianProfitablePositionHoldTime.Median holding time of profitable positions, in seconds.\n\nmedianProfitablePositionHoldTime.[]Type: number\n\n- medianUnprofitablePositionHoldTime (number[]; required)\n\nmedianUnprofitablePositionHoldTime example: [\n  0\n]\n\nmedianUnprofitablePositionHoldTime.Type: number[]\n\nmedianUnprofitablePositionHoldTime.Median holding time of losing positions, in seconds.\n\nmedianUnprofitablePositionHoldTime.[]Type: number\n\n- avgLeverageProfitablePosition (number[]; required)\n\navgLeverageProfitablePosition.Type: number[]\n\navgLeverageProfitablePosition.Average leverage of profitable positions — notional over margin, as a plain multiple.\n\navgLeverageProfitablePosition.[]Type: number\n\n- avgLeverageUnprofitablePosition (number[]; required)\n\navgLeverageUnprofitablePosition.Type: number[]\n\navgLeverageUnprofitablePosition.Average leverage of losing positions — notional over margin, as a plain multiple.\n\navgLeverageUnprofitablePosition.[]Type: number\n\n- topMarket (string[]; required)\n\ntopMarket.Type: string[]\n\ntopMarket.Base asset ticker of the most traded market, by number of closed positions. Null when nothing has been closed.\n\ntopMarket.[]Type: string\n\n- topMarketPercent (number[]; required)\n\ntopMarketPercent.Type: number[]\n\ntopMarketPercent.Share of closed positions that were on `topMarket`, in percent with two decimals.\n\ntopMarketPercent.[]Type: number\n\n## Response 401\n\n**401**  — Unauthorized\n\n## Response 403\n\n**403**  — The account belongs to another user (`account_access_denied`), or the request is authenticated with an API key while `api_trading` is disabled on the account (`api_trading_not_enabled`).\n\n## Response 404\n\n**404**  — No account with this identifier.\n\n## Response 429\n\n**429**  — Rate limit of the API key exceeded (`api_key_rate_limit_exceeded`). `Retry-After` says when to come back; the body carries the bucket (`read` / `write`), the window that tripped, its limit and `retryAt`.","text":"Get trading stats of the trader account Aggregates over the closed positions of the account: win rate, average profit and loss, risk-reward ratio, max drawdown and average holding times. - Responds with an empty body while the account has no closed positions yet. - Covers every phase the account has been through, not only the current one. GET /accounts/{accountId}/stats Accounts accountId Trader account identifier. Must belong to the caller. string · uuid 200 Response sumPnl Realised pnl summed over every closed position, fp9 raw, before fees and funding. string · int32 sumFee Trading fees paid over every closed position, fp9 raw. string · int32 sumFunding Funding settled over every closed position, fp9 raw. Positive when the account received more than it paid. string · int32 profit Net result of the closed positions, fp9 raw: pnl minus fees plus funding. This is what the win rate splits on. string · int32 positionsCount Number of closed positions the statistics are built from. number profitablePositionsCount Closed positions that ended at or above break-even. number unprofitablePositionsCount Closed positions that ended below break-even. number winratePercent Share of closed positions that ended at or above break-even, in percent with two decimals. number minProfit Smallest win among profitable positions, fp9 raw. Null when there is none. string · int32 · nullable minLoss Smallest loss among losing positions, fp9 raw (negative, closest to zero). Null when there is none. string · int32 · nullable maxProfit Largest win, fp9 raw. Null when no position ended in profit. string · int32 · nullable maxLoss Largest loss, fp9 raw (the most negative value). Null when no position ended in loss. string · int32 · nullable avgProfit Average win across profitable positions, fp9 raw. Null when there is none. string · int32 · nullable avgLoss Average loss across losing positions, fp9 raw (negative). Null when there is none. string · int32 · nullable riskRewardRatio Average win over the absolute average loss. Null while no losing position exists to divide by. number[] maxDrawdownPercent Deepest equity drawdown of the account across all its phases, in percent with two decimals. number[] avgLongPositionHoldTime Average holding time of long positions, in seconds. number[] avgShortPositionHoldTime Average holding time of short positions, in seconds. number[] avgPositionHoldTime Average holding time across all closed positions, in seconds. number[] medianPositionHoldTime Median holding time across all closed positions, in seconds. number[] maxProfitablePositionHoldTime Longest a profitable position was held, in seconds. number[] maxUnprofitablePositionHoldTime Longest a losing position was held, in seconds. number[] medianProfitablePositionHoldTime Median holding time of profitable positions, in seconds. number[] medianUnprofitablePositionHoldTime Median holding time of losing positions, in seconds. number[] avgLeverageProfitablePosition Average leverage of profitable positions — notional over margin, as a plain multiple. number[] avgLeverageUnprofitablePosition Average leverage of losing positions — notional over margin, as a plain multiple. number[] topMarket Base asset ticker of the most traded market, by number of closed positions. Null when nothing has been closed. string[] topMarketPercent Share of closed positions that were on `topMarket`, in percent with two decimals. number[] 401 Unauthorized 403 The account belongs to another user (`account_access_denied`), or the request is authenticated with an API key while `api_trading` is disabled on the account (`api_trading_not_enabled`). 404 No account with this identifier. 429 Rate limit of the API key exceeded (`api_key_rate_limit_exceeded`). `Retry-After` says when to come back; the body carries the bucket (`read` / `write`), the window that tripped, its limit and `retryAt`.","api":{"title":"Upscale Public API","version":"d796ac9","documentation":"https://docs.upscale.trade/developers","playgroundServer":"https://api.upscale.trade"}}