# LensCrypt DeFi Yield Rebalance Advisor

> LensCrypt DeFi Yield Rebalance Advisor is a paid API for AI agents from lenscrypt.vercel.app, paid per call via x402, $0.15/call, status unknown (last checked 2026-09-15).

Returns rebalancing recommendations for DeFi yield positions given a protocol and APY target

## Facts

- Endpoint: GET https://lenscrypt.vercel.app/api/yields/rebalance
- Price: $0.15/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/lenscrypt-defi-yield-rebalance-advisor-d356009e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_T7T3tyh0gmS6MZD4U2iu8

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 lenscrypt-defi-yield-rebalance-advisor-d356009e
```

Example prompt: Check LensCrypt's yield rebalance endpoint for Aave with a target APY of 8% and tell me if I should move my positions to a higher-yielding protocol.

## When to prefer this

Use this endpoint when an agent needs actionable rebalancing advice for a specific DeFi protocol and APY threshold, rather than just raw yield data. It is ideal for portfolio optimization workflows where the user wants to know if they should move liquidity.

## Known failure modes

- Missing required query params 'protocol' or 'apy' returns 400 error
- Invalid or unsupported protocol name returns empty or error response
- Payment not fulfilled via x402 returns 402 Payment Required
- Protocol data temporarily unavailable returns 503 or empty payload
- APY value in wrong format may return validation error

## How this service works

81 paid REST endpoints covering wallet analytics, DeFi yields, token safety, smart money tracking, whale alerts, sniper detection, GMX perps, Solana tools, protocol stats, gas tracking, DEX quotes, NFT analytics, social signals, and 8 AI-powered endpoints (MiMo V2.5). Pay USDC via x402 protocol on Base.

## Output

Returns analysis and recommendations on whether to rebalance DeFi yield positions, comparing current protocol yields against the specified APY target, including suggested moves or optimal protocols.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "apy": "8.5",
   "protocol": "aave"
  }
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "protocol",
      "apy"
     ],
     "properties": {
      "apy": {
       "type": "string"
      },
      "protocol": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "current",
  "timestamp",
  "alternatives",
  "recommendation"
 ],
 "properties": {
  "current": {
   "type": "object",
   "required": [
    "apy",
    "protocol"
   ],
   "properties": {
    "apy": {
     "type": "number"
    },
    "protocol": {
     "type": "string"
    }
   }
  },
  "timestamp": {
   "type": "string"
  },
  "alternatives": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "IL",
     "apy",
     "name",
     "pool",
     "asset",
     "chain",
     "tvlUsd",
     "apyBase",
     "exposure",
     "protocol",
     "apyReward",
     "stablecoin"
    ],
    "properties": {
     "IL": {
      "type": "string"
     },
     "apy": {
      "type": "number"
     },
     "name": {
      "type": "string"
     },
     "pool": {
      "type": "string"
     },
     "asset": {
      "type": "string"
     },
     "chain": {
      "type": "string"
     },
     "tvlUsd": {
      "type": "number"
     },
     "apyBase": {
      "type": "number"
     },
     "exposure": {
      "type": "string"
     },
     "protocol": {
      "type": "string"
     },
     "apyReward": {
      "type": "null"
     },
     "stablecoin": {
      "type": "boolean"
     }
    }
   }
  },
  "recommendation": {
   "type": "object",
   "required": [
    "risk",
    "action",
    "target",
    "improvement"
   ],
   "properties": {
    "risk": {
     "type": "string"
    },
    "action": {
     "type": "string"
    },
    "target": {
     "type": "object",
     "required": [
      "IL",
      "apy",
      "name",
      "pool",
      "asset",
      "chain",
      "tvlUsd",
      "apyBase",
      "exposure",
      "protocol",
      "apyReward",
      "stablecoin"
     ],
     "properties": {
      "IL": {
       "type": "string"
      },
      "apy": {
       "type": "number"
      },
      "name": {
       "type": "string"
      },
      "pool": {
       "type": "string"
      },
      "asset": {
       "type": "string"
      },
      "chain": {
       "type": "string"
      },
      "tvlUsd": {
       "type": "number"
      },
      "apyBase": {
       "type": "number"
      },
      "exposure": {
       "type": "string"
      },
      "protocol": {
       "type": "string"
      },
      "apyReward": {
       "type": "null"
      },
      "stablecoin": {
       "type": "boolean"
      }
     }
    },
    "improvement": {
     "type": "string"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/lenscrypt-defi-yield-rebalance-advisor-d356009e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from lenscrypt.vercel.app](https://www.zero.xyz/host/lenscrypt.vercel.app/llms.txt)
