Skip to content

olsemeno/alfaAPY

Repository files navigation

Alfa APY

Introduction: https://youtu.be/ldqRNLbQflI Current progress: https://www.youtube.com/watch?v=Vb0YfFJg770

The AlfaAPY is the first yield optimization DeFi protocol built on the Internet Computer Protocol (ICP) utilizing ckBTC, similar to Yearn Finance on Ethereum. The protocol automatically maximizes returns for users by finding the highest-yielding liquidity pools and dynamically reallocating assets to optimize yield.

Description

The AlfaAPY is designed to solve the challenge of finding and utilizing the best yield opportunities in the ICP ecosystem. The protocol continuously monitors APY across various liquidity pools from different DeFi providers like KongSwap, ICPSwap, and others. When a higher-yielding opportunity is detected, it automatically rebalances funds to maximize returns.

With an easy-to-use interface for managing investments and tracking performance, users can effortlessly monitor their yield optimization strategies while leveraging the power of ckBTC for efficient cross-chain transactions and yield generation.

Interface

The AlfaAPY interface provides an intuitive and user-friendly experience for managing your yield optimization strategies.

How It Works

  1. Deposit: Users deposit assets (ckBTC, ICP, etc.) into their chosen strategy.
  2. Monitoring: Protocol tracks APY across various liquidity pools.
  3. Rebalancing: Funds automatically move to higher-yielding pools.
  4. Withdrawal: Users can withdraw assets with accumulated yield anytime.

Features

  • Automated Yield Optimization: Automatically moves assets between liquidity pools and providers to maximize APY.
  • Multiple Asset Strategies: Supports various assets including ckBTC, ICP, and stablecoin pairs.
  • Multiple Providers: Integrates with various DeFi providers on ICP, including Kongswap and ICPSwap.
  • Non-custodial: Users maintain control of their assets while benefiting from optimization.
  • Secure and Transparent: Built on the secure and transparent infrastructure of ICP.
  • Low Fees: Minimal fees compared to manual rebalancing due to efficient ckBTC transactions.

Architecture

AlfaAPY is built on a modular architecture with the following components:

Core Components

  • Vault: Main entry point for user deposits and withdrawals.
  • Strategies: Asset-specific implementations for yield optimization.
  • Liquidity Service: Handles interactions with liquidity pools.
  • Swap Service: Manages token swaps between different assets.
  • Repository: Manages persistent state and strategy data.

Documentations

Technologies

Backend

  • Rust: Primary programming language
  • Internet Computer Protocol (ICP): Blockchain platform
  • Candid: Interface description language for ICP
  • ICRC-1/ICRC-2: Token standards for asset handling
  • KongSwap/ICPSwap: DEX integrations for liquidity provision and swaps

Frontend

  • TypeScript: Frontend programming language
  • Vite: Build tool and development server
  • React: UI framework
  • @dfinity packages: Internet Computer SDK
  • @nfid/identitykit: Authentication integration
  • @reduxjs/toolkit: State management
  • TailwindCSS: Utility-first CSS framework

Getting Started

Prerequisites

Ensure you have the following tools installed before diving into development:

  • Rustup ^v1.27.1
  • DFX ^v0.24.0
  • jq ^1.6

⚠️ Note: These versions are specific for compatibility with the Internet Computer SDK.


Launch Local DFX

Begin by starting a local DFX instance:

dfx start --background --clean

Deploy Vault

To deploy the vault canister with the specified ID, run:

dfx deploy vault --no-wallet --specified-id "ownab-uaaaa-aaaap-qp2na-cai"

Unit Tests

Run Unit Tests

cargo test --lib

Integration Tests

Prerequisites

Install these dependencies before testing:

  • NodeJS ^v20.16.0
  • Yarn ^v1.22.22

Run Integration Tests

To run the integration tests, use:

npm i && npm run test

License

This project is licensed under the MIT License - see the LICENSE file for details.

Source code

Links

About

alfaAPY

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors