# Sweep to yield

Opens a simulated yield position from idle funds and posts it to the simulated ledger. Requires reconcile; the amount must be between 1 and the idle balance.

`POST /v1/treasury/sweep`

Opens a simulated yield position from idle funds and posts it to the simulated ledger. Requires reconcile; the amount must be between 1 and the idle balance.

Requires permission `reconcile`.

## Request body

```json
{
  "amount_base_units": "50000",
  "amount": "50000"
}
```

## Responses

- **200**: Success.
- **400**: Invalid request: a field is missing or malformed (VALIDATION_ERROR).
- **401**: No valid session, API key or agent credential (UNAUTHENTICATED, AGENT_CREDENTIAL_INVALID).
- **403**: Authenticated but not allowed: missing permission, passkey step-up required, or denied by policy.

Example 200 response:

```json
{
  "position": {
    "id": "id_01jd2x3k4m5n6p7q8r9s0t1v2w",
    "amount": {
      "base_units": "50000",
      "display": "string",
      "simulated": true
    },
    "apy_bps": 1,
    "status": "active",
    "simulated": true,
    "created_at": "2026-11-16T12:00:00Z"
  },
  "projection": {
    "daily": {
      "base_units": "50000",
      "display": "string",
      "simulated": true
    },
    "monthly": {
      "base_units": "50000",
      "display": "string",
      "simulated": true
    },
    "annual": {
      "base_units": "50000",
      "display": "string",
      "simulated": true
    }
  },
  "simulated": true
}
```
