LogoLogo
English
English
  • 🧭Navigation
  • 🦙Alpaca Finance
  • Our Protocol
    • 🏆Our Products
    • 📈How to Participate
      • Introduction to Six Simple Strategies to Earn
      • Strategy 1: Hold a Token While Earning High Yields at Low Risk; aka Lend & Stake
      • Strategy 2: Hold a Token Pair to Earn Auto-Compounded Yields Without Leverage
      • Strategy 3: Supercharge Your Stablecoin Yields
      • Strategy 4: Multiply Crypto Gains in a Bull Market
      • Strategy 5: Yield Farm Profitably in a Bear Market
      • Strategy 6: Multiply Crypto Gains in Any Market by Hedging
    • 🗺️Roadmap
    • 🔒Security
    • 📃Transparency (Audits & Contracts)
    • 🔗Links
    • 📰Media Coverage
    • ❤️Charity
    • 🌐Global Protocol Parameters
      • ⏫Leveraged Yield Farming Parameters
      • 📈AF1.0 Interest Rate Model
      • 📖Automated Vault Parameters
      • 📗Perpetual Futures Exchange Parameters
      • 📙AF2.0 Parameters
  • Tokenomics
    • 📀ALPACA Token
    • 💰ibTokens
    • ⚖️Pool Allocations
    • 🔥Proof of Burn
      • Burn Sources Details
  • Lending
    • 🏦Introduction to Lending
    • ❗Risks
    • ⏭️Step-by-Step Guide
      • Lend & Stake
      • Withdraw
  • Leveraged Yield Farming
    • 🚀Introduction to Leveraged Yield Farming
    • 🏊Pool-Specific Parameters
      • PancakeSwap Pools
      • Mdex Pools
      • Biswap Pools
      • SpookySwap Pools (Deprecated)
      • WaultSwap Pools (Deprecated)
    • 🧮Leveraged Yield Farming Mechanics
      • PancakeSwap Farms
      • Mdex Farms
      • Biswap Farms
      • SpookySwap Farms (Deprecated)
      • WaultSwap Farms (Deprecated)
    • 🌊AF1.0 Liquidation
    • ❗Risks
    • ⏭️Step-by-Step Guide
      • Open a Leveraged Yield Farming Position
      • Adjust a Leveraged Yield Farming Position
      • Close/Partially Close a Leveraged Yield Farming Position
      • Claim Rewards
      • Liquidate Positions
  • Automated Vaults
    • ⚙️Introduction to Automated Vaults
      • Market-Neutral Strategy
      • Savings Vault Strategy
    • 🧮Hedging Mechanics
    • ⏬Lowering Vault Leverage Mechanics
    • 🔏Private Automated Vault
    • 📈Backtest Results
    • ❗Risks
    • ⏭️Step-by-Step Guide
      • Invest in an Automated Vault
      • View Your Automated Vault Position
      • Withdraw from the Automated Vault
  • Perpetual Futures Exchange
    • 🔮Introduction to Perpetual Futures Exchange
      • Traders
      • Liquidity Providers
    • 🚀Launch Plan
    • 💲Trading Fee Discount Program
    • 🎁Referral Program
    • ❗Risks
    • ⏭️Step-by-Step Guide
      • Open a Leveraged Position
      • Manage a Leveraged Position
      • Close a Leveraged Position
      • Swap Asset
      • Invest in & Stake ALP token
      • Unstake & Withdraw ALP token
  • Alpaca Finance 2.0
    • 💎Introduction to Alpaca Finance 2.0
      • Money Market
      • Leveraged Yield Farming
    • 🚀Launch Plan
    • ⭐Incentive Rewards
    • 🌊AF2.0 Liquidation
    • ❗Risks
    • ⏭️Step-by-Step Guide
      • Deposit
      • Borrow
      • Repay
      • Withdraw
      • Transfer between Accounts
      • Looping Strategies
  • Governance
    • 🗳️Governance Vault
    • 🍃Grazing Range (New)
    • ⚡Early Withdrawal
    • 🔎Governance Sources Details
    • 📝Governance Discussion and Voting
    • 🗒️AIP Details
      • AIP-1: Handling of ITAM Rewards
      • AIP-2: Governance Vault on Fantom
      • AIP-3: Handling of Governance Vault’s Early Withdrawal Penalty
      • AIP-4.1: Handling of a recent bad debt on WaultSwap’s position
      • AIP-4.2: Solution to eliminate bad debt risks from remaining Waultswap positions
      • AIP-5: Interest Model Adjustment
      • AIP-6.1: Limiting Access to Automated Vault
      • AIP-6.2 Limiting Access to Automated Vault
      • AIP-7: Handling of a recent bad debt on Fantom Network
      • AIP-8.1: Increase AUSD utility by providing access to high-leveraged AVs
      • AIP-8.2: Increase AUSD utility by providing access to high-leveraged AVs
      • AIP-9: Deposit Liquidation Treasury Funds into Lending Pools while waiting to be used for buyback
      • AIP-10: Further optimizing the borrowing interest rate slope
      • AIP-11: Adjust Stability Fee for AUSD to help restore peg
      • AIP-12: Handling of bad debt from the recent stkBNB's depeg
      • AIP-13: Removing xALPACA requirement for accessing high-leveraged Automated Vaults
      • AIP-14: Close remaining LYF positions on stkBNB-BNB pool to avoid any potential future bad debt
      • AIP-15.1: Incentives for New Upcoming Products (Perp, AF2.0)
      • AIP-15.2: Distribution Method - Incentives for New Upcoming Products (Perp, AF2.0)
      • AIP-15.3: Incentives Amount for Perp - Incentives for New Upcoming Products (Perp)
      • AIP-15.4: Incentives Amount for AF2.0 - Incentives for New Upcoming Products (AF2.0)
      • AIP-15.5: Sources for Incentives - Incentives for New Upcoming Products (Perp, AF2.0)
      • AIP-16: Adjusting Slope3 max interest rate
      • AIP-17: Handling of extra ALPACA tokens from the AIP-15 incentives
      • AIP-18: Sunsetting Leveraged Yield Farming Support for MDEX pools
      • AIP-19: Implement Shielded Voting
      • AIP-20: Aligning AF1.0 lending performance fee structure with AF2.0
      • AIP-21.1: Adjusting bad debt repayment scheme from the stkBNB de-peg event
      • AIP-21.2: Adjusting bad debt repayment scheme from the stkBNB de-peg event
      • AIP-22: Paid Marketing Budget for Alperp and AF2.0
      • AIP-23: Sunsetting Leveraged Yield Farming Support for TUSD
      • AIP-24.1: New Governance Vault Implementation
      • AIP-24.2: New Governance Vault Implementation - Unlocking Period
      • AIP-24.3: New Governance Vault Implementation - Transferability
      • AIP-24.4: New Governance Vault Implementation - Early Withdrawal
      • AIP-24.5: New Governance Vault Implementation - Early Withdrawal Penalty Model
      • AIP-25: Migration from AF1.0 -> AF2.0
      • AIP-26: Transitioning the Governance Vault
      • AIP-27: Alpaca Insurance Plan Update
      • AIP-28: Updating Governance Voting Structure
      • AIP-29.1: Converting Remaining BUSD in AF1.0 lending into USDT
      • AIP-29.2: Charging conversion fees to the remaining BUSD depositors
      • AIP-29.3: Determining the conversion fees
      • AIP-30: New Product Proposal - Stablecoin
      • AIP-31.1 Handling of remaining assets in the AUSD’s stable swap module
      • AIP-31.2 Handling of remaining assets in the AUSD’s stable swap module
      • AIP-32: Distribution Plan to Lenders of Stablecoins from THE Liquidation
    • ⏭️Step-by-Step Guide
      • Lock ALPACA in Governance Vault
      • Lock more ALPACA/Extend Lock Time
      • Claim Rewards from Governance Vault
      • Add Custom tokens to your MetaMask
      • Vote on Alpaca Improvement Proposal (AIP)
      • Early Withdraw ALPACA from Governance Vault
      • Withdraw ALPACA from FANTOM Governance Vault on BNB Chain
      • Withdraw xALPACA from old Governance Vault
  • ALPIES
    • 🌗Introduction to Alpies
    • 🚋Bridging your Alpies
      • Bridging Alpies from ETH to BNB Chain
      • Bridging Alpies from BNB Chain to ETH
    • ⚡Boosted Leverage
  • Join the Herd (AlpaCareers)
    • 🚀Hiring Section
  • Help center
    • 👩‍🏫Alpaca Academy
      • Lesson 0 - How to Buy Alpaca and Start Earning Yields for Beginners(Lending+Staking)
      • Lesson 1 - Alpaca Finance’s Unique Use-Case — Shorting at a Profit
      • Lesson 2 - Introduction to Hedging with Double-Sided Borrowing
      • Lesson 3 - Liquidation Risk in Leveraged Yield Farming
      • Lesson 4 - Open/Close Positions With 0 Swap Fees
      • Lesson 5 - The Truth About Impermanent Loss and Common Misunderstandings
      • Proficiency Exams (earn NFTs)
    • 📚General Knowledge Articles
      • Navigating the Economic and Safety Landscape of DeFi
      • Yield Farming and Liquidity Mining: The Engines of DeFi Growth
      • Leveraging Advanced DeFi Instruments for Secured Funds Compounding with Alpaca Finance
      • Get Stablecoin Yields and Build Crypto Savings with Alpaca Finance's Lending Platform
      • Understanding the Basics of Decentralized Finance (DeFi)
      • Advanced Ways of Decentralized Trading with Alpaca Finance’s Perpetual Futures Exchange
      • Maximize Your Returns with Automated Vaults and Leveraged Yield Farming on Alpaca Finance
      • What does 'buy and hold' or HODL mean in investing?
      • What is DeFi Governance and why is it important?
      • What exactly are DeFi Money Markets?
      • What is yield farming and how does it differ from traditional investing?
      • What exactly does 'unlocking liquidity from long-term holdings' mean?
    • ❓FAQ
    • 🧰Useful Tools
    • 📘Terminologies & Calculation Methodology
      • 🧮APY Calculation
      • 📈Profit/Loss Calculation
    • ⚠️Common Error Messages
    • 💸Third-Party Earning Opportunities with ALPACA
  • Developers
    • 🐞Bug Bounty Program
    • 🎛️Protocol Configurations
    • 💻Integrating With Alpaca Finance
    • 🏛️AF2.0 Repurchasing Guide
    • ⚡AF2.0 Flashloan Guide
  • Past Products
    • 💵AUSD (Old)
      • 💵Introduction to AUSD
      • 💹How to Participate
      • 💦AUSD Liquidation
      • 〰️AUSD Price Stability Module
      • ❗Risks
      • ⏭️Step-by-Step Guide
        • Open an AUSD Position
        • Adjust an AUSD Position
        • Close/Partially Close an AUSD Position
        • Add/remove AUSD-3EPS LP tokens
        • Redeem AUSD for ALPACA
      • 📔AUSD Parameters
    • 🗳️Governance Vault (Old)
    • ⚡Early Withdrawal (Old)
    • 🌿Grazing Range (Old)
    • 💪Stronk Vault
