Alpaca Finance
简体中文
简体中文
  • 🧭导航
  • 🦙Alpaca Finance
  • 项目协议介绍
    • 🏆我们的产品
    • 📈如何参与
      • 通过 Alpaca Finance 最大化挖矿收益的六种简单策略
      • 策略 1:持有代币,同时以低风险赚取高收益;又名-贷款与质押
      • 策略 2 — 持有代币对来赚取自动复投收益(无杠杆)
      • 策略 3:增强您的稳定币收益
      • 策略 4:在牛市中提高加密货币收益
      • 策略5:在熊市中获利的收益农场
      • 策略 6:通过对冲在任何市场中提高加密货币收益
    • 🗺️发展路线图
    • 🔒安全
    • 📄项目透明信息(审计 & 合约)
    • 🔗其他链接
    • 📰媒体报导
    • ❤️慈善
    • 🌐全局变量
      • ⏫杠杆收益农场参数
      • 📈AF1.0 利率模型
      • 📖自动化金库参数
      • 📔AUSD 参数
      • 📗永续合约交易所参数
      • 📙AF2.0 参数
  • 代币经济学模型
    • 📀ALPACA 代币
    • 💰ib 代币 / 合成代币
    • ⚖️资金池分配
    • 🔥代币销毁证明
      • 销毁来源详细信息
  • 贷款
    • 🏦贷款简介
    • ❗风险
    • ⏭️手把手教学
      • 贷款与质押
      • 取出
  • 杠杆收益农场
    • 🚀杠杆收益农场简介
    • 🏊资金池具体参数
      • PancakeSwap 资金池
      • MdexSwap 资金池
      • BiSwap 资金池
      • SpookySwap 资金池 (已暂停)
      • WaultSwap 资金池 (已暂停)
    • 🧮杠杆收益农场交易策略
      • PancakeSwap 农场池
      • MdexSwap 农场池
      • BiSwap 农场池
      • SpookySwap 农场池 (已暂停)
      • WaultSwap 农场池 (已暂停)
    • 🌊AF1.0 清算
    • ❗风险
    • 📶手把手引导教学
      • 开立杠杆收益农场仓位
      • 调整杠杆收益农场仓位
      • 关闭 / 部分关闭杠杆收益农场仓位
      • 领取奖励
      • 清算仓位
  • 自动化金库
    • ⚙️自动化金库简介
      • 市场中性策略
      • 储蓄金库策略
    • 🧮对冲机制
    • ⏬降低金库杠杆机制
    • 🔏专属自动化金库
    • 📈回测结果
    • ❗风险
    • ⏭️手把手引导教学
      • 向自动化金库进行投资
      • 查看您的自动化金库仓位
      • 从自动化金库中取款
  • Alpaca Finance 2.0
    • 💎Alpaca Finance 2.0 简介
      • 货币市场
      • 杠杆收益农场
    • 🚀发布计划
    • ⭐激励奖励
    • 🌊AF2.0 清算
    • ❗风险
    • ⏭️手把手引导教学
      • 存款
      • 借款
      • 偿还
      • 提领
      • 账户之间转帐
      • 循环策略
  • 永续合约交易所
    • 🔮永续合约交易所简介
      • 交易者
      • 流动性提供者
    • 🚀发布计划
    • 💲交易费折扣计划
    • 🎁推荐计划
    • ❗风险
    • ⏭️手把手引导教学
      • 开立杠杆仓位
      • 调整杠杆仓位
      • 关闭杠杆仓位
      • 交换资产
      • 投资并质押 ALP 代币
      • 取消质押和提出 ALP 代币
  • 社区治理
    • 🗳️治理金库
    • 🍃羊驼牧场 (新)
    • ⚡提前取款
    • 🔎治理来源详细信息
    • 📝治理讨论和投票
    • ⏭️手把手引导教学
      • 将 ALPACA 锁定在治理资金池中
      • 锁定更多 ALPACA 或延长锁定时间
      • 从治理资金池中领取奖励
      • 在 MetaMask 中添加代币
      • 提前从治理金库中提取 ALPACA
      • 对羊驼改进提案 (AIP) 进行投票
      • 在 BNB 链上提取 FANTOM 治理金库中 ALPACA
      • 从旧的治理金库中提出 xALPACA
    • 🗒️羊驼改进提案 (AIP) 细节
      • AIP-1: ITAM 奖励的处理方案
      • AIP-2: Fantom 上的治理金库
      • AIP-3: 处理治理金库提前取款的罚金
      • AIP-4.1: 处理近期 WaultSwap 仓位的坏账
      • AIP-4.2: 处理剩余 Waultswap 仓位的坏账风险的解决方案
      • AIP-5: 利率模型调整
      • AIP-6.1: 限制对自动化金库的访问
      • AIP-6.2: 限制对自动化金库的访问
      • AIP-7: 处理近期 Fantom 网络上的坏账
      • AIP-8.1: 通过提供对高杠杆自动化金库的访问来增加 AUSD 效用
      • AIP-8.2: 通过提供对高杠杆自动化金库的访问来增加 AUSD 效用
      • AIP-9: 在等待用于回购时将清算金库资金存入贷款池
      • AIP-10: 进一步优化分阶式的借贷利率
      • AIP-11: 调整 AUSD 的稳定费以帮助恢复挂钩
      • AIP-12:处理近期 stkBNB 脱钩的坏账
      • AIP-13:移除持有 xALPACA 访问高杠杆自动化金库的要求
      • AIP-14:关闭 stkBNB-BNB 池子中剩余的杠杆收益农场仓位,以避免任何未来的潜在坏账
      • AIP-15.1:对即将推出的新产品激励 (永续合约,AF2.0)
      • AIP-15.2:分配方法 - 新产品的激励 (永续合约,AF2.0)
      • AIP-15.3:永续合约的激励金额 - 新产品的激励 (永续合约)
      • AIP-15.4:AF2.0 的激励金额 - 新产品的激励 (AF2.0)
      • AIP-15.5:激励来源 — 新产品的激励 (永续合约,AF2.0)
      • AIP-16:调整分阶式 3 最大利率
      • AIP-17:处理来自 AIP-15 激励的额外 ALPACA 代币
      • AIP-18:停止支持 MDEX 杠杆农场池
      • AIP-19:实施屏蔽投票
      • AIP-20:使 AF1.0 贷款绩效费用结构与 AF2.0 保持一致
      • AIP-21.1:从 stkBNB 脱钩事件调整坏账偿还方案
      • AIP-21.2:从 stkBNB 脱钩事件调整坏账偿还方案
      • AIP-22:Alperp 和 AF2.0 的付费营销预算
      • AIP-23:停止支持 TUSD 的杠杆收益农场
      • AIP-24.1:新治理金库实施计划
      • AIP-24.2:新治理金库实施计划 - 解锁周期
      • AIP-24.3:新治理金库实施计划 - 可转让性
      • AIP-24.4:新治理金库实施计划 - 提前取款
      • AIP-24.5:新治理金库实施计划 - 提前取款罚金模型
      • AIP-25:AF1.0 > AF2.0 的迁移
      • AIP-26:治理金库机制转换
      • AIP-27:更新羊驼保险计划
  • 加入羊驼群!(ALPACAREERS)
    • 🚀我们正在招聘!
  • ALPIES
    • 🌗Alpies 简介
    • 🧑‍🏫桥接您的 Alpies
      • 将 Alpies 从 ETH 桥接到 BNB Chain
      • 将 Alpies 从 BNB Chain 桥接到 ETH
    • ⚡提高杠杆率
  • 资源
    • 👩‍🏫羊驼学院
      • 第 0 课:如何购买 Alpaca 并开始挖矿的新手入门(借贷 + 质押)
      • 第 1 课:Alpaca Finance 独特的应用场景 - 做空赚取利润
      • 第 2 课:以双向借贷进行对冲
      • 第 3 课:在杠杆挖矿中的清算风险
      • 第 4 课:如何开立/关闭杠杆农场仓位,并且 0 交换费用!
      • 第 5 课:关于无常损失和常见误解的真相
      • 羊驼能力测试(赚取 NFTs)
    • ❓FAQ
    • 🧰实用工具
    • 📘术语和计算方法
      • 🧮APY 计算方式
      • 📈收益/损失计算
    • ⚠️常见错误信息
    • 💸第三方的 ALPACA 收益机会
  • 开发
    • 🐞漏洞赏金计划
    • 🎛️协议相关配置信息
    • 💻与 Alpaca Finance 集成
    • 🏛️AF2.0 回购指南
    • ⚡AF2.0 闪电贷指南
  • 过去的产品
    • 🗳️治理资金池 (旧)
    • 💪Stronk 资金池 / 资金库
    • 🌿羊驼牧场 (旧)
    • ⚡提前取款 (旧)
    • 💵AUSD (旧)
      • 💵AUSD 简介
      • 💹如何参与
      • 💦AUSD 清算
      • 〰️AUSD 价格稳定模块
      • ❗风险
      • ⏭️手把手引导教学
        • 开立 AUSD 仓位
        • 调整 AUSD 仓位
        • 关闭 / 部分关闭 AUSD 仓位
        • 添加/移除 AUSD-3EPS LP 代币
