### Verify Skill Setup Source: https://github.com/aaronjmars/agent-credit/blob/main/SKILL.md Execute the setup script to verify the configuration. ```bash ./aave-setup.sh ``` -------------------------------- ### Install Foundry CLI Source: https://github.com/aaronjmars/agent-credit/blob/main/SKILL.md Install the Foundry toolchain required for interacting with the blockchain. ```bash curl -L https://foundry.paradigm.xyz | bash && foundryup ``` -------------------------------- ### Configure Aave Delegation Skill Source: https://github.com/aaronjmars/agent-credit/blob/main/SKILL.md Create the configuration file for the skill in the ~/.openclaw/skills/aave-delegation directory. ```bash mkdir -p ~/.openclaw/skills/aave-delegation cat > ~/.openclaw/skills/aave-delegation/config.json << 'EOF' { "chain": "base", "rpcUrl": "https://mainnet.base.org", "agentPrivateKey": "0xYOUR_AGENT_PRIVATE_KEY", "delegatorAddress": "0xYOUR_MAIN_WALLET", "poolAddress": "0xA238Dd80C259a72e81d7e4664a9801593F98d1c5", "dataProviderAddress": "0x2d8A3C5677189723C4cB8873CfC9C8976FDF38Ac", "assets": { "USDC": { "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "decimals": 6 }, "WETH": { "address": "0x4200000000000000000000000000000000000006", "decimals": 18 } }, "safety": { "minHealthFactor": "1.5", "maxBorrowPerTx": "1000", "maxBorrowPerTxUnit": "USDC" } } EOF ``` -------------------------------- ### Configure Safety Parameters Source: https://github.com/aaronjmars/agent-credit/blob/main/safety.md JSON configurations for defining borrowing limits and health factors. Choose between Conservative, Moderate, or Aggressive profiles based on risk tolerance. ```json { "safety": { "minHealthFactor": "2.0", "maxBorrowPerTx": "100", "maxBorrowPerTxUnit": "USDC" } } ``` ```json { "safety": { "minHealthFactor": "1.5", "maxBorrowPerTx": "500", "maxBorrowPerTxUnit": "USDC" } } ``` ```json { "safety": { "minHealthFactor": "1.2", "maxBorrowPerTx": "5000", "maxBorrowPerTxUnit": "USDC" } } ``` -------------------------------- ### Force Repay Agent Debt Source: https://github.com/aaronjmars/agent-credit/blob/main/safety.md Commands to approve the pool and repay all outstanding debt from the main wallet. ```bash # From your main wallet, repay the agent's borrowed debt # First approve Pool cast send $ASSET "approve(address,uint256)" $POOL $MAX_UINT \ --private-key $YOUR_PK --rpc-url $RPC # Repay cast send $POOL "repay(address,uint256,uint256,address)" \ $ASSET $MAX_UINT 2 $YOUR_ADDRESS \ --private-key $YOUR_PK --rpc-url $RPC ``` -------------------------------- ### Audit Agent Borrowing Activity Source: https://github.com/aaronjmars/agent-credit/blob/main/safety.md Commands to verify debt token balances and inspect recent borrow events on the pool. ```bash # Check debt token balance — if non-zero, someone borrowed cast call $VAR_DEBT_TOKEN "balanceOf(address)(uint256)" $YOUR_ADDRESS --rpc-url $RPC # Check recent events on the Pool for Borrow events from your address cast logs --from-block -1000 --address $POOL \ "Borrow(address,address,address,uint256,uint8,uint256,uint16)" \ --rpc-url $RPC | grep -i $YOUR_ADDRESS ``` -------------------------------- ### Borrow assets via delegation Source: https://github.com/aaronjmars/agent-credit/blob/main/SKILL.md Execute a borrow operation after passing safety checks. ```bash # Borrow 100 USDC ./aave-borrow.sh USDC 100 # Borrow 0.5 WETH ./aave-borrow.sh WETH 0.5 ``` -------------------------------- ### Look up debt tokens dynamically Source: https://github.com/aaronjmars/agent-credit/blob/main/deployments.md Use this command to retrieve the aToken, stableDebtToken, and variableDebtToken addresses for a specific asset. The third return value is the VariableDebtToken required for approveDelegation calls. ```bash cast call $DATA_PROVIDER \ "getReserveTokensAddresses(address)(address,address,address)" \ $ASSET_ADDRESS --rpc-url $RPC_URL ``` -------------------------------- ### Check Agent Gas Balance Source: https://github.com/aaronjmars/agent-credit/blob/main/SKILL.md Verifies the agent's native balance before execution to ensure sufficient gas for transactions. ```bash BALANCE=$(cast balance "$AGENT_ADDRESS" --rpc-url "$RPC") if [ "$BALANCE" -lt "1000000000000000" ]; then # < 0.001 ETH echo "Agent gas is low — the delegator must send ETH to $AGENT_ADDRESS." exit 1 fi ``` -------------------------------- ### Repay debt Source: https://github.com/aaronjmars/agent-credit/blob/main/SKILL.md Repay specific amounts or clear all debt for a given asset. ```bash # Repay 100 USDC ./aave-repay.sh USDC 100 # Repay all USDC debt ./aave-repay.sh USDC max ``` -------------------------------- ### Resolve DebtToken Addresses Source: https://github.com/aaronjmars/agent-credit/blob/main/contracts.md Use this command to retrieve the aToken, stable debt token, and variable debt token addresses for a specific asset. ```bash # Returns (aTokenAddress, stableDebtTokenAddress, variableDebtTokenAddress) cast call $DATA_PROVIDER \ "getReserveTokensAddresses(address)(address,address,address)" \ $ASSET_ADDRESS \ --rpc-url $RPC_URL ``` -------------------------------- ### Borrow and Swap via Bankr Source: https://github.com/aaronjmars/agent-credit/blob/main/SKILL.md Executes a borrow operation followed by a swap, useful for periodic DCA strategies. ```bash # Borrow USDC from delegated credit ./aave-borrow.sh USDC 100 # Swap to ETH using Bankr bankr.sh "Swap 100 USDC for ETH on Base" ``` -------------------------------- ### Verify Delegation Allowance Source: https://github.com/aaronjmars/agent-credit/blob/main/contracts.md Check the current borrow allowance granted by a delegator to an agent address for a specific variable debt token. ```bash # Look up the VariableDebtToken for an asset cast call $DATA_PROVIDER \ "getReserveTokensAddresses(address)(address,address,address)" \ $ASSET_ADDRESS --rpc-url $RPC # Check allowance cast call $VAR_DEBT "borrowAllowance(address,address)(uint256)" \ $DELEGATOR_ADDRESS $AGENT_ADDRESS --rpc-url $RPC ``` -------------------------------- ### Check Aave account status Source: https://github.com/aaronjmars/agent-credit/blob/main/SKILL.md Retrieve status reports for allowance, health, and debt using the status script. ```bash # Full status report ./aave-status.sh # Check specific asset delegation ./aave-status.sh USDC # Just health factor ./aave-status.sh --health-only ``` -------------------------------- ### Revoke Delegation via Cast Source: https://github.com/aaronjmars/agent-credit/blob/main/safety.md Command to immediately set delegation allowance to zero for a specific agent address. ```bash # For each asset, set delegation to 0 cast send $VAR_DEBT_TOKEN "approveDelegation(address,uint256)" \ $AGENT_ADDRESS 0 \ --private-key $YOUR_PK --rpc-url $RPC ``` -------------------------------- ### Gate Borrowing on Health Factor Source: https://github.com/aaronjmars/agent-credit/blob/main/SKILL.md Checks the current health factor and only proceeds with borrowing if it exceeds a specified threshold. ```bash HF=$(./aave-status.sh --health-only --json | jq -r .healthFactor) # "inf" is the no-debt sentinel and is not a number — test it separately. if [ "$HF" = "inf" ] || (( $(echo "$HF > 2.0" | bc -l) )); then ./aave-borrow.sh USDC 500 else echo "HF $HF below the 2.0 headroom this job requires; skipping." fi ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.