User Portfolios
Create a new custom portfolio for a specific user
ID of the user who owns the portfolio
user123
Name of the user portfolio
My Custom DePIN Portfolio
Description of the portfolio strategy
A personalized portfolio tailored to my risk preferences
Risk level of the portfolio
Moderate
Possible values: ID of the predefined portfolio this is based on (if any)
1
Whether this portfolio has been customized by the user
true
POST /v1/user-portfolio HTTP/1.1
Host: api.example.com
Content-Type: application/json
Accept: */*
Content-Length: 433
{
"userId": "user123",
"name": "My Custom DePIN Portfolio",
"description": "A personalized portfolio tailored to my risk preferences",
"riskLevel": "Moderate",
"protocolItems": [
{
"protocolName": "Helium",
"protocolIdentifier": "HNT",
"allocationPercentage": 50
},
{
"protocolName": "Render Network",
"protocolIdentifier": "RNDR",
"allocationPercentage": 30
},
{
"protocolName": "Livepeer",
"protocolIdentifier": "LPT",
"allocationPercentage": 20
}
],
"isCustom": true
}
{
"message": "User portfolio created successfully",
"userPortfolioId": "1",
"totalAllocation": 100
}
Create a user portfolio by copying from a predefined portfolio template
The ID of the predefined portfolio to copy
1
The ID of the user who will own the copied portfolio
user123
Whether the user plans to customize the portfolio
false
Example: false
POST /v1/user-portfolio/copy/{predefinedPortfolioId} HTTP/1.1
Host: api.example.com
Content-Type: application/json
Accept: */*
Content-Length: 38
{
"userId": "user123",
"customize": false
}
{
"message": "User portfolio copied successfully",
"userPortfolioId": "1",
"basedOnPredefinedId": "1",
"isCustom": false
}
Retrieve all portfolios associated with a specific user
The ID of the user whose portfolios to retrieve
user123
GET /v1/user-portfolios/{userId} HTTP/1.1
Host: api.example.com
Accept: */*
[
{
"userPortfolioId": "1",
"userId": "user123",
"name": "My Custom DePIN Portfolio",
"description": "A personalized portfolio tailored to my risk preferences",
"riskLevel": "Moderate",
"protocolItems": [
{
"protocolName": "Helium",
"protocolIdentifier": "HNT",
"allocationPercentage": 60
}
],
"totalAllocation": 100,
"basedOnPredefinedId": "1",
"isCustom": true,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
]
Retrieve a specific user portfolio by its ID
The ID of the user portfolio to retrieve
1
GET /v1/user-portfolio/{portfolioId} HTTP/1.1
Host: api.example.com
Accept: */*
{
"userPortfolioId": "1",
"userId": "user123",
"name": "My Custom DePIN Portfolio",
"description": "A personalized portfolio tailored to my risk preferences",
"riskLevel": "Moderate",
"protocolItems": [
{
"protocolName": "Helium",
"protocolIdentifier": "HNT",
"allocationPercentage": 60
}
],
"totalAllocation": 100,
"basedOnPredefinedId": "1",
"isCustom": true,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
Update an existing user portfolio
The ID of the user portfolio to update
1
Updated name of the user portfolio
My Updated Custom DePIN Portfolio
Updated description of the portfolio strategy
An updated personalized portfolio
Updated risk level of the portfolio
Moderate Aggressive
Possible values: PUT /v1/user-portfolio/{portfolioId} HTTP/1.1
Host: api.example.com
Content-Type: application/json
Accept: */*
Content-Length: 225
{
"name": "My Updated Custom DePIN Portfolio",
"description": "An updated personalized portfolio",
"riskLevel": "Moderate Aggressive",
"protocolItems": [
{
"protocolName": "Helium",
"protocolIdentifier": "HNT",
"allocationPercentage": 60
}
]
}
{
"message": "User portfolio updated successfully",
"userPortfolioId": "1",
"totalAllocation": 100
}
Remove a user portfolio from the system
The ID of the user portfolio to delete
1
DELETE /v1/user-portfolio/{portfolioId} HTTP/1.1
Host: api.example.com
Accept: */*
{
"message": "User portfolio deleted successfully"
}