Tokens rebalancing

The goal of this task is to rebalance a three-token portfolio to reach specific target weights (measured in basis points), using USD valuations and slippage-protected swaps.

For example, suppose the targets are:

  • 50% BTC

  • 30% ETH

  • 20% DAI

If the portfolio currently holds:

  • $6,500 in BTC (65%)

  • $2,500 in ETH (25%)

  • $1,000 in DAI (10%)

Since BTC is overweight while ETH and DAI are underweight, the task will swap $500 worth of BTC into ETH and $1,000 worth of BTC into DAI to restore the target balance.

Task

Manifest

The ABI used for this example can be downloaded below:

4KB
Open

Last updated