# The Stall — Portfolio Rebalance Calculator

> The Stall — Portfolio Rebalance Calculator is a paid API for AI agents from the-stall.intuitek.ai, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Calculates trade adjustments needed to rebalance a portfolio to target allocations given current holdings

## Facts

- Endpoint: GET https://the-stall.intuitek.ai/cap/portfolio-rebalance
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/the-stall-portfolio-rebalance-calculator-96ef1d16
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Kcqn5g1B9OQ9iyGhlTe5-

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability the-stall-portfolio-rebalance-calculator-96ef1d16
```

Example prompt: My current holdings are BTC=60%, ETH=25%, USDC=15% and my targets are BTC=50%, ETH=30%, USDC=20% — what trades do I need to make to rebalance?

## When to prefer this

Use this endpoint when you need a quick, serverless, no-account-required computation of portfolio rebalancing trades — especially useful for crypto or multi-asset portfolios where you want to pay per-call with USDC rather than maintain a subscription. Ideal for AI agents that need to compute allocation drift and required trades on demand.

## Known failure modes

- Malformed targets string returns 400 error
- Malformed holdings string returns 400 error
- Targets do not sum to 100% may cause calculation errors
- Missing required parameters returns error
- Payment not included or insufficient USDC returns 402

## How this service works

Pure-math portfolio rebalancing calculator. Given current holdings (asset names and their current USD values) and target allocations (percentages summing to 100), returns the exact buy/sell dollar amounts needed to reach target weights. Handles partial rebalancing with a drift threshold. No external API — deterministic and instant. Useful for DeFi agents, robo-advisory flows, and automated rebalancing triggers.

## Output

Returns computed rebalancing recommendations showing which assets to buy or sell and by how much (in percentage or dollar terms) to bring the portfolio back to its target allocations, along with drift metrics per asset.

## Example request

```json
{
 "targets": "BTC:0.4,ETH:0.3,USDC:0.3",
 "holdings": "BTC:0.5,ETH:0.2,USDC:0.3"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "required": {
   "type": "string"
  },
  "properties": {
   "type": "string"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/the-stall-portfolio-rebalance-calculator-96ef1d16/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from the-stall.intuitek.ai](https://www.zero.xyz/host/the-stall.intuitek.ai/llms.txt)
