This recipe builds a server-side rebalancer that programmatically moves treasury USDC between chains based on a threshold (e.g. utilization, yield differential, opportunity).Documentation Index
Fetch the complete documentation index at: https://eco.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
When to use
- Multi-chain protocols managing distributed treasury
- Yield managers chasing the highest opportunity across chains
- Operational treasuries that want to remove manual rebalancing
1. Define the trigger
2. Get a quote for the rebalance
A treasury rebalance is a simple transfer between two of your wallets. Use the V3 quote API with the source treasury asfunder and the destination treasury as recipient.
3. Approve, publish, fund
Approve the reward token toquote.data.contracts.sourcePortal, then call publishAndFund(destinationChainID, encodedRoute, reward, false) — same exact pattern as Sending USDC across chains.
4. Run on a schedule
5. Atomicity guarantee
Each rebalance is a single intent. It either fully completes or refunds. There is no partial-state reconciliation. If a single intent expires, the refund service returns funds and the next tick can retry.Audit trail
Every rebalance leaves a verifiable on-chain trail:IntentPublishedon source Portal (with reward + amount)IntentFulfilledon destination Portal (with claimant)IntentWithdrawnon source Portal (reward release)
Read next
- Routes API — programmatic intent publishing
- Crowd Liquidity — earn yield on idle treasury between rebalances
