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

# Rebalancing

> Managing vault allocations and executing rebalancing

## Overview

Rebalancing keeps your vault aligned with strategy targets. This guide covers when and how to rebalance effectively.

## When to Rebalance

### Maturity Events

Most common trigger for fixed-rate vaults:

```
Position A (30-day) matures:
├── Principal: $100,000
├── Interest: $800
├── Total: $100,800 now in cash

Decision: Redeploy to new position or adjust allocation?
```

### Drift Threshold

When allocation drifts from target:

```
Target: 33% each in 30d, 60d, 90d

Current (after market moves):
├── 30-day: 40% (+7%)
├── 60-day: 28% (-5%)
├── 90-day: 27% (-6%)
├── Cash: 5%

Drift exceeds 5% threshold → Rebalance
```

### Rate Opportunities

When rates significantly improve:

```
Current position: $200,000 at 7.5% (60 days remaining)
New market rate: 9.0% for 60 days

Potential improvement: +150bps
Consider: Exit current, enter new position
```

### Large Deposits/Withdrawals

New capital needs deployment:

```
Vault AUM: $1,000,000
New deposit: $250,000 (+25%)

Deploy new capital according to strategy targets
```

## Rebalancing Process

### Step 1: Assess Current State

```typescript theme={null}
const currentAllocation = await vault.getAllocation();
console.log(currentAllocation);
// {
//   positions: [...],
//   cash: 50000,
//   totalValue: 1000000
// }
```

### Step 2: Calculate Target

```typescript theme={null}
const targetAllocation = {
  '30-day': 0.30,
  '60-day': 0.35,
  '90-day': 0.30,
  'cash': 0.05
};
```

### Step 3: Plan Trades

```typescript theme={null}
const rebalanceActions = calculateRebalance(
  currentAllocation,
  targetAllocation
);
// [
//   { action: 'reduce', position: '30-day', amount: 70000 },
//   { action: 'increase', position: '60-day', amount: 50000 },
//   { action: 'increase', position: '90-day', amount: 30000 }
// ]
```

### Step 4: Execute

```typescript theme={null}
await vault.rebalance(rebalanceActions);
```

## Rebalancing Strategies

### Calendar-Based

Fixed schedule regardless of drift:

| Frequency   | Best For            |
| ----------- | ------------------- |
| Weekly      | Active strategies   |
| Monthly     | Moderate strategies |
| At maturity | Passive strategies  |

### Threshold-Based

Rebalance when drift exceeds threshold:

| Threshold | Rebalancing Frequency |
| --------- | --------------------- |
| 2%        | Very frequent         |
| 5%        | Moderate              |
| 10%       | Infrequent            |

### Opportunistic

Rebalance when market conditions favor it:

* Rates significantly higher/lower
* Liquidity unusually good
* New opportunities emerge

## Execution Best Practices

<CardGroup cols={2}>
  <Card title="Gradual Moves" icon="clock">
    Large rebalances over multiple days to reduce market impact
  </Card>

  <Card title="Limit Orders" icon="hand">
    Use limit orders for better execution
  </Card>

  <Card title="Document Rationale" icon="file-pen">
    Record why you're rebalancing
  </Card>

  <Card title="Consider Costs" icon="calculator">
    Factor in any costs (opportunity, gas if applicable)
  </Card>
</CardGroup>

## Rebalancing Example

```
Starting State:
├── 30-day USDC @ 7.5%: $300,000 (30%)
├── 60-day USDC @ 8.0%: $350,000 (35%)
├── 90-day USDC @ 8.2%: $300,000 (30%)
├── Cash: $50,000 (5%)
Total: $1,000,000

Event: 30-day positions mature → $306,000 cash now

New State:
├── Cash: $356,000 (35.6%)
├── 60-day (now 30-day): $350,000 (35%)
├── 90-day (now 60-day): $300,000 (30%)

Rebalance Plan:
1. Deploy $206,000 to new 90-day positions
2. Keep $100,000 as new 30-day maturity ladder
3. Maintain $50,000 cash buffer

Execution:
├── Create lend order: $206,000 @ 8.3% for 90 days
├── Create lend order: $100,000 @ 7.8% for 90 days
└── Target allocation restored
```

## Costs of Rebalancing

| Cost Type        | Impact                              | Mitigation                      |
| ---------------- | ----------------------------------- | ------------------------------- |
| Opportunity cost | Exit position early = forfeit yield | Wait for maturity when possible |
| Spread cost      | Market orders have spread           | Use limit orders                |
| Time cost        | Your time to execute                | Automate when possible          |

## Automation

For approved curators, automation tools:

```typescript theme={null}
// Set auto-rebalance rules
await vault.setAutoRebalance({
  enabled: true,
  driftThreshold: 0.05, // 5%
  rebalanceFrequency: 'weekly',
  preferredTime: '00:00 UTC',
  maxSlippage: 0.005 // 0.5%
});
```

## FAQs

<AccordionGroup>
  <Accordion title="How often should I rebalance?">
    Depends on strategy. Fixed-rate vaults often rebalance at maturities. Active strategies may rebalance weekly.
  </Accordion>

  <Accordion title="Can I rebalance too much?">
    Yes. Excessive rebalancing can reduce returns through costs and missed yield.
  </Accordion>

  <Accordion title="What if I can't fill my orders?">
    Adjust rates or split across maturities. Partial deployment is okay.
  </Accordion>
</AccordionGroup>
