Alien Finance
AppTwitter
  • General
    • Overview
    • What's Native on Blast
    • Brand Kit
  • Open Source
    • Blast Multisig Tx Builder
  • Lending Protocol - DApp Pool
    • Market Parameters
    • Interest Rate Model
    • Contract Address
  • Lending Protocol - Blast Pool
    • Market Parameters
    • Interest Rate Model
    • Contract Address
    • Alien Leverage
      • Leverage FAQ
  • Smart Contract
    • AlienFinance
      • Interface: AlienFinance
    • BlastPriceOracle
      • Interface: BlastPriceOracle
    • AlienFinanceLens
      • Interface: AlienFinanceLens
    • TripleSlopeRateModel
      • Interface: TripleSlopeRateModel
    • AToken
    • DebtToken
    • TxBuilderExtension
    • UniswapExtension
    • FlashLoan
  • Links
    • App
    • Twitter
Powered by GitBook
On this page
  1. Smart Contract
  2. AlienFinance

Interface: AlienFinance

0x50454acC07bf8fC78100619a1b68e9E8d28cE022

library DataTypes {
    struct UserBorrow {
        uint256 borrowBalance;
        uint256 borrowIndex;
    }

    struct MarketConfig {
        // 1 + 1 + 2 + 2 + 2 + 2 + 1 + 1 = 12
        bool isListed;
        uint8 pauseFlags;
        uint16 collateralFactor;
        uint16 liquidationThreshold;
        uint16 liquidationBonus;
        uint16 reserveFactor;
        bool isPToken;
        bool isDelisted;
        // 20 + 20 + 20 + 32 + 32 + 32
        address aTokenAddress;
        address debtTokenAddress;
        address interestRateModelAddress;
        uint256 supplyCap;
        uint256 borrowCap;
        uint256 initialExchangeRate;
    }

    struct Market {
        MarketConfig config;
        uint40 lastUpdateTimestamp;
        uint256 totalCash;
        uint256 totalBorrow;
        uint256 totalSupply;
        uint256 totalReserves;
        uint256 borrowIndex;
        mapping(address => UserBorrow) userBorrows;
        mapping(address => uint256) userSupplies;
    }
}

interface IAlienFinance {
    function accrueInterest(address market) external;

    function supply(address from, address to, address market, uint256 amount) external;

    function borrow(address from, address to, address asset, uint256 amount) external;

    function redeem(address from, address to, address asset, uint256 amount) external;

    function repay(address from, address to, address asset, uint256 amount) external;

    function deferLiquidityCheck(address user, bytes memory data) external;

    function getBorrowBalance(address user, address market) external view returns (uint256);

    function getATokenBalance(address user, address market) external view returns (uint256);

    function getSupplyBalance(address user, address market) external view returns (uint256);

    function isMarketListed(address market) external view returns (bool);

    function getExchangeRate(address market) external view returns (uint256);

    function getTotalSupply(address market) external view returns (uint256);

    function getTotalBorrow(address market) external view returns (uint256);

    function getTotalCash(address market) external view returns (uint256);

    function getTotalReserves(address market) external view returns (uint256);

    function transferAToken(address market, address from, address to, uint256 amount) external;
}

Last updated 1 year ago