User Portfolios

Create a new user portfolio

post

Create a new custom portfolio for a specific user

Body
userIdstringRequired

ID of the user who owns the portfolio

Example: user123
namestringOptional

Name of the user portfolio

Example: My Custom DePIN Portfolio
descriptionstringOptional

Description of the portfolio strategy

Example: A personalized portfolio tailored to my risk preferences
riskLevelstring · enumRequired

Risk level of the portfolio

Example: ModeratePossible values:
basedOnPredefinedIdstringOptional

ID of the predefined portfolio this is based on (if any)

Example: 1
isCustombooleanRequired

Whether this portfolio has been customized by the user

Example: true
Responses
201
User portfolio created successfully
application/json
post
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
}

Copy predefined portfolio to user portfolio

post

Create a user portfolio by copying from a predefined portfolio template

Path parameters
predefinedPortfolioIdstringRequired

The ID of the predefined portfolio to copy

Example: 1
Body
userIdstringRequired

The ID of the user who will own the copied portfolio

Example: user123
customizebooleanOptional

Whether the user plans to customize the portfolio

Default: falseExample: false
Responses
201
User portfolio copied successfully
application/json
post
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
}

Get all user portfolios for a specific user

get

Retrieve all portfolios associated with a specific user

Path parameters
userIdstringRequired

The ID of the user whose portfolios to retrieve

Example: user123
Responses
200
User portfolios retrieved successfully
application/json
get
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"
  }
]

Get specific user portfolio

get

Retrieve a specific user portfolio by its ID

Path parameters
portfolioIdstringRequired

The ID of the user portfolio to retrieve

Example: 1
Responses
200
User portfolio retrieved successfully
application/json
get
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 user portfolio

put

Update an existing user portfolio

Path parameters
portfolioIdstringRequired

The ID of the user portfolio to update

Example: 1
Body
namestringOptional

Updated name of the user portfolio

Example: My Updated Custom DePIN Portfolio
descriptionstringOptional

Updated description of the portfolio strategy

Example: An updated personalized portfolio
riskLevelstring · enumOptional

Updated risk level of the portfolio

Example: Moderate AggressivePossible values:
Responses
200
User portfolio updated successfully
application/json
put
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
}

Delete user portfolio

delete

Remove a user portfolio from the system

Path parameters
portfolioIdstringRequired

The ID of the user portfolio to delete

Example: 1
Responses
200
User portfolio deleted successfully
application/json
delete
DELETE /v1/user-portfolio/{portfolioId} HTTP/1.1
Host: api.example.com
Accept: */*
{
  "message": "User portfolio deleted successfully"
}