curl --request POST \
--url https://api.defindex.io/vault/{address}/rebalance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"instructions": [
{
"type": "Invest",
"strategy_address": "CDB2WMKQQNVZMEBY7Q7GZ5C7E7IAFSNMZ7GGVD6WKTCEWK7XOIAVZSAP",
"amount": 500000
},
{
"type": "Unwind",
"strategy_address": "CCBTSHPUVNKCT5V675AAVYNANHXBU26PTZK2QLS7ZLFNYRJZT5HW3VL6",
"amount": 300000
}
]
}
'{
"xdr": "AAAAAgAAAABZnC+hqWmzwW2L...",
"simulationResponse": null,
"functionName": "rebalance",
"operationXDR": "AAAAAAAAABgAAAAAAAAAAVqh...",
"isSmartWallet": false,
"params": [
[
{
"type": "Unwind",
"strategy_address": "CDB2WMKQQNVZMEBY7Q7GZ5C7E7IAFSNMZ7GGVD6WKTCEWK7XOIAVZSAP",
"amount": 1000000
}
],
"GDPOCCBO3KLNXZRZC3NSKTSMIJYWIKEAO3XRSRONSUX36RF37XXF52BA"
]
}{
"statusCode": 429,
"message": "Rate limit exceeded",
"error": "Too Many Requests",
"retryAfter": 1
}Vault management
Rebalance vault strategies
Manager Function - Rebalance Manager: Rebalances the strategies within a vault to optimize asset allocation and performance. This operation adjusts the distribution of assets across strategies based on predefined criteria or market conditions.
POST
/
vault
/
{address}
/
rebalance
curl --request POST \
--url https://api.defindex.io/vault/{address}/rebalance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"instructions": [
{
"type": "Invest",
"strategy_address": "CDB2WMKQQNVZMEBY7Q7GZ5C7E7IAFSNMZ7GGVD6WKTCEWK7XOIAVZSAP",
"amount": 500000
},
{
"type": "Unwind",
"strategy_address": "CCBTSHPUVNKCT5V675AAVYNANHXBU26PTZK2QLS7ZLFNYRJZT5HW3VL6",
"amount": 300000
}
]
}
'{
"xdr": "AAAAAgAAAABZnC+hqWmzwW2L...",
"simulationResponse": null,
"functionName": "rebalance",
"operationXDR": "AAAAAAAAABgAAAAAAAAAAVqh...",
"isSmartWallet": false,
"params": [
[
{
"type": "Unwind",
"strategy_address": "CDB2WMKQQNVZMEBY7Q7GZ5C7E7IAFSNMZ7GGVD6WKTCEWK7XOIAVZSAP",
"amount": 1000000
}
],
"GDPOCCBO3KLNXZRZC3NSKTSMIJYWIKEAO3XRSRONSUX36RF37XXF52BA"
]
}{
"statusCode": 429,
"message": "Rate limit exceeded",
"error": "Too Many Requests",
"retryAfter": 1
}Authorizations
Path Parameters
Query Parameters
Body
application/json
Rebalance parameters. This operation may include instructions for asset allocation, strategy adjustments, or other rebalancing criteria.
Array of rebalance instructions. Each instruction must be a valid strategy or swap operation.
Example:
[
{
"type": "Invest",
"strategy_address": "CDB2WMKQQNVZMEBY7Q7GZ5C7E7IAFSNMZ7GGVD6WKTCEWK7XOIAVZSAP",
"amount": 500000
},
{
"type": "Unwind",
"strategy_address": "CCBTSHPUVNKCT5V675AAVYNANHXBU26PTZK2QLS7ZLFNYRJZT5HW3VL6",
"amount": 300000
},
{
"type": "SwapExactIn",
"token_in": "CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75",
"token_out": "CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA",
"amount": 100000,
"slippageToleranceBps": 50
}
]
Response
Unsigned transaction built for caller. Nothing moves until it is signed and submitted (POST /send).
Was this page helpful?