Skip to main content

Overview

Pulend uses upgradeable proxy contracts built with OpenZeppelin and Foundry.

LendingPool

The main contract managing collateral, borrowing, and liquidations. Address: 0x848fDD471ebad6CFD8AfBfB58ba243782AD9201C

User Functions

// Deposit IP asset as collateral
function supplyCollateral(uint256 tokenId) external;

// Withdraw IP asset (requires healthy position)
function withdrawCollateral(uint256 tokenId) external;

// Borrow tokens against collateral
function borrow(uint256 amount) external;

// Repay borrowed amount
function repay(uint256 amount) external;

// Supply liquidity to earn interest
function supplyLiquidity(uint256 amount) external;

// Withdraw supplied liquidity
function withdrawLiquidity(uint256 shares) external;

View Functions

// Get user's collateral token IDs
function userCollateralTokenIds(address user) external view returns (uint256[]);

// Get user's borrow balance
function userBorrowAssets(address user) external view returns (uint256);

// Get user's supply shares
function userSupplyShares(address user) external view returns (uint256);

// Get total supply/borrow
function totalSupplyAssets() external view returns (uint256);
function totalBorrowAssets() external view returns (uint256);

Events

EventDescription
SupplyCollateralIP asset deposited as collateral
WithdrawCollateralIP asset withdrawn
BorrowTokens borrowed
RepayLoan repaid
SupplyLiquidityLiquidity supplied
WithdrawLiquidityLiquidity withdrawn
LiquidationPosition liquidated

InterestRateModel

Calculates dynamic interest rates based on utilization. Address: 0xa89Ff50f77A59D6a175c738C3F705B5401BcEbc0
function calculateBorrowRate(
    address lendingPool
) external view returns (uint256);

function calculateSupplyRate(
    address lendingPool
) external view returns (uint256);

IsHealthy

Helper contract to check position health. Address: 0x1A3A49275849dc29949d3308c09a11766fA1b087
function isHealthy(
    address user,
    address lendingPool
) external view returns (bool);

Router

Entry point for batched operations. Address: 0xf97Ff4Cc8b0B8a68c23bdEB932760C8d5CEe2fd3

ABIs

Contract ABIs are available in:
  • Frontend: frontend/lib/abis/
  • Indexer: indexer/abis/