Polystream
  • Overview
  • Getting Started
    • The Crypto Problem
  • Polystream
    • Polystream Vaults
    • ERC4337 Smart Account Wallets
    • Crypto-Fiat Ramp
    • Rewards
    • AI Agents
    • Foundry
  • Smart Contracts
    • Adapter
    • Core
    • Strategy
    • Polystream Contract Address
  • Project Architecture
    • Sequence Diagram
    • Cranker
  • Developer Contributions
  • Others
    • Socials
    • Feedback
Powered by GitBook
On this page
  1. Smart Contracts

Adapter

PreviousSmart ContractsNextCore

Last updated 2 months ago

Purpose

  • Uniform Interface: Adapters implement the IProtocolAdapter interface, providing a consistent set of functions regardless of underlying protocol differences.

  • Simplified Interaction: They allow Polystream to interact seamlessly with multiple DeFi protocols without dealing directly with each protocol's unique implementations.

  • Yield Management: Adapters handle yield harvesting, compounding, and fee management, simplifying profit calculations and risk management.

Key Components and Functionalities

Defines the standardized interface that all adapters must implement, including methods to:

  • Supply and withdraw assets.

  • Harvest and compound yields.

  • Convert platform fees to rewards.

  • Retrieve APY, balances, and principal data.

Specific adapter for interacting with the Aave lending protocol:

  • Handles supplying and withdrawing of assets to/from Aave pools.

  • Harvests yield by withdrawing accrued interest and redepositing it, thereby compounding returns.

  • Manages the conversion of fees into yield, tracks principal deposits, and calculates APY from Aave's interest rate models.

Adapter specifically designed for LayerBank protocol:

  • Manages asset deposits, withdrawals, and yield harvesting on LayerBank.

  • Implements advanced handling, including error management for different redeem methods.

  • Calculates APY based on LayerBank’s rate models, compounding yields by harvesting interest regularly.

IProtocolAdapter.sol
AaveAdapter.sol
LayerBankAdapter.sol