> ## Documentation Index
> Fetch the complete documentation index at: https://glide-9da73dea.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# yield.allocate

> Move funds between yield vaults (Aave/Morpho/Kamino/idle) within the envelope. Requires an enabled yield integration; the catalog skill is currently blocked on that dependency.

Move funds between yield vaults (Aave/Morpho/Kamino/idle) within the envelope. Requires an enabled yield integration; the catalog skill is currently blocked on that dependency.

## Metadata

| Field | Value |
| - | - |
| Name | `yield.allocate` |
| Category | `treasury` |
| Required scope | `treasury:yield-allocate` |
| Idempotency key required | yes |

## Annotations

| Annotation | Value |
| - | - |
| Title | Allocate Yield |
| Read-only | no |
| Destructive | no |
| Idempotent | yes |
| Open-world | no |
| Requires human approval | no |

## Input schema

```json theme={null}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "from_protocol": {
      "type": "string",
      "enum": [
        "aave",
        "morpho",
        "kamino",
        "idle"
      ]
    },
    "to_protocol": {
      "type": "string",
      "enum": [
        "aave",
        "morpho",
        "kamino",
        "idle"
      ]
    },
    "chain": {
      "type": "string",
      "enum": [
        "eth",
        "base",
        "arb",
        "op",
        "polygon",
        "sol"
      ]
    },
    "token": {
      "type": "string",
      "minLength": 1
    },
    "amount_cents": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "min_apr_bps": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "idempotency_key": {
      "type": "string",
      "minLength": 8,
      "maxLength": 128
    }
  },
  "required": [
    "from_protocol",
    "to_protocol",
    "chain",
    "token",
    "amount_cents",
    "idempotency_key"
  ],
  "additionalProperties": false
}
```

## Output schema

```json theme={null}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "allocation_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "from_protocol": {
      "type": "string",
      "enum": [
        "aave",
        "morpho",
        "kamino",
        "idle"
      ]
    },
    "to_protocol": {
      "type": "string",
      "enum": [
        "aave",
        "morpho",
        "kamino",
        "idle"
      ]
    },
    "amount_cents": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "enqueued_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
    },
    "policy_version": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "allocation_id",
    "from_protocol",
    "to_protocol",
    "amount_cents",
    "enqueued_at",
    "policy_version"
  ],
  "additionalProperties": false
}
```

## Auth

Caller's grant must include the `treasury:yield-allocate` scope. Grants whose scope set is a superset of the required scope are accepted.

## Request examples

```bash curl theme={null}
curl -X POST https://mcp.glide.co/mcp/treasury \
  -H "Authorization: Bearer $GLIDE_GRANT_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: yield-rebalance-20260504-001" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "yield.allocate",
    "params": {
      "from_protocol": "idle",
      "to_protocol": "aave",
      "chain": "base",
      "token": "USDC",
      "amount_cents": 500000,
      "min_apr_bps": 350,
      "idempotency_key": "yield-rebalance-20260504-001"
    }
  }'
```

```ts TypeScript theme={null}
import { GlideClient, StepUpRequired } from './glide-client';

const client = new GlideClient({ grantToken: process.env.GLIDE_GRANT_TOKEN! });

const result = await client.call(
  'treasury', 'yield.allocate',
  {
    from_protocol: 'idle',
    to_protocol: 'aave',
    chain: 'base',
    token: 'USDC',
    amount_cents: 500000,
    min_apr_bps: 350,
    idempotency_key: 'yield-rebalance-20260504-001',
  },
  { idempotencyKey: 'yield-rebalance-20260504-001' },
);

if (result instanceof StepUpRequired) {
  // Amount exceeded step-up threshold; redirect for approval.
  window.location.href = result.stepUpUrl;
  return;
}
console.log('Allocation enqueued:', result.allocation_id);
```

```python Python theme={null}
from glide_client import GlideClient, StepUpRequired
import os

client = GlideClient(grant_token=os.environ["GLIDE_GRANT_TOKEN"])
result = client.call(
    "treasury", "yield.allocate",
    {
        "from_protocol": "idle",
        "to_protocol": "aave",
        "chain": "base",
        "token": "USDC",
        "amount_cents": 500000,
        "min_apr_bps": 350,
        "idempotency_key": "yield-rebalance-20260504-001",
    },
    idempotency_key="yield-rebalance-20260504-001",
)
if isinstance(result, StepUpRequired):
    print("Step-up needed:", result.step_up_url)
else:
    print("Allocation enqueued:", result["allocation_id"])
```

## Response examples

**Success**

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "allocation_id": "c1d2e3f4-a5b6-4789-8012-345678fedcba",
    "from_protocol": "idle",
    "to_protocol": "aave",
    "amount_cents": 500000,
    "enqueued_at": "2026-05-04T15:30:00Z",
    "policy_version": 9
  }
}
```

**Step-up required (amount over envelope threshold)**

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32003,
    "message": "yield move of 500000¢ requires step-up",
    "data": {
      "reason_id": "step_up_required",
      "step_up_url": "https://app.glide.co/step-up/confirm?sigil=eyJhbGci..."
    }
  }
}
```

**V3 yield infrastructure not yet available**

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32006,
    "message": "yield.allocate depends on V3 DeFi yield infra (Bucket 1.8 / 4.4); not yet shipped",
    "data": {
      "reason_id": "yield_v3_blocked"
    }
  }
}
```

## Errors

| Code | `reason_id` | Meaning |
| - | - | - |
| `-32000` | `unauthenticated` | Bearer token missing or expired. |
| `-32001` | `unauthorized` | Grant does not include `treasury:yield-allocate`. |
| `-32002` | `policy_denied` | Envelope denied the allocation (velocity, protocol not in allowlist, daily cap). |
| `-32003` | `step_up_required` | Amount is at or above the envelope's `step_up_amount_cents`. `data.step_up_url` is the approval URL. |
| `-32004` | `rate_limited` | Too many allocation requests. `data.retry_after_seconds` present. |
| `-32006` | `yield_v3_blocked` | V3 DeFi yield infrastructure is not yet deployed. The tool is gated on Bucket 1.8 / 4.4. |
| `-32602` | `same_protocol_noop` | `from_protocol` and `to_protocol` are identical — no-op. |
| `-32603` | `internal_error` | Transient server fault. Retry with the same idempotency key. |

## Step-up flow

`yield.allocate` evaluates the amount against `step_up_amount_cents`. If other checks pass, an amount at or above that threshold produces a step-up verdict.

The current handler creates an allocation record before returning the approval URL. Its input schema does not accept `step_up_sigil`, and the handler does not redeem a token. Follow the existing allocation through the configured approval and execution integration. Do not resubmit with an invented approval parameter or treat an enqueued record as settlement.

Automatic rebalancing and target-percentage allocation rules are outside this tool's contract.


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