> For the complete documentation index, see [llms.txt](https://mapidocs.gitbook.io/dokumentacziya-alpaca-finance-na-russkom/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mapidocs.gitbook.io/dokumentacziya-alpaca-finance-na-russkom/upravlenie/konfiguracii-protokola.md).

# 🎛️ Конфигурации протокола

## Дизайн

Мы разработали множество параметров в Alpaca Finance, которые можно настраивать. Несмотря на то, что первоначальные конфигурации устанавливаются основной командой разработчиков, мы намерены позволить сообществу управления решить, что нужно изменить, что произойдет путем голосования.

## Таймлок

Timelock - это контракт для отсрочки внесения изменений в протокол. Этот контракт является владельцем всех крупных контрактов в Alpaca Finance. Следовательно, каждое изменение должно выполняться через этот контракт, что делает его функцией безопасности.

По сути, каждый приказ от администратора (группы основных разработчиков) должен пройти через этот контракт и откладывается на 24 часа, прежде чем вступить в силу. Чтобы быть конкретным, команда выполнения для заказа отправляется в очередь, ожидая выполнения, когда пройдет 24-часовая задержка. Это функция безопасности, которая позволяет сообществу видеть любые предстоящие обновления и заранее к ним готовиться. Если что-то выглядит подозрительно, они могут вывести свои средства из протокола до того, как обновление вступит в силу.

Ниже приведены контракты, принадлежащие таймлоку.

* Все контракты
* Контракты честного запуска
* Все рабочие контракты
* Все контракты ценового оракула
* Все конфиг контракты

## Регулируемые параметры

В этом разделе перечислены все настраиваемые параметры и функции в Alpaca Finance

### Контракт честного запуска

* addPool(\_allocatedPoint, \_stakeТокен, \_withUpdate)
  * \_allocatedPoint = How many points assign to this pool. This will affect the ALPACAs distribution per block.
  * \_stakeТокен = The address of a required стейкинг 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

### Контракт пулла

* updateConfig(\_newConfig)
  * \_newConfig = A new contract that is implemented IVaultConfig interface
* setFairLaunchPoolId(\_pid)
  * \_pid = Pool ID on Fair Contract that the стейкинг token is debtТокен 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

### Pancakeswap Контракт работника

* 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

### Контракт оракула цены

* setFeeder(\_address)
  * \_address = The address of a new feeder

### Простой контракт пулла

* 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

### Конфиг контракта с настройкой

* 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

### Pancakeswap контракт

* 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
