curl --request GET \
--url '/v1/portfolios?userAddress=0xYourWalletAddress&limit=10&offset=0&sort=created_at&order=desc' \
--header 'X-API-KEY: your_api_key_here'
{
"success": true,
"data": {
"portfolios": [
{
"id": "port_abc123",
"name": "70/30 ETH-USDC Portfolio",
"description": "A simple portfolio with 70% ETH and 30% USDC allocation",
"ownerAddress": "0xUserWalletAddress",
"isPublic": false,
"isArchived": false,
"createdAt": "2023-05-21T12:34:56.789Z",
"updatedAt": "2023-05-21T13:45:12.345Z",
"tags": ["api-created"],
"templateId": "tmpl_xyz789",
"valueUsd": "1053.75",
"vaults": [
{
"chainId": "8453",
"address": "0xPortfolioVaultAddress",
"assets": [
{
"address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"chainId": 8453,
"decimals": 18,
"symbol": "ETH",
"name": "Ethereum",
"logoURI": "https://assets.glider.fi/icons/eth.png",
"assetId": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE:8453",
"totalBalance": "0.5",
"baseTokenBalance": "0.5",
"priceUSD": "1500",
"amount": "0.5",
"rawAmount": "500000000000000000"
},
{
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"chainId": 8453,
"decimals": 6,
"symbol": "USDC",
"name": "USD Coin",
"logoURI": "https://assets.glider.fi/icons/usdc.png",
"assetId": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913:8453",
"totalBalance": "300",
"baseTokenBalance": "300",
"priceUSD": "1",
"amount": "300",
"rawAmount": "300000000"
}
]
}
]
}
],
"pagination": {
"total": 1,
"limit": 10,
"offset": 0,
"hasMore": false
}
},
"correlationId": "corr_abc123",
"requestId": "req_xyz789",
"timestamp": "2023-05-21T12:34:56.789Z"
}
Endpoints for managing portfolios
curl --request GET \
--url '/v1/portfolios?userAddress=0xYourWalletAddress&limit=10&offset=0&sort=created_at&order=desc' \
--header 'X-API-KEY: your_api_key_here'
{
"success": true,
"data": {
"portfolios": [
{
"id": "port_abc123",
"name": "70/30 ETH-USDC Portfolio",
"description": "A simple portfolio with 70% ETH and 30% USDC allocation",
"ownerAddress": "0xUserWalletAddress",
"isPublic": false,
"isArchived": false,
"createdAt": "2023-05-21T12:34:56.789Z",
"updatedAt": "2023-05-21T13:45:12.345Z",
"tags": ["api-created"],
"templateId": "tmpl_xyz789",
"valueUsd": "1053.75",
"vaults": [
{
"chainId": "8453",
"address": "0xPortfolioVaultAddress",
"assets": [
{
"address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"chainId": 8453,
"decimals": 18,
"symbol": "ETH",
"name": "Ethereum",
"logoURI": "https://assets.glider.fi/icons/eth.png",
"assetId": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE:8453",
"totalBalance": "0.5",
"baseTokenBalance": "0.5",
"priceUSD": "1500",
"amount": "0.5",
"rawAmount": "500000000000000000"
},
{
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"chainId": 8453,
"decimals": 6,
"symbol": "USDC",
"name": "USD Coin",
"logoURI": "https://assets.glider.fi/icons/usdc.png",
"assetId": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913:8453",
"totalBalance": "300",
"baseTokenBalance": "300",
"priceUSD": "1",
"amount": "300",
"rawAmount": "300000000"
}
]
}
]
}
],
"pagination": {
"total": 1,
"limit": 10,
"offset": 0,
"hasMore": false
}
},
"correlationId": "corr_abc123",
"requestId": "req_xyz789",
"timestamp": "2023-05-21T12:34:56.789Z"
}
true
) or active (false
) portfolioscreated_at
, updated_at
, name
)asc
, desc
)curl --request GET \
--url '/v1/portfolios?userAddress=0xYourWalletAddress&limit=10&offset=0&sort=created_at&order=desc' \
--header 'X-API-KEY: your_api_key_here'
{
"success": true,
"data": {
"portfolios": [
{
"id": "port_abc123",
"name": "70/30 ETH-USDC Portfolio",
"description": "A simple portfolio with 70% ETH and 30% USDC allocation",
"ownerAddress": "0xUserWalletAddress",
"isPublic": false,
"isArchived": false,
"createdAt": "2023-05-21T12:34:56.789Z",
"updatedAt": "2023-05-21T13:45:12.345Z",
"tags": ["api-created"],
"templateId": "tmpl_xyz789",
"valueUsd": "1053.75",
"vaults": [
{
"chainId": "8453",
"address": "0xPortfolioVaultAddress",
"assets": [
{
"address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"chainId": 8453,
"decimals": 18,
"symbol": "ETH",
"name": "Ethereum",
"logoURI": "https://assets.glider.fi/icons/eth.png",
"assetId": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE:8453",
"totalBalance": "0.5",
"baseTokenBalance": "0.5",
"priceUSD": "1500",
"amount": "0.5",
"rawAmount": "500000000000000000"
},
{
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"chainId": 8453,
"decimals": 6,
"symbol": "USDC",
"name": "USD Coin",
"logoURI": "https://assets.glider.fi/icons/usdc.png",
"assetId": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913:8453",
"totalBalance": "300",
"baseTokenBalance": "300",
"priceUSD": "1",
"amount": "300",
"rawAmount": "300000000"
}
]
}
]
}
],
"pagination": {
"total": 1,
"limit": 10,
"offset": 0,
"hasMore": false
}
},
"correlationId": "corr_abc123",
"requestId": "req_xyz789",
"timestamp": "2023-05-21T12:34:56.789Z"
}
curl --request GET \
--url '/v1/portfolio/port_abc123' \
--header 'X-API-KEY: your_api_key_here'
{
"success": true,
"data": {
"id": "port_abc123",
"name": "70/30 ETH-USDC Portfolio",
"description": "A simple portfolio with 70% ETH and 30% USDC allocation",
"ownerAddress": "0xUserWalletAddress",
"isPublic": false,
"isArchived": false,
"createdAt": "2023-05-21T12:34:56.789Z",
"updatedAt": "2023-05-21T13:45:12.345Z",
"tags": ["api-created"],
"templateId": "tmpl_xyz789",
"valueUsd": "1053.75",
"template": {
"entry": {
"blockType": "weight",
"weightType": "specified-percentage",
"weightings": ["70", "30"],
"children": [
{
"blockType": "asset",
"assetId": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE:8453"
},
{
"blockType": "asset",
"assetId": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913:8453"
}
]
}
},
"vaults": [
{
"chainId": "8453",
"address": "0xPortfolioVaultAddress",
"assets": [
{
"address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"chainId": 8453,
"decimals": 18,
"symbol": "ETH",
"name": "Ethereum",
"logoURI": "https://assets.glider.fi/icons/eth.png",
"assetId": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE:8453",
"totalBalance": "0.5",
"baseTokenBalance": "0.5",
"priceUSD": "1500",
"amount": "0.5",
"rawAmount": "500000000000000000"
},
{
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"chainId": 8453,
"decimals": 6,
"symbol": "USDC",
"name": "USD Coin",
"logoURI": "https://assets.glider.fi/icons/usdc.png",
"assetId": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913:8453",
"totalBalance": "300",
"baseTokenBalance": "300",
"priceUSD": "1",
"amount": "300",
"rawAmount": "300000000"
}
]
}
],
"metadata": {
"isPublic": false,
"created": "2023-05-21T12:34:56.789Z",
"lastUpdated": "2023-05-21T13:45:12.345Z",
"templateId": "tmpl_xyz789",
"mirrored": false,
"rebalanceScheduleId": "sched_abc123"
},
"portfolioId": "port_abc123",
"owner": "0xUserWalletAddress",
"costBasisAssets": [
{
"assetId": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE:8453",
"symbol": "ETH",
"totalAcquired": "0.6",
"totalDisposed": "0.1",
"currentAmount": "0.5",
"averageCostBasis": "1450.00",
"realizedPnL": "5.00",
"unrealizedPnL": "25.00"
},
{
"assetId": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913:8453",
"symbol": "USDC",
"totalAcquired": "500",
"totalDisposed": "200",
"currentAmount": "300",
"averageCostBasis": "1.00",
"realizedPnL": "0.00",
"unrealizedPnL": "0.00"
}
],
"costBasisSummary": {
"totalCostBasis": "1170.00",
"totalRealizedPnL": "5.00",
"totalUnrealizedPnL": "25.00",
"totalPositions": 2
},
"trades": [
{
"tradeDirection": "buy",
"timestamp": "2023-05-21T12:55:32.123Z",
"totalProfitLossUsd": "0.00",
"totalProfitLossPercent": 0,
"totalSellValueUsd": "50.00",
"totalBuyValueUsd": "50.00",
"swaps": [
{
"type": "fromToken",
"amount": "50",
"symbol": "USDC",
"valueUsd": "50.00"
},
{
"type": "toToken",
"amount": "0.033333",
"symbol": "ETH",
"valueUsd": "50.00"
}
]
}
],
"activity": [
{
"id": "act_abc123",
"type": "deposit",
"assetId": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE:8453",
"symbol": "ETH",
"decimals": 18,
"amount": "0.5",
"rawAmount": "500000000000000000",
"priceUsd": "1500",
"valueUsd": "750.00",
"txHash": "0xTransactionHash123",
"chainId": 8453,
"blockNumber": 12345678,
"timestamp": "2023-05-21T12:34:56.789Z"
},
{
"id": "act_def456",
"type": "deposit",
"assetId": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913:8453",
"symbol": "USDC",
"decimals": 6,
"amount": "300",
"rawAmount": "300000000",
"priceUsd": "1",
"valueUsd": "300.00",
"txHash": "0xTransactionHash456",
"chainId": 8453,
"blockNumber": 12345679,
"timestamp": "2023-05-21T12:40:12.345Z"
}
]
},
"correlationId": "corr_abc123",
"requestId": "req_xyz789",
"timestamp": "2023-05-21T12:34:56.789Z"
}
PUT
and POST
methods are supported.
curl --request PUT \
--url '/v1/portfolio/port_abc123' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: your_api_key_here' \
--data '{
"templateData": {
"name": "Updated 70/30 ETH-USDC Portfolio",
"description": "A simple portfolio with 70% ETH and 30% USDC allocation",
"entry": {
"blockType": "weight",
"weightType": "specified-percentage",
"weightings": ["70", "30"],
"children": [
{
"blockType": "asset",
"assetId": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE:8453"
},
{
"blockType": "asset",
"assetId": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913:8453"
}
]
},
"tradingSettings": {
"type": "threshold",
"triggerPercentage": 5
}
}
}'
{
"success": true,
"data": {
"portfolioId": "port_abc123",
"message": "Portfolio template updated successfully",
"httpMethod": "PUT",
"blueprint": {
"blueprintId": "tmpl_xyz789",
"editId": "edit_abc123",
"version": 2,
"name": "Updated 70/30 ETH-USDC Portfolio"
}
},
"correlationId": "corr_abc123",
"requestId": "req_xyz789",
"timestamp": "2023-05-21T13:45:12.345Z"
}
true
) or active (false
) portfolioscreated_at
, updated_at
, name
)asc
, desc
)curl --request GET \
--url '/v1/portfolios/by-owner?ownerAddress=0xYourWalletAddress&limit=10&offset=0' \
--header 'X-API-KEY: your_api_key_here'
{
"success": true,
"data": {
"ownerAddress": "0xYourWalletAddress",
"portfolios": [
{
"id": "port_abc123",
"name": "70/30 ETH-USDC Portfolio",
"description": "A simple portfolio with 70% ETH and 30% USDC allocation",
"ownerAddress": "0xYourWalletAddress",
"managedByTenantId": "tenant_xyz789",
"isPublic": false,
"isArchived": false,
"createdAt": "2023-05-21T12:34:56.789Z",
"updatedAt": "2023-05-21T13:45:12.345Z",
"tags": ["api-created"],
"blueprintId": "tmpl_xyz789",
"automation": {
"status": "active",
"hasAutomation": true
},
"valueUsd": "1053.75",
"vaults": [
{
"chainId": "8453",
"address": "0xPortfolioVaultAddress",
"assets": [
{
"address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"chainId": 8453,
"decimals": 18,
"symbol": "ETH",
"name": "Ethereum",
"logoURI": "https://assets.glider.fi/icons/eth.png",
"assetId": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE:8453",
"totalBalance": "0.5",
"baseTokenBalance": "0.5",
"priceUSD": "1500",
"amount": "0.5",
"rawAmount": "500000000000000000"
},
{
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"chainId": 8453,
"decimals": 6,
"symbol": "USDC",
"name": "USD Coin",
"logoURI": "https://assets.glider.fi/icons/usdc.png",
"assetId": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913:8453",
"totalBalance": "300",
"baseTokenBalance": "300",
"priceUSD": "1",
"amount": "300",
"rawAmount": "300000000"
}
]
}
]
}
],
"pagination": {
"total": 1,
"limit": 10,
"offset": 0,
"hasMore": false
}
},
"correlationId": "corr_abc123",
"requestId": "req_xyz789",
"timestamp": "2023-05-21T12:34:56.789Z"
}