Alluo Explained
  • Welcome
    • 🧭 The Basics
  • Getting Started
    • πŸ’» The DeFi Web App
      • ❓ Connecting to the app
      • 🚜 Depositing into the farms
      • πŸ™Œ Other basics
      • 🏦 Importing your Mobile app wallet to Metamask
      • 🧬 Add the polygon network manually in Metamask.
      • ⛓️ Bridging Stablecoins from another chain
    • πŸ“±The Mobile app
      • πŸ—οΈ Setting up your account
      • 🏦 Depositing money into the app
      • πŸ™Œ Other basics
      • πŸ” Exporting your private key
    • πŸ“–Tech deep dive: Contract Address Library
  • Understanding Alluo
    • πŸ’΅ How does Alluo get the yield?
      • 🐰 Going deeper into the Alluo protocol rabbit hole
    • 🧐 FAQ
  • Tokens & Tokenomics
    • πŸͺ™ The tokens
    • πŸ‘¨β€πŸ”¬Tech deep dive: Interest Bearing {asset} token
      • Depositing
      • Withdrawals
      • IbAlluo on different chains
      • StIbAlluo and Superfluid
        • A closer look at the integration between IbAlluo and StIbAlluo
      • Using the IbAlluo contract directly to create streams
      • Liquidity Handler and adapters
        • Deposit process with the Liquidity Handler
        • Withdraw process with the Liquidity Handler
    • πŸ“ˆ Tokenomics
    • πŸ‘¨β€πŸ”¬Tech deep dive: Boosting yield by compounding rewards
      • Deposit into the Vault
      • Withdraw from the Vault
      • Redeem rewards
      • Automatic boosting with Alluo
      • FraxConvex Vaults
      • Managing withdrawal requests in IERC4626
  • Decentralisation and Trust
    • πŸ—³οΈ Trustless governance and execution
    • πŸ‘¨β€πŸ”¬Tech deep dive: Vote Executor Architecture
      • Off chain votes to on chain data
      • Onchain data verifcation
      • Automated execution of votes
        • Tokenomics
        • Liquidity Direction
        • Setting APYs on farms
      • Cross chain execution of votes
      • Manually submitting vote results onchain
    • ↔️Alluo Exchange
      • Interacting with the Exchange
    • vlAlluo Architecture
    • Contracts upgrades
    • Investment strategies
      • πŸ“ˆFrax Convex Finance
        • Adding new pools into the strategy
        • Investing into a pool
  • More Advanced Features
    • πŸ” Repeat payments, streaming IbAlluo
  • Product Updates
    • πŸ‘Œ Product Roadmap: Building the right products
    • πŸ’» Web App releases
    • πŸ“± Mobile App releases
    • 🏎️ Alluo Boost
  • tutorial projects
    • Example: USDC to streaming 1 IbAlluo per second
    • Example: Using IbAlluoUSD and Ricochet to do capital efficient DCA into ETH
Powered by GitBook
On this page
  • Setting APYs on Ethereum Mainnet farms
  • Setting APYs on Layer 2 farms
  1. Decentralisation and Trust
  2. Tech deep dive: Vote Executor Architecture
  3. Automated execution of votes

Setting APYs on farms

From Ethereum Mainnet to layer 2 contracts...

PreviousLiquidity DirectionNextCross chain execution of votes

Last updated 2 years ago

At the point when the vote is executed on Ethereum mainnet, information about APYs to be set on the farms are passed through the mainnet farms as well as polygon farms

Setting APYs on Ethereum Mainnet farms

A vote such as below dictates how much APY to set for our IbAlluoXXX farm. Then on chain, we immediately set the interest rate to the approved APY.

VoteExecutorMaster.sol
if (commandIndex == 0) {
    (
        string memory ibAlluoSymbol,
        uint256 newAnnualInterest,
        uint256 newInterestPerSecond
    ) = abi.decode(
       messages[j].commandData,
       (string, uint256, uint256)
        );
     IIbAlluo ibAlluo = IIbAlluo(
       ibAlluoSymbolToAddress[ibAlluoSymbol]
     );
     if (ibAlluo.annualInterest() != newAnnualInterest) {
        ibAlluo.setInterest(
                 newAnnualInterest,
                 newInterestPerSecond
                );
        }
} 

Setting APYs on Layer 2 farms

Today we have farms on Polygon and Optimism. Setting APYs on these through a decentralised process requires two steps

  1. Execute the vote on Ethereum mainnet and then use a cross-chain messaging protocol such as AnyCall (Multichain).

IAnyCall(crossChainInfo.anyCallAddress).anyCall(
                crossChainInfo.nextChainExecutor,
                finalData,
                address(0),
                crossChainInfo.nextChain,
                0
         );
  1. On receipt of the cross chain data on layer 2 (ex. Polygon), set the APY.

if (currentMessage.commandIndex == 0) {
                (
                    string memory ibAlluoSymbol,
                    uint256 newAnnualInterest,
                    uint256 newInterestPerSecond
                ) = abi.decode(
                        currentMessage.commandData,
                        (string, uint256, uint256)
                    );
                _changeAPY(
                    newAnnualInterest,
                    newInterestPerSecond,
                    ibAlluoSymbol
                );
            }
πŸ‘¨β€πŸ”¬
https://vote.alluo.com/#/proposal/0x3923acef8207d12525c51adbabd5fca2e82f52ed58e5c2b5ae0ab12f1f723b11