🎛️Konfigurasi Protokol

🖌️ Etos Reka Bentuk

Kami telah merancang banyak parameter dalam Alpaca Finance agar dapat dikonfigurasi. Walaupun konfigurasi awal ditetapkan oleh pasukan core developer, kami memiliki niat untuk membiarkan komuniti Tadbir memutuskan apa yang perlu diubah yang akan terjadi melalui pengundian.

Timelock

Timelock adalah kontrak untuk mempertangguhkan perubahan pada protokol. Kontrak ini adalah pemilik semua kontrak utama di Alpaca Finance. Oleh itu, setiap perubahan perlu dilaksanakan melalui kontrak ini, yang menjadikannya berfungsi sebagai parit keselamatan.

Pada hakikatnya, setiap pesanan dari admin (kumpulan core developer) harus melalui kontrak ini dan ditangguhkan selama 24 jam sebelum berkuatkuasa. Untuk lebih spesifik, perintah pelaksanaan untuk pesanan menuju ke antrian, menunggu untuk dilaksanakan ketika kelewatan 24 jam berlalu. Ini adalah ciri keselamatan yang membolehkan komuniti melihat kemas kini yang akan datang dan mempersiapkannya terlebih dahulu. Sekiranya terdapat sesuatu yang mencurigakan, mereka dapat menarik dana mereka dari protokol sebelum kemaskini itu berlaku.

Berikut adalah kontrak yang dimiliki oleh Timelock

  • Semua Kontrak Vault

  • Kontrak FairLaunch

  • Semua Kontrak Worker

  • Semua Kontrak PriceOracle

  • Semua Kontrak WorkerConfig

⚙️ Parameter Boleh Laras

Bahagian ini menyenaraikan semua parameter dan fungsi yang dapat disesuaikan dalam 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

  • 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, aka liquidation threshold

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, aka liquidation threshold

      • _maxPriceDiff

Last updated