Powered by GitBook
On this page
  • 设计理念
  • ​ 时间锁
  • ​多重签名钱包
  • 可调参数
  • FairLaunch Contract / 公平发行合约
  • Vault Contract / 资金池合约
  • PancakeswapWorker Contract / PancakeswapWorker 合约
  • SimplePriceOracle Contract / 价格预言机合约
  • SimpleVaultConfig
  • ConfigurableInterestVaultConfig
  • PancakeswapWorkerConfig

Was this helpful?

  1. 开发

协议相关配置信息

Previous漏洞赏金计划Next与 Alpaca Finance 集成

Last updated 1 year ago

Was this helpful?

设计理念

我们在Alpaca Finance中设计了许多可配置的参数。虽然最初的参数配置是由核心开发人员来设定的,但我们已经计划来让治理社区通过投票的方式,来决定是否更改配置参数。

​ 时间锁

时间锁 Timelock 是一个延迟本项目更改生效的智能合约。这个时间锁合约,是 Alpaca Finance 项目上所有合约的拥有者(owner)。因此,每一次合约变更生效都需要通过这个时间锁合约,使得时间锁合约作为护城河来保障资金安全。

本质上,管理员(团队核心开发人员)每一次的操作都需要通过这个时间锁合约,并且操作都是24小时后才生效。具体来说,管理员执行的每个命令就像一笔订单一样排队进入队列,然后等待24小时候才会执行。这是一个可靠的安全特性,使社区能够提前看到所有合约更新操作,并提前做好准备。如果发现有任何可疑操作的地方,用户可以在合约升级生效前,从资金池里提取他们的资金。

