> For the complete documentation index, see [llms.txt](https://docs.syncrone.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.syncrone.fi/api-reference/syncrone-api/performance.md).

# Performance

Calculate PnL performance metrics between two dates for wallets, positions, assets, or holdings.

## Calculate PnL Performance

> Calculate performance metrics (PnL, ROI, TWR, APR, APY) between two dates for organizations and wallets.\
> This endpoint returns a hierarchical structure: Organizations -> Wallets -> Protocols -> Positions -> Assets/Holdings. It includes Merkl rewards as positions within the Merkl protocol.\
> \*\*Query Parameters:\*\*\
> \- Either \`org\_id\` or \`wallet\_address\` is required (at least one must be provided) - \`org\_id\` - Returns performance for all wallets in the organization - \`wallet\_address\` - Returns performance for a specific wallet - Both can be provided together to filter wallets within an organization\
> The response includes comprehensive metrics at each level of the hierarchy, with positions and assets sorted by final value (descending).<br>

```json
{"openapi":"3.0.3","info":{"title":"Syncrone API","version":"1.0.0"},"tags":[{"name":"Performance","description":"Calculate PnL performance metrics between two dates for wallets, positions, assets, or holdings."}],"servers":[{"url":"https://api.syncrone.fi/api","description":"Production server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-Key","description":"API key for authentication"}},"schemas":{"PerformanceResponse":{"type":"object","required":["start_date","end_date","organizations"],"properties":{"start_date":{"type":"string","format":"date-time","description":"Start date for the performance calculation period"},"end_date":{"type":"string","format":"date-time","description":"End date for the performance calculation period"},"organizations":{"type":"array","items":{"$ref":"#/components/schemas/Organization"},"description":"List of organizations with their wallets and performance metrics"}}},"Organization":{"type":"object","required":["org_name","org_id","number_of_wallets","metrics","wallets"],"properties":{"org_name":{"type":"string","description":"Organization name"},"org_id":{"type":"string","description":"Organization ID"},"number_of_wallets":{"type":"integer","description":"Number of wallets in the organization"},"metrics":{"$ref":"#/components/schemas/Metrics"},"wallets":{"type":"array","items":{"$ref":"#/components/schemas/PerformanceWallet"}}}},"Metrics":{"type":"object","required":["realized_pnl_usd","unrealized_pnl_usd","strategy_pnl","market_pnl","inflow_usd","outflow_usd","net_flow_usd","initial_value_usd","final_value_usd","value_change_usd","roi_pct","time_weighted_return_pct","apr_pct","apy_pct"],"properties":{"realized_pnl_usd":{"type":"number","format":"double","description":"Realized PnL during the period"},"unrealized_pnl_usd":{"type":"number","format":"double","description":"Change in unrealized PnL during the period"},"strategy_pnl":{"type":"number","format":"double","description":"Strategy PnL (balance change × price)"},"market_pnl":{"type":"number","format":"double","description":"Market PnL (total PnL - strategy PnL)"},"inflow_usd":{"type":"number","format":"double","description":"Capital inflows during the period"},"outflow_usd":{"type":"number","format":"double","description":"Capital outflows during the period"},"net_flow_usd":{"type":"number","format":"double","description":"Net flow (inflows - outflows)"},"initial_value_usd":{"type":"number","format":"double","description":"Portfolio value at start date"},"final_value_usd":{"type":"number","format":"double","description":"Portfolio value at end date"},"value_change_usd":{"type":"number","format":"double","description":"Change in value (end - start)"},"roi_pct":{"type":"number","format":"double","description":"Return on Investment percentage"},"time_weighted_return_pct":{"type":"number","format":"double","description":"Time-weighted return percentage"},"apr_pct":{"type":"number","format":"double","description":"Annual Percentage Rate (simple interest annualization)"},"apy_pct":{"type":"number","format":"double","description":"Annual Percentage Yield (compound interest annualization)"}}},"PerformanceWallet":{"type":"object","required":["wallet_address","metrics","protocols","holdings"],"properties":{"wallet_address":{"type":"string","description":"Wallet address"},"wallet_name":{"type":"string","nullable":true,"description":"Wallet name"},"metrics":{"$ref":"#/components/schemas/Metrics"},"protocols":{"type":"array","items":{"$ref":"#/components/schemas/PerformanceProtocol"},"description":"List of protocols with positions"},"holdings":{"type":"array","items":{"$ref":"#/components/schemas/PerformanceHolding"},"description":"List of holdings (non-DeFi token balances)"}}},"PerformanceProtocol":{"type":"object","required":["protocol_name","metrics","positions"],"properties":{"protocol_name":{"type":"string","description":"Protocol name (e.g., \"Aave\", \"Compound\", \"Merkl\")"},"metrics":{"$ref":"#/components/schemas/Metrics"},"positions":{"type":"array","items":{"$ref":"#/components/schemas/PerformancePosition"},"description":"List of positions within this protocol"}}},"PerformancePosition":{"type":"object","required":["id","position_type","chain_id","start_timestamp","metrics","assets"],"properties":{"id":{"type":"string","description":"Unique position identifier"},"position_type":{"type":"string","description":"Position type (e.g., \"defi\")"},"position_name":{"type":"string","nullable":true,"description":"Position name (e.g., protocol names for Merkl rewards)"},"chain_id":{"type":"integer","description":"Blockchain network ID"},"start_timestamp":{"type":"string","format":"date-time","description":"Position opening timestamp"},"end_timestamp":{"type":"string","format":"date-time","nullable":true,"description":"Position closing timestamp (null if still open)"},"metrics":{"$ref":"#/components/schemas/Metrics"},"assets":{"type":"array","items":{"$ref":"#/components/schemas/PerformanceAsset"},"description":"List of assets within this position"}}},"PerformanceAsset":{"type":"object","required":["id","token","metrics","initial","final","flows","children"],"properties":{"id":{"type":"string","description":"Unique asset identifier"},"name":{"type":"string","nullable":true,"description":"Asset name"},"token":{"$ref":"#/components/schemas/Token"},"metrics":{"$ref":"#/components/schemas/AssetMetrics"},"initial":{"$ref":"#/components/schemas/TokenValues"},"final":{"$ref":"#/components/schemas/TokenValues"},"flows":{"$ref":"#/components/schemas/TokenFlows"},"children":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/PerformanceAsset"},"description":"Recursive children assets (for unwrapped assets)"}}},"Token":{"type":"object","required":["address","symbol","decimals"],"properties":{"address":{"type":"string","description":"Token contract address"},"symbol":{"type":"string","description":"Token symbol"},"decimals":{"type":"integer","description":"Token decimals"}}},"AssetMetrics":{"allOf":[{"$ref":"#/components/schemas/Metrics"},{"type":"object","required":["unrealized_balance_pnl","realized_balance_pnl"],"properties":{"unrealized_balance_pnl":{"type":"number","format":"double","description":"Unrealized balance PnL (quantity effect)"},"realized_balance_pnl":{"type":"number","format":"double","description":"Realized balance PnL (quantity effect)"}}}]},"TokenValues":{"type":"object","required":["balance","price_usd","balance_usd"],"properties":{"balance":{"type":"number","format":"double","description":"Token balance in token units"},"price_usd":{"type":"number","format":"double","description":"Token price in USD"},"balance_usd":{"type":"number","format":"double","description":"Balance value in USD"}}},"TokenFlows":{"type":"object","required":["in","out"],"properties":{"in":{"type":"object","required":["token_units","usd","tx_hashes"],"properties":{"token_units":{"type":"number","format":"double","description":"Inflow in token units"},"usd":{"type":"number","format":"double","description":"Inflow in USD"},"tx_hashes":{"type":"array","items":{"type":"string"},"description":"Transaction hashes for inflows"}}},"out":{"type":"object","required":["token_units","usd","tx_hashes"],"properties":{"token_units":{"type":"number","format":"double","description":"Outflow in token units"},"usd":{"type":"number","format":"double","description":"Outflow in USD"},"tx_hashes":{"type":"array","items":{"type":"string"},"description":"Transaction hashes for outflows"}}}}},"PerformanceHolding":{"type":"object","required":["id","chain_id","token","initial","final","flows","metrics"],"properties":{"id":{"type":"string","description":"Unique holding identifier"},"chain_id":{"type":"integer","description":"Blockchain network ID"},"name":{"type":"string","nullable":true,"description":"Holding name"},"token":{"$ref":"#/components/schemas/Token"},"initial":{"$ref":"#/components/schemas/TokenValues"},"final":{"$ref":"#/components/schemas/TokenValues"},"flows":{"$ref":"#/components/schemas/TokenFlows"},"metrics":{"$ref":"#/components/schemas/Metrics"}}},"Error":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string","description":"Error type"},"message":{"type":"string","description":"Human-readable error message"},"statusCode":{"type":"integer","description":"HTTP status code"}}}},"responses":{"BadRequest":{"description":"Bad Request - Invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Not Found - No data found matching the criteria","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalServerError":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/performance":{"get":{"tags":["Performance"],"summary":"Calculate PnL Performance","description":"Calculate performance metrics (PnL, ROI, TWR, APR, APY) between two dates for organizations and wallets.\nThis endpoint returns a hierarchical structure: Organizations -> Wallets -> Protocols -> Positions -> Assets/Holdings. It includes Merkl rewards as positions within the Merkl protocol.\n**Query Parameters:**\n- Either `org_id` or `wallet_address` is required (at least one must be provided) - `org_id` - Returns performance for all wallets in the organization - `wallet_address` - Returns performance for a specific wallet - Both can be provided together to filter wallets within an organization\nThe response includes comprehensive metrics at each level of the hierarchy, with positions and assets sorted by final value (descending).\n","operationId":"getPerformance","parameters":[{"name":"org_id","in":"query","description":"Organization ID to calculate performance for all wallets in the organization","required":false,"schema":{"type":"string"}},{"name":"wallet_address","in":"query","description":"Wallet address to calculate performance for. Can be used alone or combined with org_id.","required":false,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"}},{"name":"from_date","in":"query","description":"Start date for performance calculation. Accepts simple format (2025-11-03) or full ISO 8601 (2025-11-03T00:00:00Z)","required":true,"schema":{"type":"string"}},{"name":"to_date","in":"query","description":"End date for performance calculation. Accepts simple format (2025-11-03) or full ISO 8601 (2025-11-03T23:59:59Z)","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response with performance metrics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerformanceResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```
