🎛️协议相关配置信息
🖌️ 设计理念
我们在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
Last updated