Portfolio Update
A guide to updating portfolios using the Glider API
After creating a portfolio, you may need to update its structure, allocation, or rebalancing settings. The Glider API provides several endpoints for updating portfolios.
Updating Portfolio Template
To update a portfolio’s template (including its asset allocations and settings), use one of the portfolio update endpoints:
Each update creates a new version of the portfolio’s blueprint (template), preserving the history of changes. The portfolio will be associated with the newly created template version.
Alternative Update Endpoints
You can also use these alternative endpoints for updating portfolios:
All three endpoints function identically, providing flexibility in how you integrate with the API.
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:chainId
where 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”
IMPORTANT: The sum of all percentages in 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:
Common validation errors include:
-
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:
If you encounter validation errors, correct the specified issues and resubmit the template update request.
For more detailed information about the available endpoints, see the Portfolio Management API reference.