下面的这些合约拥有者都是时间锁合约

  • 所有的资金池合约

  • 公平发行合约

  • 所有的系统运行合约

  • 所有价格预言机合约

  • 所有系统配置合约

​多重签名钱包

作为附加的安全层,我们还使用了多重签名钱包。任何要伫列 (queue)  进入我们的 Timelock 合约的更改都需要经过多重签名的批准,从而增加了另一层安全性。

多重签名目前有 4 个签名者,至少需要 2 个签名者才能签署交易。

本节列出了 Alpaca Finance 项目中所有可调参数和函数

FairLaunch Contract / 公平发行合约

  • addPool(_allocatedPoint, _stakeToken, _withUpdate)

    • _allocatedPoint = How many points assign to this pool. This will affect the ALPACAs distribution per block.

    • _stakeToken = The address of a required staking token.

    • _withUpdate = A flag for updatePool calculation

  • setPool(_pid, _allocatedPoint, _withUpdate)

    • _pid = Pool ID that you wish to adjust the point

    • _allocatedPoint = New points to be assign to this pool. This will affect the ALPACAs distribution per block.

    • _withUpdate = A flag for updatePool calculation

  • setBonus(_bonusMultiplier, _bonusEndBlock, _bonusLockUpBps)

    • _bonusMultiplier = Multiplier that will be applied during the bonus period

    • _bonusEndBlock = The block number that bonus will be ended

    • _bonusLockUpBps = % of bonus that is earned in the bonus period to be locked

Vault Contract / 资金池合约

  • updateConfig(_newConfig)

    • _newConfig = A new contract that is implemented IVaultConfig interface

  • setFairLaunchPoolId(_pid)

    • _pid = Pool ID on Fair Contract that the staking token is debtToken owned by Vault

  • withdrawReserve(_to, _amount)

    • _to = The address to receive amount

    • _amount = The amount to be withdrawn from the reserve

  • redeuceReserve(_amount)

    • _amount = Reduce reserve portion for treasury management

PancakeswapWorker Contract / PancakeswapWorker 合约

  • setReinvestBountyBps(_newBountyBps)

    • _newBountyBps = A new bounty that the bounty hunter will get when they trigger reinvest

  • setStrategyOk(_strategyAddresses, _ok)

    • _strategyAddresses = Addresses for the strategy contract

    • _ok = Can be either true or false. If the _strategyAddresses above need to be disabled then set _ok = false

  • setCriticalStrategies(_addStrategy, _liquidateStrategy)

    • _addStrategy = Set default addStrategy

    • _liquidateStrategy = Set default liquidateStrategy

SimplePriceOracle Contract / 价格预言机合约

  • setFeeder(_address)

    • _address = The address of a new feeder

SimpleVaultConfig

  • setParams(_minDebtSize, _interestRate, _reservePoolBps, _killBps, _wrappedNative, _fairLaunch)

    • _minDebtSize = The minimum required for borrower to loan from the pool

    • _interestRate = Interest rate per second

    • _reservePoolBps = % to be put in reserve pool in BPS

    • _killBps = % that bounty hunters will get when they liquidate the position

    • _wrappedNative = Address of the wNative token

    • _fairLaunch = Address of the fair launch contract

  • setWorker(_workerAddress, _isWorker, _acceptDebt, _workFactor, _killFactor)

    • _workerAddress = The address of the worker

    • _isWorker = The flag to set if this is worker

    • _acceptDebt = The flag to set if this worker is accepting the debt

    • _workFactor = The flag threshold to prevent user from over leverage

    • _killFactor = The flag threshold to mark if position can be liquidated

ConfigurableInterestVaultConfig

  • setParams(_minDebtSize, _reservePoolBps, _killBps, _interestModelAddress, _wrappedNative, _fairLaunch)

    • _minDebtSize = The minimum required for borrower to loan from the pool

    • _reservePoolBps = % to be put in reserve pool in BPS

    • _killBps = % that bounty hunters will get when they liquidate the position

    • _interestModelAddress = Address of the interest model

    • _wrappedNative = Address of the wNative token

    • _fairLaunch = Address of the fair launch contract

PancakeswapWorkerConfig

  • setOracle(_newOracleAddress)

    • _newOracleAddress = The new oracle address

  • setConfigs([ ]_WorkerAddress, [ ]_configs)

    • [ ]_WorkerAddress = address of worker

    • [ ]_configs = Config object including:

      • _acceptDebt

      • _workFactor = The flag threshold to prevent user from over leverage

      • _killFactor = The flag threshold to mark if position can be liquidated

      • _maxPriceDiff

可调参数

🎛️
🖌️
⏳
✏️
⚙️