Back to skills
SkillHub ClubShip Full StackFull Stack
indigo-cdp
Manage Collateralized Debt Positions (CDPs) on the Indigo Protocol.
Packaged view
This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.
Stars
3,072
Hot score
99
Updated
March 19, 2026
Overall rating
C4.0
Composite score
4.0
Best-practice grade
C65.6
Install command
npx @skill-hub/cli install openclaw-skills-indigo-cdp
Repository
openclaw/skills
Skill path: skills/adacapo21/indigo-cdp
Manage Collateralized Debt Positions (CDPs) on the Indigo Protocol.
Open repositoryBest for
Primary workflow: Ship Full Stack.
Technical facets: Full Stack.
Target audience: everyone.
License: MIT.
Original source
Catalog source: SkillHub Club.
Repository owner: openclaw.
This is still a mirrored public skill entry. Review the repository before installing into production workflows.
What it helps with
- Install indigo-cdp into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
- Review https://github.com/openclaw/skills before adding indigo-cdp to shared team environments
- Use indigo-cdp for development workflows
Works across
Claude CodeCodex CLIGemini CLIOpenCode
Favorites: 0.
Sub-skills: 0.
Aggregator: No.
Original source / Raw SKILL.md
---
name: indigo-cdp
description: "Manage Collateralized Debt Positions (CDPs) on the Indigo Protocol."
allowed-tools: Read, Glob, Grep
license: MIT
metadata:
author: indigoprotocol
version: '0.1.0'
---
# Indigo CDP & Loan Management
Manage Collateralized Debt Positions (CDPs) on the Indigo Protocol.
## Prerequisites
- `@indigoprotocol/indigo-mcp` server running
## MCP Tools
- `open_cdp` — Open a new CDP
- `deposit_cdp` — Deposit collateral into a CDP
- `withdraw_cdp` — Withdraw collateral from a CDP
- `close_cdp` — Close a CDP and reclaim collateral
- `mint_cdp` — Mint iAssets against a CDP
- `burn_cdp` — Burn iAssets to reduce CDP debt
- `analyze_cdp_health` — Check CDP health and liquidation risk
- `liquidate_cdp` — Liquidate an unhealthy CDP
- `redeem_cdp` — Redeem iAssets against a CDP
- `freeze_cdp` — Freeze a CDP
- `merge_cdps` — Merge multiple CDPs into one
- `leverage_cdp` — Open a leveraged CDP position via ROB
- `get_all_cdps` — List all CDPs
- `get_cdps_by_owner` — List CDPs by owner
- `get_cdps_by_address` — List CDPs by address
## Sub-skills
- [CDP Basics](sub-skills/cdp-basics.md) — Open, deposit, withdraw, close
- [Mint & Burn](sub-skills/cdp-mint-burn.md) — Mint and burn iAssets
- [CDP Health](sub-skills/cdp-health.md) — Analyze health, liquidation risk
- [Liquidation](sub-skills/cdp-liquidation.md) — Liquidate, redeem, freeze, merge
- [Leverage](sub-skills/cdp-leverage.md) — Leveraged CDP via ROB
## References
- [MCP Tools Reference](references/mcp-tools.md) — Detailed tool parameters and return types
- [CDP Concepts](references/concepts.md) — Collateral ratios, liquidation, iAssets, and more
---
## Referenced Files
> The following files are referenced in this skill and included for context.
### sub-skills/cdp-basics.md
```markdown
# CDP Basics
Open, manage, and close Collateralized Debt Positions on Indigo.
## Tools
### open_cdp
Open a new CDP with collateral.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `address` | `string` | Yes | User Cardano bech32 address |
| `asset` | `"iUSD" \| "iBTC" \| "iETH" \| "iSOL"` | Yes | iAsset to mint |
| `collateralAmount` | `string` | Yes | ADA collateral in lovelace |
### deposit_cdp
Add collateral to an existing CDP to improve health ratio.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `address` | `string` | Yes | User Cardano bech32 address |
| `cdpTxHash` | `string` | Yes | Transaction hash of the CDP UTxO |
| `cdpOutputIndex` | `number` | Yes | Output index of the CDP UTxO |
| `collateralAmount` | `string` | Yes | Additional ADA in lovelace |
### withdraw_cdp
Remove excess collateral from a CDP.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `address` | `string` | Yes | User Cardano bech32 address |
| `cdpTxHash` | `string` | Yes | Transaction hash of the CDP UTxO |
| `cdpOutputIndex` | `number` | Yes | Output index of the CDP UTxO |
| `collateralAmount` | `string` | Yes | ADA to withdraw in lovelace |
### close_cdp
Close a CDP entirely, burning all debt and reclaiming collateral.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `address` | `string` | Yes | User Cardano bech32 address |
| `cdpTxHash` | `string` | Yes | Transaction hash of the CDP UTxO |
| `cdpOutputIndex` | `number` | Yes | Output index of the CDP UTxO |
## Examples
### Open a new iUSD CDP
Create a CDP by depositing ADA collateral to mint iUSD.
**Prompt:** "Open a CDP with 5000 ADA to mint iUSD"
**Workflow:**
1. Call `open_cdp({ address: "addr1qx...abc", asset: "iUSD", collateralAmount: "5000000000" })`
2. Returns unsigned transaction CBOR for signing
3. User signs and submits to create the CDP on-chain
**Sample response:**
```
CDP opened successfully.
Collateral: 5,000 ADA
Asset: iUSD
Transaction ready for signing.
```
### Deposit additional collateral
Add more ADA to an existing CDP to improve its health ratio and reduce liquidation risk.
**Prompt:** "Add 1000 ADA to my iUSD CDP"
**Workflow:**
1. Call `get_cdps_by_owner({ owners: ["addr1qx...abc"] })` to find the CDP
2. Call `deposit_cdp({ address: "addr1qx...abc", cdpTxHash: "abc123...def", cdpOutputIndex: 0, collateralAmount: "1000000000" })`
3. Returns unsigned transaction CBOR for signing
**Sample response:**
```
Deposit ready.
CDP: abc123...def
Additional collateral: 1,000 ADA
New total collateral: 6,000 ADA
```
### Close a CDP and reclaim collateral
Close a fully repaid CDP to get back all deposited ADA.
**Prompt:** "Close my iUSD CDP and return my collateral"
**Workflow:**
1. Call `get_cdps_by_owner({ owners: ["addr1qx...abc"] })` to find the CDP
2. Verify the CDP debt is zero or user has enough iAssets to burn
3. Call `close_cdp({ address: "addr1qx...abc", cdpTxHash: "abc123...def", cdpOutputIndex: 0 })`
4. Returns unsigned transaction — burns remaining debt and returns all collateral
**Sample response:**
```
CDP closed.
Returned: 5,000 ADA
Burned debt: 0 iUSD
```
## Example Prompts
- "Open a new CDP with 10,000 ADA for iBTC"
- "Deposit more collateral into my CDP"
- "Withdraw 500 ADA from my iUSD CDP"
- "Close my CDP and get my ADA back"
```
### sub-skills/cdp-mint-burn.md
```markdown
# CDP Mint & Burn
Mint synthetic assets (iAssets) against CDPs and burn them to reduce debt.
## Tools
### mint_cdp
Mint iAssets (iUSD, iBTC, iETH, iSOL) against CDP collateral. Increases debt ratio.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `address` | `string` | Yes | User Cardano bech32 address |
| `cdpTxHash` | `string` | Yes | Transaction hash of the CDP UTxO |
| `cdpOutputIndex` | `number` | Yes | Output index of the CDP UTxO |
| `amount` | `string` | Yes | Amount of iAssets to mint (in smallest unit) |
### burn_cdp
Burn iAssets to reduce or eliminate CDP debt. Improves health ratio.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `address` | `string` | Yes | User Cardano bech32 address |
| `cdpTxHash` | `string` | Yes | Transaction hash of the CDP UTxO |
| `cdpOutputIndex` | `number` | Yes | Output index of the CDP UTxO |
| `amount` | `string` | Yes | Amount of iAssets to burn (in smallest unit) |
## Examples
### Mint iUSD against an existing CDP
Mint additional iUSD from a CDP that has excess collateral headroom.
**Prompt:** "Mint 500 iUSD from my CDP"
**Workflow:**
1. Call `get_cdps_by_owner({ owners: ["addr1qx...abc"] })` to find the CDP
2. Call `analyze_cdp_health` to verify the CDP can safely support more debt
3. Call `mint_cdp({ address: "addr1qx...abc", cdpTxHash: "abc123...def", cdpOutputIndex: 0, amount: "500000000" })`
4. Returns unsigned transaction CBOR for signing
**Sample response:**
```
Mint ready.
Amount: 500 iUSD
New debt: 1,500 iUSD
New collateral ratio: 200%
Transaction ready for signing.
```
### Burn iAssets to improve CDP health
Reduce CDP debt by burning iAssets, improving the collateral ratio.
**Prompt:** "Burn 200 iUSD to improve my CDP health"
**Workflow:**
1. Call `get_cdps_by_owner({ owners: ["addr1qx...abc"] })` to find the CDP
2. Call `burn_cdp({ address: "addr1qx...abc", cdpTxHash: "abc123...def", cdpOutputIndex: 0, amount: "200000000" })`
3. Returns unsigned transaction — iUSD is burned from user wallet, debt reduced
**Sample response:**
```
Burn ready.
Burning: 200 iUSD
Remaining debt: 1,300 iUSD
New collateral ratio: 231%
```
### Fully repay CDP debt
Burn all remaining iAsset debt to fully repay a CDP before closing it.
**Prompt:** "Repay all my iUSD debt"
**Workflow:**
1. Call `get_cdps_by_owner({ owners: ["addr1qx...abc"] })` to find CDP and check debt amount
2. Call `burn_cdp` with the full debt amount
3. After signing, the CDP has zero debt and can be closed with `close_cdp`
**Sample response:**
```
Full repayment ready.
Burning: 1,500 iUSD (entire debt)
Remaining debt: 0 iUSD
CDP is now debt-free and can be closed.
```
## Example Prompts
- "Mint 1000 iUSD from my CDP"
- "How much more iBTC can I mint without risking liquidation?"
- "Burn 100 iUSD to reduce my CDP debt"
- "Repay all debt on my CDP"
```
### sub-skills/cdp-health.md
```markdown
# CDP Health Analysis
Monitor CDP health and liquidation risk.
## Tools
### analyze_cdp_health
Analyze a CDP's collateral ratio, liquidation price, and overall health status. Returns risk level and recommended actions.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `cdpTxHash` | `string` | Yes | Transaction hash of the CDP UTxO |
| `cdpOutputIndex` | `number` | Yes | Output index of the CDP UTxO |
**Returns:** Health analysis with collateral ratio, liquidation price, risk level (healthy/warning/danger), and suggested actions.
### get_all_cdps
List all CDPs in the protocol.
**Parameters:** None
**Returns:** Array of all CDP objects with owner, collateral, minted amount, and ratio.
### get_cdps_by_owner
List CDPs by owner address.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `owners` | `string[]` | Yes | Array of owner addresses |
### get_cdps_by_address
List CDPs by specific UTxO address.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `address` | `string` | Yes | CDP UTxO address |
## Examples
### Check CDP health before a market move
Analyze your CDP's health ratio to see how close you are to liquidation.
**Prompt:** "How healthy is my iUSD CDP?"
**Workflow:**
1. Call `get_cdps_by_owner({ owners: ["addr1qx...abc"] })` to find user's CDPs
2. Call `analyze_cdp_health({ cdpTxHash: "abc123...def", cdpOutputIndex: 0 })` on the iUSD CDP
3. Present the health status, collateral ratio, and liquidation price
**Sample response:**
```
CDP #42 Health Analysis
Status: Healthy
Collateral Ratio: 285%
Min Required: 150%
Liquidation Price: $0.2105 ADA/USD
Current ADA Price: $0.4500
Buffer: 53% above liquidation
```
### Monitor all CDPs for a wallet
View all CDPs owned by a wallet to get a portfolio-level health overview.
**Prompt:** "Show me all my CDPs and their health"
**Workflow:**
1. Call `get_cdps_by_owner({ owners: ["addr1qx...abc"] })` to list all CDPs
2. For each CDP, call `analyze_cdp_health` to get detailed health data
3. Present a summary table
**Sample response:**
```
Your CDPs:
CDP #42 (iUSD): 285% ratio — Healthy
CDP #78 (iBTC): 162% ratio — Warning
CDP #91 (iETH): 310% ratio — Healthy
Action needed: CDP #78 is approaching minimum ratio (150%).
Consider depositing more collateral.
```
### Check protocol-wide CDP stats
Review all CDPs across the protocol to gauge overall collateralization.
**Prompt:** "How many CDPs exist on Indigo?"
**Workflow:**
1. Call `get_all_cdps()` to retrieve every CDP
2. Aggregate totals by iAsset type
3. Calculate average collateral ratios per asset
**Sample response:**
```
Protocol CDPs: 4,231 total
iUSD: 2,890 CDPs — avg ratio 245%
iBTC: 612 CDPs — avg ratio 198%
iETH: 489 CDPs — avg ratio 267%
iSOL: 240 CDPs — avg ratio 223%
```
## Example Prompts
- "Analyze the health of my CDP"
- "Is my CDP at risk of liquidation?"
- "Show me all CDPs for my wallet"
- "What is the average collateral ratio across all iUSD CDPs?"
```
### sub-skills/cdp-liquidation.md
```markdown
# CDP Liquidation & Recovery
Handle CDP liquidation, redemption, freezing, and merging.
## Tools
### liquidate_cdp
Liquidate an undercollateralized CDP. Caller receives liquidation bonus.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `address` | `string` | Yes | Liquidator Cardano bech32 address |
| `cdpTxHash` | `string` | Yes | Transaction hash of the CDP UTxO |
| `cdpOutputIndex` | `number` | Yes | Output index of the CDP UTxO |
### redeem_cdp
Redeem iAssets against a CDP at oracle price.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `address` | `string` | Yes | User Cardano bech32 address |
| `cdpTxHash` | `string` | Yes | Transaction hash of the CDP UTxO |
| `cdpOutputIndex` | `number` | Yes | Output index of the CDP UTxO |
| `amount` | `string` | Yes | Amount of iAssets to redeem |
### freeze_cdp
Freeze a CDP to prevent further operations.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `address` | `string` | Yes | User Cardano bech32 address |
| `cdpTxHash` | `string` | Yes | Transaction hash of the CDP UTxO |
| `cdpOutputIndex` | `number` | Yes | Output index of the CDP UTxO |
### merge_cdps
Merge multiple CDPs of the same iAsset type into a single position.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `address` | `string` | Yes | User Cardano bech32 address |
| `cdpRefs` | `array` | Yes | Array of CDP UTxO references (txHash + outputIndex) |
## Examples
### Liquidate an undercollateralized CDP
Liquidate a CDP that has fallen below the minimum collateral ratio to earn the liquidation bonus.
**Prompt:** "Liquidate CDP abc123...def"
**Workflow:**
1. Call `analyze_cdp_health({ cdpTxHash: "abc123...def", cdpOutputIndex: 0 })` to confirm it is liquidatable
2. Call `liquidate_cdp({ address: "addr1qx...liq", cdpTxHash: "abc123...def", cdpOutputIndex: 0 })`
3. Returns unsigned transaction — liquidator provides iAssets to cover debt, receives collateral + bonus
**Sample response:**
```
Liquidation ready.
CDP: abc123...def
Debt covered: 1,000 iUSD
Collateral received: 2,500 ADA (includes 10% bonus)
Transaction ready for signing.
```
### Merge multiple CDPs
Combine several CDPs of the same iAsset type into one for easier management.
**Prompt:** "Merge my three iUSD CDPs into one"
**Workflow:**
1. Call `get_cdps_by_owner({ owners: ["addr1qx...abc"] })` to list all iUSD CDPs
2. Call `merge_cdps({ address: "addr1qx...abc", cdpRefs: [{ txHash: "aaa...", outputIndex: 0 }, { txHash: "bbb...", outputIndex: 0 }, { txHash: "ccc...", outputIndex: 0 }] })`
3. Returns unsigned transaction — merges collateral and debt into a single CDP
**Sample response:**
```
Merge ready.
Merging 3 iUSD CDPs:
CDP #42: 2,000 ADA / 500 iUSD
CDP #78: 3,000 ADA / 800 iUSD
CDP #91: 1,500 ADA / 300 iUSD
Result: 6,500 ADA / 1,600 iUSD (ratio: 203%)
```
### Freeze a CDP
Freeze a CDP to temporarily prevent any operations on it.
**Prompt:** "Freeze my iBTC CDP"
**Workflow:**
1. Call `get_cdps_by_owner({ owners: ["addr1qx...abc"] })` to find the iBTC CDP
2. Call `freeze_cdp({ address: "addr1qx...abc", cdpTxHash: "abc123...def", cdpOutputIndex: 0 })`
3. Returns unsigned transaction — once submitted, the CDP cannot be modified until unfrozen
**Sample response:**
```
Freeze ready.
CDP: abc123...def (iBTC)
Status will change to: Frozen
No further operations will be possible until unfrozen.
```
## Example Prompts
- "Find liquidatable CDPs for iUSD"
- "Liquidate the most undercollateralized CDP"
- "Merge all my iUSD CDPs"
- "Freeze my CDP to protect it"
- "Redeem 500 iUSD against a CDP"
```
### sub-skills/cdp-leverage.md
```markdown
# Leveraged CDP
Open leveraged CDP positions using Redemption Order Book (ROB).
## Tools
### leverage_cdp
Open a leveraged CDP position. Uses ROB mechanism to amplify exposure to an iAsset with a single transaction.
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `address` | `string` | Yes | User Cardano bech32 address |
| `asset` | `"iUSD" \| "iBTC" \| "iETH" \| "iSOL"` | Yes | Target iAsset |
| `collateralAmount` | `string` | Yes | Initial ADA collateral in lovelace |
| `leverageMultiplier` | `number` | Yes | Leverage multiplier (e.g. 2 for 2x) |
## Examples
### Open a 2x leveraged iUSD position
Use leverage to amplify exposure to iUSD with a single transaction instead of manually looping mint-sell-deposit.
**Prompt:** "Open a 2x leveraged CDP for iUSD with 5000 ADA"
**Workflow:**
1. Call `leverage_cdp({ address: "addr1qx...abc", asset: "iUSD", collateralAmount: "5000000000", leverageMultiplier: 2 })`
2. The protocol uses ROB to: open CDP → mint iUSD → sell for ADA → deposit back as collateral → repeat
3. Returns unsigned transaction for signing
**Sample response:**
```
Leveraged CDP ready.
Initial collateral: 5,000 ADA
Effective exposure: ~10,000 ADA worth of iUSD
Leverage: 2x
Collateral ratio: ~200%
Transaction ready for signing.
```
### Open a conservative leveraged position
Use a lower multiplier for reduced risk while still amplifying returns.
**Prompt:** "Open a 1.5x leveraged iBTC position with 10,000 ADA"
**Workflow:**
1. Call `leverage_cdp({ address: "addr1qx...abc", asset: "iBTC", collateralAmount: "10000000000", leverageMultiplier: 1.5 })`
2. Returns unsigned transaction — lower leverage means higher collateral ratio and less liquidation risk
**Sample response:**
```
Leveraged CDP ready.
Initial collateral: 10,000 ADA
Effective exposure: ~15,000 ADA worth of iBTC
Leverage: 1.5x
Collateral ratio: ~267%
Transaction ready for signing.
```
### Understand leverage risks
Check what leverage multiplier is safe given current market conditions.
**Prompt:** "What leverage can I safely use for iETH?"
**Workflow:**
1. Call `get_asset_price({ asset: "iETH" })` to get current price and volatility context
2. Call `get_protocol_params()` to check minimum collateral ratios for iETH
3. Calculate safe leverage based on min ratio: safe_multiplier = min_ratio / (min_ratio - 100%)
4. Present recommendation with risk levels
**Sample response:**
```
iETH Leverage Analysis:
Min collateral ratio: 150%
Max theoretical leverage: 3x
Recommended safe leverage: 2x (200% ratio)
Conservative: 1.5x (267% ratio)
Higher leverage = higher liquidation risk.
At 3x, a 17% ADA price drop triggers liquidation.
```
## Example Prompts
- "Open a leveraged CDP for iUSD"
- "What's the maximum leverage I can use?"
- "Create a 2x leveraged iBTC position"
- "How risky is 3x leverage on iETH?"
```
### references/mcp-tools.md
```markdown
# CDP MCP Tools Reference
Detailed reference for all CDP-related MCP tools in the Indigo Protocol.
## Write Operations
All write operations return an unsigned transaction (CBOR hex) for client-side signing and submission.
### open_cdp
Open a new Collateralized Debt Position.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `address` | `string` | Yes | User Cardano bech32 address |
| `asset` | `"iUSD" \| "iBTC" \| "iETH" \| "iSOL"` | Yes | iAsset to mint |
| `collateralAmount` | `string` | Yes | ADA collateral in lovelace (1 ADA = 1,000,000 lovelace) |
**Returns:** `{ tx: string }` — unsigned CBOR transaction hex
---
### deposit_cdp
Deposit additional ADA collateral into an existing CDP.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `address` | `string` | Yes | User Cardano bech32 address |
| `cdpTxHash` | `string` | Yes | Transaction hash of the CDP UTxO |
| `cdpOutputIndex` | `number` | Yes | Output index of the CDP UTxO |
| `collateralAmount` | `string` | Yes | Additional ADA in lovelace |
**Returns:** `{ tx: string }`
---
### withdraw_cdp
Withdraw excess collateral from a CDP. Ratio must stay above minimum.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `address` | `string` | Yes | User Cardano bech32 address |
| `cdpTxHash` | `string` | Yes | Transaction hash of the CDP UTxO |
| `cdpOutputIndex` | `number` | Yes | Output index of the CDP UTxO |
| `collateralAmount` | `string` | Yes | ADA to withdraw in lovelace |
**Returns:** `{ tx: string }`
---
### close_cdp
Close a CDP, burning all remaining debt and returning collateral.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `address` | `string` | Yes | User Cardano bech32 address |
| `cdpTxHash` | `string` | Yes | Transaction hash of the CDP UTxO |
| `cdpOutputIndex` | `number` | Yes | Output index of the CDP UTxO |
**Returns:** `{ tx: string }`
---
### mint_cdp
Mint iAssets against CDP collateral, increasing debt.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `address` | `string` | Yes | User Cardano bech32 address |
| `cdpTxHash` | `string` | Yes | Transaction hash of the CDP UTxO |
| `cdpOutputIndex` | `number` | Yes | Output index of the CDP UTxO |
| `amount` | `string` | Yes | Amount of iAssets to mint (smallest unit) |
**Returns:** `{ tx: string }`
---
### burn_cdp
Burn iAssets to reduce CDP debt.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `address` | `string` | Yes | User Cardano bech32 address |
| `cdpTxHash` | `string` | Yes | Transaction hash of the CDP UTxO |
| `cdpOutputIndex` | `number` | Yes | Output index of the CDP UTxO |
| `amount` | `string` | Yes | Amount of iAssets to burn (smallest unit) |
**Returns:** `{ tx: string }`
---
### liquidate_cdp
Liquidate an undercollateralized CDP. Caller pays debt, receives collateral + bonus.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `address` | `string` | Yes | Liquidator Cardano bech32 address |
| `cdpTxHash` | `string` | Yes | Transaction hash of the CDP UTxO |
| `cdpOutputIndex` | `number` | Yes | Output index of the CDP UTxO |
**Returns:** `{ tx: string }`
---
### redeem_cdp
Redeem iAssets against a CDP at oracle price.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `address` | `string` | Yes | User Cardano bech32 address |
| `cdpTxHash` | `string` | Yes | Transaction hash of the CDP UTxO |
| `cdpOutputIndex` | `number` | Yes | Output index of the CDP UTxO |
| `amount` | `string` | Yes | Amount of iAssets to redeem |
**Returns:** `{ tx: string }`
---
### freeze_cdp
Freeze a CDP to prevent further operations.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `address` | `string` | Yes | User Cardano bech32 address |
| `cdpTxHash` | `string` | Yes | Transaction hash of the CDP UTxO |
| `cdpOutputIndex` | `number` | Yes | Output index of the CDP UTxO |
**Returns:** `{ tx: string }`
---
### merge_cdps
Merge multiple CDPs of the same iAsset into one.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `address` | `string` | Yes | User Cardano bech32 address |
| `cdpRefs` | `array` | Yes | Array of `{ txHash: string, outputIndex: number }` |
**Returns:** `{ tx: string }`
---
### leverage_cdp
Open a leveraged CDP via ROB mechanism.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `address` | `string` | Yes | User Cardano bech32 address |
| `asset` | `"iUSD" \| "iBTC" \| "iETH" \| "iSOL"` | Yes | Target iAsset |
| `collateralAmount` | `string` | Yes | Initial ADA collateral in lovelace |
| `leverageMultiplier` | `number` | Yes | Leverage multiplier |
**Returns:** `{ tx: string }`
## Read Operations
### get_all_cdps
List all CDPs in the protocol.
**Parameters:** None
**Returns:** `CDP[]` — array of CDP objects
---
### get_cdps_by_owner
List CDPs filtered by owner address.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `owners` | `string[]` | Yes | Array of owner bech32 addresses |
**Returns:** `CDP[]`
---
### get_cdps_by_address
List CDPs by UTxO address.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `address` | `string` | Yes | CDP UTxO address |
**Returns:** `CDP[]`
---
### analyze_cdp_health
Analyze CDP health, liquidation risk, and collateral ratio.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `cdpTxHash` | `string` | Yes | Transaction hash of the CDP UTxO |
| `cdpOutputIndex` | `number` | Yes | Output index of the CDP UTxO |
**Returns:** Health analysis with ratio, liquidation price, risk level, and recommended actions.
```
### references/concepts.md
```markdown
# CDP Concepts
Key concepts for understanding Collateralized Debt Positions on the Indigo Protocol.
## What is a CDP?
A Collateralized Debt Position (CDP) is a smart contract that holds ADA as collateral and allows users to mint synthetic assets (iAssets) against it. The minted iAssets represent debt that must be repaid to reclaim the collateral.
## Collateral Ratio
The collateral ratio is the value of ADA collateral divided by the value of minted iAssets:
```
Collateral Ratio = (Collateral ADA × ADA Price) / (Minted iAssets × iAsset Price) × 100%
```
Each iAsset has a **minimum collateral ratio** (typically 150%). If the ratio falls below this threshold, the CDP becomes eligible for liquidation.
## iAssets
Indigo supports four synthetic assets:
| iAsset | Tracks | Decimals |
|--------|--------|----------|
| iUSD | US Dollar | 6 |
| iBTC | Bitcoin | 8 |
| iETH | Ethereum | 18 |
| iSOL | Solana | 9 |
iAssets are minted by opening a CDP and can be traded on Cardano DEXs (SteelSwap, Minswap, etc.) or used in stability pools.
## Health Status Levels
| Status | Meaning | Action |
|--------|---------|--------|
| Healthy | Ratio well above minimum | No action needed |
| Warning | Ratio approaching minimum (within 20%) | Consider depositing more collateral or burning debt |
| Danger | Ratio at or below minimum | Immediate action required — deposit, burn, or face liquidation |
## Liquidation
When a CDP's collateral ratio falls below the minimum:
1. **Anyone** can call `liquidate_cdp` on the undercollateralized CDP
2. The liquidator provides iAssets to cover the CDP's debt
3. The liquidator receives the CDP's collateral **plus a liquidation bonus** (typically 10%)
4. The original CDP owner loses their collateral
## Redemption
Redemption allows iAsset holders to exchange iAssets for ADA collateral at the oracle price, regardless of market price. This helps maintain the iAsset peg.
## Freezing
Freezing a CDP prevents all operations (minting, burning, depositing, withdrawing) until it is unfrozen. This is used as a protective mechanism.
## Merging
CDP owners can merge multiple CDPs of the **same iAsset type** into a single CDP. This combines the collateral and debt of all merged CDPs, simplifying management.
## Leverage
Leveraged CDPs use the ROB (Redemption Order Book) mechanism to amplify exposure:
1. Deposit ADA collateral
2. Mint iAssets against the collateral
3. Sell iAssets for more ADA via DEX
4. Deposit the new ADA as additional collateral
5. Repeat until desired leverage is reached
The `leverage_cdp` tool automates this loop in a single transaction.
## Transaction Signing
All write operations return an **unsigned transaction** in CBOR hex format. The user must:
1. Sign the transaction with their Cardano wallet
2. Submit the signed transaction to the Cardano network
3. Wait for confirmation (typically 1-2 blocks, ~20-40 seconds)
```
---
## Skill Companion Files
> Additional files collected from the skill directory layout.
### _meta.json
```json
{
"owner": "adacapo21",
"slug": "indigo-cdp",
"displayName": "Indigo Loan",
"latest": {
"version": "1.0.0",
"publishedAt": 1773187303965,
"commit": "https://github.com/openclaw/skills/commit/539911329069ffabd93bca436599239854e512fb"
},
"history": []
}
```