返回顶部
c

credex-protocolCredex协议

Access unsecured credit lines for AI agents on the Arc Network using the Credex Protocol. Use for borrowing USDC against reputation, repaying debt to grow credit limits, providing liquidity as an LP, or managing cross-chain USDC via Circle Bridge. Triggers on "borrow from credex", "repay debt", "deposit to pool", "check credit status", "provide liquidity", or any credit/lending task on Arc.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.1
安全检测
已通过
1,120
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

credex-protocol

Credex 协议技能

与 Credex 协议交互——Arc 网络上 AI 代理的去中心化信用系统。



使用方法

基础目录: {baseDir}(包含此 SKILL.md 的目录)

从项目根目录运行所有命令:

bash
cd {baseDir}
npx ts-node scripts/client.ts [args] # 借款人命令
npx ts-node scripts/lp.ts [args] # 流动性提供者命令

输出格式: 所有脚本返回 JSON 格式以便机器读取。解析输出以提取 creditLimit、txHash、debt 等字段。



环境变量

必需(必须设置)

变量描述
WALLETPRIVATEKEY用于签署交易的私钥。没有此密钥,所有命令都将失败。
RPC_URL
Arc 网络 RPC。默认值:https://rpc.testnet.arc.network |

可选

变量描述默认值
CREDEXPOOLADDRESS池合约地址0x32239e52534c0b7e525fb37ed7b8d1912f263ad3
CREDEXAGENTURL
Credex 代理服务器 URL | http://localhost:10003 |

运行前检查: 在运行任何命令之前,请确认已设置 WALLETPRIVATEKEY。如果缺失,请提示用户。



合约地址(Arc 测试网)


合约地址
CredexPool0x32239e52534c0b7e525fb37ed7b8d1912f263ad3
USDC(Arc)
0x3600000000000000000000000000000000000000 |
| USDC(Base Sepolia)| 0x036CbD53842c5426634e7929541eC2318f3dCF7e |


客户端命令(借款人)

脚本: scripts/client.ts
运行方式: npx ts-node scripts/client.ts [args]



status

检查代理的信用状态。

使用方法:

bash
npx ts-node scripts/client.ts status

参数:

  • - address(可选):钱包地址。默认为 WALLETPRIVATEKEY 对应的地址。

返回: JSON

json
{
creditLimit: 100.000000,
principal: 5.000000,
interest: 0.050000,
debt: 5.050000,
availableCredit: 95.000000,
active: true,
frozen: false
}

操作: 在调用 borrow 之前,使用 availableCredit 检查是否有足够的资金。



borrow

从池中借入 USDC。

使用方法:

bash
npx ts-node scripts/client.ts borrow

参数:

  • - amount(必需):USDC 金额,以十进制字符串形式提供(例如 5.0)。

返回: JSON

json
{
success: true,
txHash: 0x...,
borrowed: 5.000000,
newDebt: 5.000000,
availableCredit: 95.000000
}

失败条件: amount > availableCredit。请先检查 status。



repay

偿还池中的债务。

使用方法:

bash
npx ts-node scripts/client.ts repay

参数:

  • - amount:要偿还的特定 USDC 金额(例如 5.0)。
  • all:计算总债务加 1% 缓冲并全额偿还。合约将按实际欠款金额进行上限处理。

返回: JSON

json
{
success: true,
txHash: 0x...,
repaid: 5.050000,
remainingDebt: 0.000000,
newCreditLimit: 110.000000
}

注意: 还款优先偿还 利息,然后偿还 本金。每次成功还款将使信用额度增加 10%。



bridge

在 Arc 测试网和 Base Sepolia 之间桥接 USDC。

使用方法:

bash
npx ts-node scripts/client.ts bridge

参数:

  • - amount:USDC 金额(例如 10.0)。
  • from:源链(arc 或 base)。
  • to:目标链(arc 或 base)。

返回: JSON

json
{
success: true,
amount: 10.000000,
from: Arc_Testnet,
to: Base_Sepolia,
estimatedArrival: 5-10 minutes
}

失败条件: from === to。链必须不同。



balance

检查两条链上的钱包余额。

使用方法:

bash
npx ts-node scripts/client.ts balance

返回: JSON

json
{
arc: 50.000000,
base: 25.000000,
total: 75.000000
}



LP 命令(流动性提供者)

脚本: scripts/lp.ts
运行方式: npx ts-node scripts/lp.ts [args]



pool-status

检查池的整体健康状况和指标。

使用方法:

bash
npx ts-node scripts/lp.ts pool-status

返回: JSON

json
{
totalAssets: 1000.000000,
totalLiquidity: 800.000000,
totalDebt: 200.000000,
totalShares: 950.000000,
sharePrice: 1.052631,
utilizationPercent: 20
}



deposit

存入 USDC 以接收 LP 份额。

使用方法:

bash
npx ts-node scripts/lp.ts deposit

参数:

  • - amount:要存入的 USDC(例如 100.0)。

返回: JSON

json
{
success: true,
txHash: 0x...,
deposited: 100.000000,
sharesReceived: 95.000000,
totalShares: 95.000000
}



withdraw

销毁 LP 份额以提取 USDC。

使用方法:

bash
npx ts-node scripts/lp.ts withdraw

参数:

  • - shares:要销毁的份额数量(例如 50.0)。
  • all:根据可用流动性提取最大可能金额。

返回: JSON

json
{
success: true,
txHash: 0x...,
sharesBurned: 50.000000,
usdcReceived: 52.631579,
remainingShares: 45.000000
}

注意: 如果流动性被完全利用(所有 USDC 已借出),提取可能会受到上限限制。



lp-balance

检查地址的 LP 头寸。

使用方法:

bash
npx ts-node scripts/lp.ts lp-balance [address]

返回: JSON

json
{
shares: 95.000000,
value: 100.000000
}



协议机制

利息累积

  • - 利率: 每个间隔 0.1%(10 个基点)
  • 间隔: 1 分钟(测试网加速)
  • 公式: debt = principal + accrued_interest

信用额度增长

每次还款后:

newLimit = currentLimit × 1.10

最大值:10,000 USDC。

可用信用额度

availableCredit = creditLimit - principal

利息不会减少借款能力——只有本金会。

份额价格(LP)

sharePrice = totalAssets / totalShares

其中 totalAssets = liquidity + outstandingDebt。



工作流程示例

借款人流程

text

  1. 1. 检查状态 → npx ts-node scripts/client.ts status
  2. 借款 → npx ts-node scripts/client.ts borrow 5
  3. 使用资金 →(在 Arc

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 credex-protocol-1776339260 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 credex-protocol-1776339260 技能

通过命令行安装

skillhub install credex-protocol-1776339260

下载

⬇ 下载 credex-protocol v1.0.1(免费)

文件大小: 30.23 KB | 发布时间: 2026-4-17 15:21

v1.0.1 最新 2026-4-17 15:21
- Added package-lock.json for improved dependency management.
- Updated the default CredexPool contract address and related documentation in SKILL.md.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部