v1
latestOpenAPI 3.0.32026-08-041747125.8 KBUpdate rebalancer configuration
Creates or updates the rebalancing configuration for a specific wallet address and token. This endpoint allows users to set custom protocols and pools for automated rebalancing of their funds.
Authentication: Requires a valid JWT token. The wallet address in the JWT must match the walletAddress field in the request body.
Configuration per Token: Each request configures one specific token (USDC, MUSD, USDT, RLUSD, USDG, USDE, or PYUSD). To configure multiple tokens, make separate PUT requests for each token. After successfully setting a configuration for a token, the hasSignedConfig flag for that token will become true when retrieved via GET /v1/config/{walletAddress}.
Configuration Structure: The configuration specifies arrays of domain IDs, protocol IDs, and pool contract addresses. All three arrays must have the same length, with each index representing one pool configuration:
- domainIds[0], protocolIds[0], poolAddresses[0] = first pool
- domainIds[1], protocolIds[1], poolAddresses[1] = second pool
- And so on...
Array Limits: domainIds, protocolIds, and poolAddresses may each contain at most 200 entries. Additionally, the (domainId, protocolId, poolAddress) triple at each index must be unique across the request - duplicate entries are rejected.
Domain IDs:
- 11 = LINEA
- 6 = BASE
- 7 = POLYGON
- 3 = ARBITRUM
- 1 = AVALANCHE
- 2 = OPTIMISM
- 0 = ETHEREUM
Protocol IDs: Maps to supported protocols:
- 0 = Aave
- 1 = Morpho
- 2 = Euler
Collateral Exposure: Collateral exposure symbols for the pools in the configuration, must be taken from the pool catalog from GET /v1/pools, unique and not empty. If you want to disable the filter, pass null. example: ["WETH", "cbBTC", "wstETH"]
Tvl and liquidity multiplier are optional and can be used to filter the pools in the configuration. Example:
- requiredTvl: 5000000
- requiredLiquidityMultiplier: 10 This will filter the pools in the configuration to only include pools that have a TVL of at least $5M and a liquidity multiplier of at least 10. Example:
- requiredTvl: 0
- requiredLiquidityMultiplier: 0 This will disable the filter and include all pools in the configuration. During deposits, pools that do not comply with filters (exposure, liquidity, tvl) are ignored. Active balances are also monitored periodically and if a pool with a deposit no longer complies with the filters, rebalance immediately happens outside to first available pool with highest APY %
Pool Contracts: Each pool contract address must be a valid checksummed Ethereum address (EIP-55) corresponding to a pool on the specified protocol. Pool addresses can be obtained from the /v1/pools endpoint.
Signature Requirement: The signature field must be created using the following steps:
- ABI-encode the following parameters in order:
- address — rebalancingManagerAddress (from GET /v1/config/{walletAddress})
- uint8[] — protocolIds array
- address[] — poolAddresses array
- uint32[] — domainIds array
- uint256 — spendingCapRaw (use "0" if not set, can be set only for USDC, when setting this value, AAVE protocol on LINEA must be included in the configuration with a non-zero spending cap, otherwise the request will be rejected)
-
Compute keccak256 of the ABI-encoded bytes.
-
Sign the resulting hash using personal_sign (i.e. eth_sign with the standard Ethereum prefix \x19Ethereum Signed Message:\n32). In viem this is walletClient.signMessage({ account, message: { raw: hash } }).
The signature must be 132 characters long (0x + 130 hex characters) and must be signed by the wallet address in the walletAddress field.
Smart Contract Wallets / ERC-6492: For contract wallet signatures, the backend validates the configuration signature on every chain contained within the domainIds. If the signature is rejected on any of those chains, the entire configuration is rejected. The error response will indicate which domain IDs were rejected: "Contract wallets configs can only contain chains verified by supported signature. Found rejected domain IDs: <rejectedIds>".
Include Rewards APY: The optional includeRewardsApy boolean flag (default: true) determines whether reward APYs should be included in APY calculations during rebalancing decisions.
Response: Returns 201 Created if this is the first configuration for the wallet, or 200 OK if updating an existing configuration. The response includes the deployed rebalancer contract address and the list of configured tokens.
Rate limiting: 1 request per 6 seconds per client IP. Excess requests receive HTTP 429 with Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers (see RateLimitExceeded response).
Request body
Example request
{
"domainIds": [
11,
11,
11
],
"protocolIds": [
0,
1,
2
],
"collateralExposure": [
"WETH",
"cbBTC",
"wstETH"
]
}Response
Configuration updated successfully
Example response
{
"walletAddress": "0x1234567890123456789012345678901234567890",
"rebalancerAddress": "0x1234567890123456789012345678901234567890",
"configuredToken": "USDC",
"operation": "CREATED"
}