Updating Portfolio Template
To update a portfolio’s template (including its asset allocations and settings), use one of the portfolio update endpoints:Alternative Update Endpoints
You can also use these alternative endpoints for updating portfolios:Template Data Structure
The template data object defines the portfolio structure and settings:Template Fields
name: The name of the portfolio (optional)description: A description of the portfolio (optional)entry: The portfolio structure defining asset allocations (required)blockType: Type of portfolio structure (required, must be “weight” for weighted allocation)weightType: For weighted portfolios, specifies how weights are calculated (required, must be “specified-percentage”)weightings: Array of string percentages for each asset (required, must match the number of children)children: Array of assets or nested structures (required, at least 1 child required)- For assets:
{ blockType: "asset", assetId: "0xTokenAddress:chainId" } - The assetId must follow the format
0xTokenAddress:chainIdwhere chainId is a number - Each asset must have a valid address on the specified chain
- For assets:
tradingSettings: Rebalancing configuration (optional)type: Type of rebalancing - “threshold” or “calendar” (required if tradingSettings is provided)triggerPercentage: Deviation percentage to trigger rebalancing (required if type is “threshold”)frequency: Rebalance frequency (required if type is “calendar”): “daily”, “weekly”, “biweekly”, “monthly”
weightings must equal 100, and the number of weightings must match the number of children in the template. Each percentage should be provided as a string like “60” (not a number).
Updating Rebalance Schedule Interval
You can also update just the rebalancing schedule interval without changing the portfolio template:Response
The template update endpoints return a response with information about the updated portfolio:Validation
The API performs validation on your template updates to ensure they’re well-formed. If there are any validation errors, you’ll receive an error response:-
Invalid Asset ID Format
- Error:
INVALID_ASSET_ID - Fix: Ensure asset IDs follow the format
0xTokenAddress:chainId
- Error:
-
Weight Mismatch
- Error:
WEIGHT_MISMATCH - Fix: Make sure the number of weightings matches the number of children
- Error:
-
Invalid Weight Sum
- Error:
INVALID_WEIGHT_SUM - Fix: Ensure that weights sum to 100
- Error:
-
Missing Required Fields
- Error:
MISSING_REQUIRED_FIELDS - Fix: Include all required fields in the template structure
- Error:
-
Unsupported Asset
- Error:
UNSUPPORTED_ASSET - Fix: Use only supported assets for the specified chain
- Error: