> ## Documentation Index
> Fetch the complete documentation index at: https://docs.groundtech.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Automatic rebalancing

> How Ground keeps a wallet near its allocation targets, and what can prevent funds from moving.

With `autoRebalance: true`, Ground invests deposits and adjusts holdings toward
your percentage targets. Deposits, withdrawals, price changes, and strategy
updates can move a wallet away from those targets.

Stocks are supported only in manual wallets (`autoRebalance: false`). See
[Choose an allocation mode](https://docs.groundtech.co/v3/docs/portfolio-wallets/introduction.md#choose-an-allocation-mode)
and [Allocate funds](https://docs.groundtech.co/v3/docs/portfolio-wallets/allocate-funds.md).

## Allocation groups

An allocation group is a set of cash and investments that Ground can rebalance
between. Groups exist because money cannot always move between tokens or
networks. For example, USDT held on TRON cannot fund an Ethereum USDT investment,
so those holdings need separate strategies.

Each group has its own percentage targets. `usdt:ethereum` and `usdt:tron` keep
USDT on their respective networks. `usdc:crosschain` covers supported USDC networks
and includes OUSD through supported conversion routes. Ground rebalances within
each group; it does not use one group's money to meet another's targets. See
[Supported Chains](https://docs.groundtech.co/v3/docs/portfolio-wallets/supported-chains.md) for network coverage.

Choose investment `assetId` values from the [asset catalog](https://docs.groundtech.co/v3/docs/portfolio-wallets/yield-sources.md).
Targets must total 100% within each group. Include a `cash` target to leave some
money uninvested. Groups omitted at creation start at 100% cash; a strategy update
changes only the groups you include.

## Update the strategy

For a wallet with `autoRebalance: true`, call
[Update wallet strategy](https://docs.groundtech.co/v3/api-reference/update-strategy.md) with the groups
you want to change. Each included group replaces its previous targets in full;
omitted groups keep their targets. Use asset UUIDs from your environment's catalog.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X PATCH "$BASE_URL/v3/wallets/$WALLET_ID/strategy" \
  -H "Authorization: Bearer $GROUND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "requestId": "6d74dc1c-f1b5-4f2c-8f33-9f7b9e27cd4b",
  "allocations": {
    "usdc:crosschain": [
      {
        "kind": "cash",
        "targetWeightPct": 20
      },
      {
        "assetId": "03389041-80ad-4dcf-8fe2-3536bcfe92db",
        "targetWeightPct": 80
      }
    ],
    "usdt:ethereum": [
      {
        "kind": "cash",
        "targetWeightPct": 50
      },
      {
        "assetId": "f5a3c787-3452-4699-853f-e8710d063cec",
        "targetWeightPct": 50
      }
    ]
  }
}'
```

Save a fresh UUID v4 `requestId` and the exact request before sending. Each target
uses `targetWeightPct` in 0.1% increments and either an investment `assetId` or
`kind: "cash"`. A cash target leaves funds uninvested within the group without
selecting a particular network.

The response's `strategyAllocations` includes the updated and preserved groups.
It describes your desired allocation, not completed fund movements. Updating
requires API authentication but no transaction approval. Applied updates emit
`portfolio_wallet.strategy.status_changed`; see
[Webhooks](https://docs.groundtech.co/v3/docs/portfolio-wallets/webhooks.md).

## When a rebalance happens

### Ordinary allocation drift

Ground leaves small differences alone. A source must be above its dollar target
by at least 2% of that target, and the receiving source must be below its own
target by at least 2%. Both conditions must hold before funds move.

For a \$10,000 wallet targeting 60% in A and 40% in B, those thresholds are
\$120 and \$80. Holdings of \$6,100 / \$3,900 do not trigger a rebalance: A is
only \$100 above target. Holdings of \$6,150 / \$3,850 do qualify, so Ground
can move about \$150 from A to B. It moves toward the target, not just to the
edge of the threshold.

Each movement must also be at least **\$5 in production** or **\$0.01 in sandbox**.
These are the current automatic-rebalance minimums; manual allocations do not
use them. Smaller differences can remain because of minimums, rounding, or
execution limits.

### New cash

If your cash target is 0%, Ground can invest new cash without waiting for the
usual 2% difference. Each movement still needs to meet the minimum. For example,
a \$20 deposit into an on-target 60% / 40% wallet can invest \$12 and \$8.
An \$8 deposit would split into \$4.80 and \$3.20, so it stays in cash because
neither movement reaches the production \$5 minimum. If you set a positive cash
target, the ordinary drift rules apply to cash too.

### Strategy update

Changing your strategy gives Ground a new set of targets to work toward.
Changes to positive target weights use the ordinary drift thresholds and
movement minimums above.

If you remove a source from your strategy or set its target to 0%, Ground tries
to sell its available holdings and move the proceeds toward the remaining targets.
The 2% rule does not apply to that exit or the receiving shortfalls, but each
movement must still meet the minimum. Removing a \$10 position can therefore
move that \$10 to another source even when the receiving source is only slightly
below target.

The new targets are saved immediately, but the money moves later. Movements
already underway continue to their committed destinations; later rebalances
use the updated targets and available funds. See
[Update the strategy](#update-the-strategy) for the request.

## What can prevent a rebalance?

[Risk rules](https://docs.groundtech.co/v3/docs/portfolio-wallets/risk-engine.md) and source controls can block
buying or selling. Deposit minimums,
allocation caps, insufficient liquidity, unavailable prices, or unsupported routes
can also prevent a movement or limit its amount. Funds that cannot be invested
may remain in cash, and holdings that cannot be sold remain in the wallet.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.