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": "<string>",
"simulationResponse": {},
"functionName": "<string>",
"params": {}
}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.
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": "<string>",
"simulationResponse": {},
"functionName": "<string>",
"params": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Stellar address of the vault contract
"CBNKCU3HGFKHFOF7JTGXQCNKE3G3DXS5RDBQUKQMIIECYKXPIOUGB2S3"
Query Parameters
Stellar network to execute the transaction on (testnet or mainnet)
testnet, mainnet Body
Rebalance parameters. This operation may include instructions for asset allocation, strategy adjustments, or other rebalancing criteria.
Stellar address of the user initiating the rebalance. Must be a valid Stellar public key with Manager or rebalance manager role.
"GB7NTQG4EXB7NZEA5GNFHIHEQVTGQTZ6OWKWUD535FBEHNSEVCKZULIY"
Array of rebalance instructions. Each instruction must be a valid strategy or swap operation.
[
{
"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
}
]
Was this page helpful?