Powered by GitBook
On this page
  • Design Ethos
  • Timelock
  • Multi-sig wallet
  • Adjustable Parameters
  • FairLaunch Contract
  • Vault Contract
  • PancakeswapWorker Contract
  • SimplePriceOracle Contract
  • SimpleVaultConfig
  • ConfigurableInterestVaultConfig
  • PancakeswapWorkerConfig

Was this helpful?

  1. Developers

Protocol Configurations

PreviousBug Bounty ProgramNextIntegrating With Alpaca Finance

Last updated 2 years ago

Was this helpful?

Design Ethos

We have designed many parameters in Alpaca Finance to be configurable. While the initial configurations are set by the core developer team, we have every intention to let the Governance community decide on what needs to be changed which will happen through voting.

Timelock

Timelock is a contract for delaying changes to the protocol. This contract is an owner of all the major contracts in Alpaca Finance. Hence, every change needs to execute through this contract, which makes it function as a security moat.

In essence, every order from the admin(the group of core developers) has to pass through this contract and is delayed for 24 hours before taking effect. To be specific, the execution command for the order goes to the queue, waiting to be executed when the 24h delay is passed. This is a security feature that enables the community to see any upcoming updates and prepare in advance for them. If anything looks suspicious, they can pull their funds from the protocol before the update takes effect.

Below are the contracts owned by Timelock

  • All Vault Contracts

  • FairLaunch Contract

  • All Worker Contracts

  • All PriceOracle Contracts

  • All WorkerConfig Contracts

Multi-sig wallet

As an added layer of security, we also employ a multi-sig wallet. Any changes to be queued into our Timelock contract need to be approved by a multi-sig, adding another layer of security.

There are currently 4 signers on the multi-sig with a minimum of 2 required to sign a transaction.

This section lists all adjustable parameters and functions in 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

Adjustable Parameters

🖌️
⏳
✏️
⚙️
🎛️
Page cover image