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
  1. tutorial projects

Example: USDC to streaming 1 IbAlluo per second

This example will walk through how to start with USDC and end up streaming 1 IbAlluo per second to a certain address directly through the IbAlluo contract without ever interacting with the StIbAlluo contract.

Polygon + Ethers + Hardhat
// First we will deposit 1000 USDC into the IbAlluo contract and
// receive IbAlluos.
let yourAddress= "";
let recipientAddress="";
let ibAlluoUSD = await ethers.getContractAt("IbAlluo", "0xC2DbaAEA2EfA47EBda3E572aa0e55B742E408BF6");
const usdc = "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174";
let amount = parseEther(1000);
await ibAlluoUSD.deposit(usdc, amount);

// Now grant permissions to the IbAlluo contract to create streams on your behalf
// You only need to do this once for each IbAlluo contract when you first make a stream.
let encodeData = await ibAlluoCurrent.formatPermissions();
let superhost = await ethers.getContractAt("Superfluid", "0x3E14dC1b13c488a8d5D310918780c983bD5982E7");
await superhost.connect(signers[1]).callAgreement(
    "0x6EeE6060f715257b970700bc2656De21dEdF074C",
    encodeData,
    "0x"
)

// Now create the actual flow for 1 IbAlluo per second. The last parameter is the
// amount of IbAlluos you want to wrap into StIbAlluos. We recommend wrapping
// your entire balance.
let currentBalance = await ibAlluoUSD.combinedBalanceOf(yourAddress);
// If you only want to wrap 800 IbAlluos.
await ibAlluoUSD.createFlow(recipientAddress, parseEther("1"), parseEther("800"))
// Or if you want to wrap your entire balance
await ibAlluoUSD.createFlow(recipientAddress, parseEther("1"), currentBalance)

... and you're finished! You will now have a stream for 1 IbAlluo/ second to the recipient address.

Previous🏎️ Alluo BoostNextExample: Using IbAlluoUSD and Ricochet to do capital efficient DCA into ETH

Last updated 2 years ago