{
  "schemaVersion": "1.0",
  "item": {
    "slug": "agent-credit",
    "name": "Agent Credit",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/aaronjmars/agent-credit",
    "canonicalUrl": "https://clawhub.ai/aaronjmars/agent-credit",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/agent-credit",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=agent-credit",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "deployments.md",
      "contracts.md",
      "aave-repay.sh",
      "safety.md",
      "README.md",
      "config.example.json"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/agent-credit"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/agent-credit",
    "agentPageUrl": "https://openagent3.xyz/skills/agent-credit/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agent-credit/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agent-credit/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Aave Credit Delegation",
        "body": "Borrow funds from Aave using delegated credit. Your main wallet supplies collateral and delegates borrowing power to the agent's wallet. The agent can then autonomously borrow tokens when needed — the debt accrues against the delegator's position.\n\nProtocol: Works on Aave V3 and Aave V2 — the function signatures for credit delegation (borrow, repay, approveDelegation, borrowAllowance) are identical across both versions. Just swap in the V2 LendingPool and ProtocolDataProvider addresses. The only cosmetic difference: V3 returns collateral/debt in USD (8 decimals), V2 in ETH (18 decimals). The health factor safety check works correctly on both."
      },
      {
        "title": "Compatible With",
        "body": "OpenClaw — Install as a skill, the agent borrows autonomously\nClaude Code — Run scripts directly from a Claude Code session\nAny agent framework — Plain bash + Foundry's cast, works anywhere with a shell\n\nCombines with Bankr skills for borrow-then-swap flows: borrow USDC via delegation, then use Bankr to swap, bridge, or deploy it."
      },
      {
        "title": "How Credit Delegation Works",
        "body": "Credit delegation in Aave V3 separates two things: borrowing power and delegation approval.\n\nBorrowing power is holistic. It comes from your entire collateral position across all assets. If you deposit $10k worth of ETH at 80% LTV, you have $8k of borrowing power — period. That borrowing power isn't locked to any specific asset.\n\nDelegation approval is isolated per debt token. You control which assets the agent can borrow and how much of each by calling approveDelegation() on individual VariableDebtTokens. Each asset has its own debt token contract, and each approval is independent.\n\nThis means you can, for example:\n\nDeposit ETH as collateral (gives you broad borrowing power)\nApprove the agent to borrow up to 500 USDC (via the USDC VariableDebtToken)\nApprove the agent to borrow up to 0.1 WETH (via the WETH VariableDebtToken)\nLeave cbETH unapproved (agent cannot borrow it at all)\n\nThe agent can only borrow assets you've explicitly approved, up to the amounts you've set — but the capacity to borrow comes from your total collateral, not from any single deposit.\n\nYour Collateral (holistic)              Delegation Approvals (isolated)\n┌─────────────────────────┐             ┌──────────────────────────────┐\n│  $5k ETH                │             │  USDC DebtToken → agent: 500 │\n│  $3k USDC               │  ───LTV───▶ │  WETH DebtToken → agent: 0.1 │\n│  $2k cbETH              │   = $8k     │  cbETH DebtToken → agent: 0  │\n│  Total: $10k @ 80% LTV  │  capacity   └──────────────────────────────┘\n└─────────────────────────┘"
      },
      {
        "title": "Flow",
        "body": "Delegator (your wallet)                 Agent Wallet (delegatee)\n    │                                        │\n    │  1. supply collateral to Aave          │\n    │  2. approveDelegation(agent, amount)   │\n    │        on the VariableDebtToken        │\n    │                                        │\n    │            ┌─── 3. borrow(asset,       │\n    │            │       amount, onBehalfOf   │\n    │            │       = delegator)         │\n    │            │                            │\n    │     [debt on YOUR position]    [tokens in agent wallet]\n    │            │                            │\n    │            └─── 4. repay(asset,         │\n    │                    amount, onBehalfOf   │\n    │                    = delegator)         │"
      },
      {
        "title": "Prerequisites",
        "body": "Foundry must be installed (cast CLI):\ncurl -L https://foundry.paradigm.xyz | bash && foundryup\n\n\n\nDelegator setup (done ONCE by the user, NOT the agent):\n\nSupply collateral to Aave V3 (via app.aave.com or contract)\nCall approveDelegation(agentAddress, maxAmount) on the VariableDebtToken of the asset you want the agent to borrow\nThe VariableDebtToken address can be found via: cast call $DATA_PROVIDER \"getReserveTokensAddresses(address)(address,address,address)\" $ASSET --rpc-url $RPC\n\n\n\nConfigure the skill:\nmkdir -p ~/.openclaw/skills/aave-delegation\ncat > ~/.openclaw/skills/aave-delegation/config.json << 'EOF'\n{\n  \"chain\": \"base\",\n  \"rpcUrl\": \"https://mainnet.base.org\",\n  \"agentPrivateKey\": \"0xYOUR_AGENT_PRIVATE_KEY\",\n  \"delegatorAddress\": \"0xYOUR_MAIN_WALLET\",\n  \"poolAddress\": \"0xA238Dd80C259a72e81d7e4664a9801593F98d1c5\",\n  \"dataProviderAddress\": \"0x2d8A3C5677189723C4cB8873CfC9C8976FDF38Ac\",\n  \"assets\": {\n    \"USDC\": {\n      \"address\": \"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\",\n      \"decimals\": 6\n    },\n    \"WETH\": {\n      \"address\": \"0x4200000000000000000000000000000000000006\",\n      \"decimals\": 18\n    }\n  },\n  \"safety\": {\n    \"minHealthFactor\": \"1.5\",\n    \"maxBorrowPerTx\": \"1000\",\n    \"maxBorrowPerTxUnit\": \"USDC\"\n  }\n}\nEOF\n\n\n\nVerify setup:\nscripts/aave-setup.sh"
      },
      {
        "title": "Check Status (allowance, health, debt)",
        "body": "# Full status report\nscripts/aave-status.sh\n\n# Check specific asset delegation\nscripts/aave-status.sh USDC\n\n# Just health factor\nscripts/aave-status.sh --health-only"
      },
      {
        "title": "Borrow via Delegation",
        "body": "# Borrow 100 USDC\nscripts/aave-borrow.sh USDC 100\n\n# Borrow 0.5 WETH\nscripts/aave-borrow.sh WETH 0.5\n\nThe borrow script automatically:\n\nChecks delegation allowance (sufficient?)\nChecks delegator health factor (safe to borrow?)\nExecutes the borrow\nReports the result"
      },
      {
        "title": "Repay Debt",
        "body": "# Repay 100 USDC\nscripts/aave-repay.sh USDC 100\n\n# Repay all USDC debt\nscripts/aave-repay.sh USDC max\n\nThe repay script automatically:\n\nApproves the Pool to spend the token (if needed)\nExecutes the repay\nReports remaining debt"
      },
      {
        "title": "Safety System",
        "body": "Every borrow operation runs these checks BEFORE executing:\n\nDelegation allowance — Is the remaining allowance >= requested amount?\nHealth factor — Is the delegator's health factor > minHealthFactor (default 1.5) AFTER this borrow?\nPer-tx cap — Is the amount <= maxBorrowPerTx?\nConfirmation — Logs the full operation details before sending\n\nIf ANY check fails, the borrow is aborted with a clear error message.\n\n⚠️ The agent must NEVER bypass safety checks. If the user asks the agent to borrow and the health factor is too low, the agent should refuse and explain why."
      },
      {
        "title": "Read Operations (no gas needed)",
        "body": "Check delegation allowance — How much can the agent still borrow?\nCheck health factor — Is the delegator's position safe?\nCheck outstanding debt — How much does the delegator owe on each asset?\nCheck available liquidity — Is there enough in the Aave pool to borrow?\nResolve debt token addresses — Look up VariableDebtToken for any asset"
      },
      {
        "title": "Write Operations (needs gas in agent wallet)",
        "body": "Borrow — Draw funds from Aave against delegated credit\nRepay — Return borrowed funds to reduce delegator's debt\nApprove — Approve Pool to spend tokens for repayment"
      },
      {
        "title": "Supported Chains",
        "body": "ChainPool AddressGas CostBase0xA238Dd80C259a72e81d7e4664a9801593F98d1c5Very LowEthereum0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2HighPolygon0x794a61358D6845594F94dc1DB02A252b5b4814aDVery LowArbitrum0x794a61358D6845594F94dc1DB02A252b5b4814aDLow\n\nSee deployments.md for full address list including debt tokens."
      },
      {
        "title": "Agent Self-Funding for Gas",
        "body": "# Check if we have enough gas\nBALANCE=$(cast balance $AGENT_ADDRESS --rpc-url $RPC)\nif [ \"$BALANCE\" -lt \"1000000000000000\" ]; then  # < 0.001 ETH\n  # Borrow a small amount of WETH for gas\n  aave-borrow.sh WETH 0.005\nfi"
      },
      {
        "title": "Borrow + Swap via Bankr",
        "body": "# Borrow USDC from delegated credit\naave-borrow.sh USDC 100\n# Swap to ETH using Bankr\nbankr.sh \"Swap 100 USDC for ETH on Base\""
      },
      {
        "title": "Periodic DCA",
        "body": "# Agent borrows USDC weekly and swaps to ETH\naave-borrow.sh USDC 100\nbankr.sh \"Swap 100 USDC for ETH on Base\""
      },
      {
        "title": "Safety-First Portfolio Rebalance",
        "body": "# Always check health first\naave-status.sh\n# Only borrow if healthy\naave-borrow.sh USDC 500"
      },
      {
        "title": "config.json Fields",
        "body": "FieldRequiredDescriptionchainYesChain name (base, ethereum, polygon, arbitrum)rpcUrlYesJSON-RPC endpoint URLagentPrivateKeyYesAgent wallet private key (0x-prefixed)delegatorAddressYesUser's main wallet that delegated creditpoolAddressYesAave V3 Pool contract addressdataProviderAddressYesAave V3 PoolDataProvider addressassetsYesMap of symbol → {address, decimals}safety.minHealthFactorNoMin HF after borrow (default: 1.5)safety.maxBorrowPerTxNoMax borrow per transaction (default: 1000)safety.maxBorrowPerTxUnitNoUnit for maxBorrowPerTx (default: USDC)"
      },
      {
        "title": "Environment Variables (override config)",
        "body": "VariableOverridesAAVE_RPC_URLrpcUrlAAVE_AGENT_PRIVATE_KEYagentPrivateKeyAAVE_DELEGATOR_ADDRESSdelegatorAddressAAVE_POOL_ADDRESSpoolAddressAAVE_MIN_HEALTH_FACTORsafety.minHealthFactor"
      },
      {
        "title": "Error Handling",
        "body": "ErrorCauseFixINSUFFICIENT_ALLOWANCEDelegation amount exceededDelegator must call approveDelegation() againHEALTH_FACTOR_TOO_LOWBorrow would risk liquidationReduce amount or add collateralAMOUNT_EXCEEDS_CAPPer-tx safety cap hitReduce amount or update configINSUFFICIENT_LIQUIDITYNot enough in Aave poolTry smaller amount or different assetINSUFFICIENT_GASAgent wallet has no native tokenSend gas to agent walletEMODE_MISMATCHAsset incompatible with delegator's eModeBorrow an asset in the same eMode category"
      },
      {
        "title": "Security",
        "body": "See safety.md for the full threat model and emergency procedures.\n\nCritical rules:\n\nThe delegator's private key must NEVER be in this repo, config, or scripts — this is the agent's workspace. The delegator manages their side via the Aave UI or a block explorer.\nNever commit config.json to version control — it contains the agent's private key\nNever set minHealthFactor below 1.2 — liquidation happens at 1.0\nAlways cap delegation amounts — never approve type(uint256).max\nMonitor delegator health — set up alerts if HF drops below 2.0\nAgent must refuse to borrow if safety checks fail, even if instructed to"
      },
      {
        "title": "Resources",
        "body": "Aave V3 Docs: https://docs.aave.com/developers\nCredit Delegation Guide: https://docs.aave.com/developers/guides/credit-delegation\nAave Address Book: https://github.com/bgd-labs/aave-address-book\nFoundry Book: https://book.getfoundry.sh/\nDebtToken Reference: https://docs.aave.com/developers/tokens/debttoken"
      }
    ],
    "body": "Aave Credit Delegation\n\nBorrow funds from Aave using delegated credit. Your main wallet supplies collateral and delegates borrowing power to the agent's wallet. The agent can then autonomously borrow tokens when needed — the debt accrues against the delegator's position.\n\nProtocol: Works on Aave V3 and Aave V2 — the function signatures for credit delegation (borrow, repay, approveDelegation, borrowAllowance) are identical across both versions. Just swap in the V2 LendingPool and ProtocolDataProvider addresses. The only cosmetic difference: V3 returns collateral/debt in USD (8 decimals), V2 in ETH (18 decimals). The health factor safety check works correctly on both.\n\nCompatible With\nOpenClaw — Install as a skill, the agent borrows autonomously\nClaude Code — Run scripts directly from a Claude Code session\nAny agent framework — Plain bash + Foundry's cast, works anywhere with a shell\n\nCombines with Bankr skills for borrow-then-swap flows: borrow USDC via delegation, then use Bankr to swap, bridge, or deploy it.\n\nHow Credit Delegation Works\n\nCredit delegation in Aave V3 separates two things: borrowing power and delegation approval.\n\nBorrowing power is holistic. It comes from your entire collateral position across all assets. If you deposit $10k worth of ETH at 80% LTV, you have $8k of borrowing power — period. That borrowing power isn't locked to any specific asset.\n\nDelegation approval is isolated per debt token. You control which assets the agent can borrow and how much of each by calling approveDelegation() on individual VariableDebtTokens. Each asset has its own debt token contract, and each approval is independent.\n\nThis means you can, for example:\n\nDeposit ETH as collateral (gives you broad borrowing power)\nApprove the agent to borrow up to 500 USDC (via the USDC VariableDebtToken)\nApprove the agent to borrow up to 0.1 WETH (via the WETH VariableDebtToken)\nLeave cbETH unapproved (agent cannot borrow it at all)\n\nThe agent can only borrow assets you've explicitly approved, up to the amounts you've set — but the capacity to borrow comes from your total collateral, not from any single deposit.\n\nYour Collateral (holistic)              Delegation Approvals (isolated)\n┌─────────────────────────┐             ┌──────────────────────────────┐\n│  $5k ETH                │             │  USDC DebtToken → agent: 500 │\n│  $3k USDC               │  ───LTV───▶ │  WETH DebtToken → agent: 0.1 │\n│  $2k cbETH              │   = $8k     │  cbETH DebtToken → agent: 0  │\n│  Total: $10k @ 80% LTV  │  capacity   └──────────────────────────────┘\n└─────────────────────────┘\n\nFlow\nDelegator (your wallet)                 Agent Wallet (delegatee)\n    │                                        │\n    │  1. supply collateral to Aave          │\n    │  2. approveDelegation(agent, amount)   │\n    │        on the VariableDebtToken        │\n    │                                        │\n    │            ┌─── 3. borrow(asset,       │\n    │            │       amount, onBehalfOf   │\n    │            │       = delegator)         │\n    │            │                            │\n    │     [debt on YOUR position]    [tokens in agent wallet]\n    │            │                            │\n    │            └─── 4. repay(asset,         │\n    │                    amount, onBehalfOf   │\n    │                    = delegator)         │\n\nQuick Start\nPrerequisites\n\nFoundry must be installed (cast CLI):\n\ncurl -L https://foundry.paradigm.xyz | bash && foundryup\n\n\nDelegator setup (done ONCE by the user, NOT the agent):\n\nSupply collateral to Aave V3 (via app.aave.com or contract)\nCall approveDelegation(agentAddress, maxAmount) on the VariableDebtToken of the asset you want the agent to borrow\nThe VariableDebtToken address can be found via: cast call $DATA_PROVIDER \"getReserveTokensAddresses(address)(address,address,address)\" $ASSET --rpc-url $RPC\n\nConfigure the skill:\n\nmkdir -p ~/.openclaw/skills/aave-delegation\ncat > ~/.openclaw/skills/aave-delegation/config.json << 'EOF'\n{\n  \"chain\": \"base\",\n  \"rpcUrl\": \"https://mainnet.base.org\",\n  \"agentPrivateKey\": \"0xYOUR_AGENT_PRIVATE_KEY\",\n  \"delegatorAddress\": \"0xYOUR_MAIN_WALLET\",\n  \"poolAddress\": \"0xA238Dd80C259a72e81d7e4664a9801593F98d1c5\",\n  \"dataProviderAddress\": \"0x2d8A3C5677189723C4cB8873CfC9C8976FDF38Ac\",\n  \"assets\": {\n    \"USDC\": {\n      \"address\": \"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\",\n      \"decimals\": 6\n    },\n    \"WETH\": {\n      \"address\": \"0x4200000000000000000000000000000000000006\",\n      \"decimals\": 18\n    }\n  },\n  \"safety\": {\n    \"minHealthFactor\": \"1.5\",\n    \"maxBorrowPerTx\": \"1000\",\n    \"maxBorrowPerTxUnit\": \"USDC\"\n  }\n}\nEOF\n\n\nVerify setup:\n\nscripts/aave-setup.sh\n\nCore Usage\nCheck Status (allowance, health, debt)\n# Full status report\nscripts/aave-status.sh\n\n# Check specific asset delegation\nscripts/aave-status.sh USDC\n\n# Just health factor\nscripts/aave-status.sh --health-only\n\nBorrow via Delegation\n# Borrow 100 USDC\nscripts/aave-borrow.sh USDC 100\n\n# Borrow 0.5 WETH\nscripts/aave-borrow.sh WETH 0.5\n\n\nThe borrow script automatically:\n\nChecks delegation allowance (sufficient?)\nChecks delegator health factor (safe to borrow?)\nExecutes the borrow\nReports the result\nRepay Debt\n# Repay 100 USDC\nscripts/aave-repay.sh USDC 100\n\n# Repay all USDC debt\nscripts/aave-repay.sh USDC max\n\n\nThe repay script automatically:\n\nApproves the Pool to spend the token (if needed)\nExecutes the repay\nReports remaining debt\nSafety System\n\nEvery borrow operation runs these checks BEFORE executing:\n\nDelegation allowance — Is the remaining allowance >= requested amount?\nHealth factor — Is the delegator's health factor > minHealthFactor (default 1.5) AFTER this borrow?\nPer-tx cap — Is the amount <= maxBorrowPerTx?\nConfirmation — Logs the full operation details before sending\n\nIf ANY check fails, the borrow is aborted with a clear error message.\n\n⚠️ The agent must NEVER bypass safety checks. If the user asks the agent to borrow and the health factor is too low, the agent should refuse and explain why.\n\nCapabilities\nRead Operations (no gas needed)\nCheck delegation allowance — How much can the agent still borrow?\nCheck health factor — Is the delegator's position safe?\nCheck outstanding debt — How much does the delegator owe on each asset?\nCheck available liquidity — Is there enough in the Aave pool to borrow?\nResolve debt token addresses — Look up VariableDebtToken for any asset\nWrite Operations (needs gas in agent wallet)\nBorrow — Draw funds from Aave against delegated credit\nRepay — Return borrowed funds to reduce delegator's debt\nApprove — Approve Pool to spend tokens for repayment\nSupported Chains\nChain\tPool Address\tGas Cost\nBase\t0xA238Dd80C259a72e81d7e4664a9801593F98d1c5\tVery Low\nEthereum\t0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2\tHigh\nPolygon\t0x794a61358D6845594F94dc1DB02A252b5b4814aD\tVery Low\nArbitrum\t0x794a61358D6845594F94dc1DB02A252b5b4814aD\tLow\n\nSee deployments.md for full address list including debt tokens.\n\nCommon Patterns\nAgent Self-Funding for Gas\n# Check if we have enough gas\nBALANCE=$(cast balance $AGENT_ADDRESS --rpc-url $RPC)\nif [ \"$BALANCE\" -lt \"1000000000000000\" ]; then  # < 0.001 ETH\n  # Borrow a small amount of WETH for gas\n  aave-borrow.sh WETH 0.005\nfi\n\nBorrow + Swap via Bankr\n# Borrow USDC from delegated credit\naave-borrow.sh USDC 100\n# Swap to ETH using Bankr\nbankr.sh \"Swap 100 USDC for ETH on Base\"\n\nPeriodic DCA\n# Agent borrows USDC weekly and swaps to ETH\naave-borrow.sh USDC 100\nbankr.sh \"Swap 100 USDC for ETH on Base\"\n\nSafety-First Portfolio Rebalance\n# Always check health first\naave-status.sh\n# Only borrow if healthy\naave-borrow.sh USDC 500\n\nConfiguration Reference\nconfig.json Fields\nField\tRequired\tDescription\nchain\tYes\tChain name (base, ethereum, polygon, arbitrum)\nrpcUrl\tYes\tJSON-RPC endpoint URL\nagentPrivateKey\tYes\tAgent wallet private key (0x-prefixed)\ndelegatorAddress\tYes\tUser's main wallet that delegated credit\npoolAddress\tYes\tAave V3 Pool contract address\ndataProviderAddress\tYes\tAave V3 PoolDataProvider address\nassets\tYes\tMap of symbol → {address, decimals}\nsafety.minHealthFactor\tNo\tMin HF after borrow (default: 1.5)\nsafety.maxBorrowPerTx\tNo\tMax borrow per transaction (default: 1000)\nsafety.maxBorrowPerTxUnit\tNo\tUnit for maxBorrowPerTx (default: USDC)\nEnvironment Variables (override config)\nVariable\tOverrides\nAAVE_RPC_URL\trpcUrl\nAAVE_AGENT_PRIVATE_KEY\tagentPrivateKey\nAAVE_DELEGATOR_ADDRESS\tdelegatorAddress\nAAVE_POOL_ADDRESS\tpoolAddress\nAAVE_MIN_HEALTH_FACTOR\tsafety.minHealthFactor\nError Handling\nError\tCause\tFix\nINSUFFICIENT_ALLOWANCE\tDelegation amount exceeded\tDelegator must call approveDelegation() again\nHEALTH_FACTOR_TOO_LOW\tBorrow would risk liquidation\tReduce amount or add collateral\nAMOUNT_EXCEEDS_CAP\tPer-tx safety cap hit\tReduce amount or update config\nINSUFFICIENT_LIQUIDITY\tNot enough in Aave pool\tTry smaller amount or different asset\nINSUFFICIENT_GAS\tAgent wallet has no native token\tSend gas to agent wallet\nEMODE_MISMATCH\tAsset incompatible with delegator's eMode\tBorrow an asset in the same eMode category\nSecurity\n\nSee safety.md for the full threat model and emergency procedures.\n\nCritical rules:\n\nThe delegator's private key must NEVER be in this repo, config, or scripts — this is the agent's workspace. The delegator manages their side via the Aave UI or a block explorer.\nNever commit config.json to version control — it contains the agent's private key\nNever set minHealthFactor below 1.2 — liquidation happens at 1.0\nAlways cap delegation amounts — never approve type(uint256).max\nMonitor delegator health — set up alerts if HF drops below 2.0\nAgent must refuse to borrow if safety checks fail, even if instructed to\nResources\nAave V3 Docs: https://docs.aave.com/developers\nCredit Delegation Guide: https://docs.aave.com/developers/guides/credit-delegation\nAave Address Book: https://github.com/bgd-labs/aave-address-book\nFoundry Book: https://book.getfoundry.sh/\nDebtToken Reference: https://docs.aave.com/developers/tokens/debttoken"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/aaronjmars/agent-credit",
    "publisherUrl": "https://clawhub.ai/aaronjmars/agent-credit",
    "owner": "aaronjmars",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/agent-credit",
    "downloadUrl": "https://openagent3.xyz/downloads/agent-credit",
    "agentUrl": "https://openagent3.xyz/skills/agent-credit/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agent-credit/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agent-credit/agent.md"
  }
}