| title | Lending Protocol |
|---|---|
| description | Decentralized lending and borrowing protocol with credit scores and dynamic interest rates |
| icon | coins |
Decentralized lending and borrowing protocol with credit scores and dynamic interest rates on Paxeer Network.
Competitive yields On-chain reputation Multiple tokens **API Base URL:** `https://lending-api.paxeer.app`curl https://lending-api.paxeer.app/api/poolsRetrieves all available lending pools with current statistics.
curl https://lending-api.paxeer.app/api/poolsconst response = await fetch('https://lending-api.paxeer.app/api/pools');
const pools = await response.json();
console.log(pools);import requests
response = requests.get('https://lending-api.paxeer.app/api/pools')
pools = response.json()
print(pools)Response:
[
{
"assetAddress": "0xD0C1a714c46c364DBDd4E0F7b0B6bA5354460dA7",
"pTokenAddress": "0xE3Df3966007483e8076230e6E7AA381D3bAc52C0",
"symbol": "WETH",
"decimals": 18,
"totalSupplied": "209.119273268701533652",
"supplyApy": "5.21",
"borrowApy": "7.85"
}
]GET /api/user/:address
Get user-specific data including credit score and borrowing power.
User wallet addresscurl https://lending-api.paxeer.app/api/user/0x2fccd991Ecc9bEe62Bd10d751A5c5492e2a788C7const address = '0x2fccd991Ecc9bEe62Bd10d751A5c5492e2a788C7';
const response = await fetch(`https://lending-api.paxeer.app/api/user/${address}`);
const userData = await response.json();Response:
{
"address": "0x2fccd991Ecc9bEe62Bd10d751A5c5492e2a788C7",
"creditScore": 825,
"borrowingPower": "15000.0",
"amountBorrowed": "5000.0",
"availableToBorrow": "10000.0"
}Deposit assets into the lending pool to earn interest.
function deposit(
address asset,
uint256 amount
) externalExample:
import { ethers } from 'ethers';
const LENDING_POOL_ADDRESS = '0x...';
async function deposit(assetAddress, amount) {
const signer = await provider.getSigner();
// 1. Approve token spending
const token = new ethers.Contract(assetAddress, ERC20_ABI, signer);
const approveTx = await token.approve(LENDING_POOL_ADDRESS, amount);
await approveTx.wait();
// 2. Deposit
const lendingPool = new ethers.Contract(
LENDING_POOL_ADDRESS,
LENDING_POOL_ABI,
signer
);
const depositTx = await lendingPool.deposit(assetAddress, amount);
await depositTx.wait();
}Withdraw your deposited assets plus earned interest.
function withdraw(
address asset,
uint256 amount
) externalExample:
async function withdraw(assetAddress, amount) {
const signer = await provider.getSigner();
const lendingPool = new ethers.Contract(
LENDING_POOL_ADDRESS,
LENDING_POOL_ABI,
signer
);
const withdrawTx = await lendingPool.withdraw(assetAddress, amount);
await withdrawTx.wait();
}Borrow assets based on your credit score and collateral.
function borrow(
address asset,
uint256 amount
) externalExample:
async function borrow(assetAddress, amount) {
const signer = await provider.getSigner();
const lendingPool = new ethers.Contract(
LENDING_POOL_ADDRESS,
LENDING_POOL_ABI,
signer
);
const borrowTx = await lendingPool.borrow(assetAddress, amount);
await borrowTx.wait();
}Repay your borrowed amount to close or reduce your loan.
function repay(
address asset,
uint256 amount
) externalExample:
async function repay(assetAddress, amount) {
const signer = await provider.getSigner();
// 1. Approve token spending
const token = new ethers.Contract(assetAddress, ERC20_ABI, signer);
const approveTx = await token.approve(LENDING_POOL_ADDRESS, amount);
await approveTx.wait();
// 2. Repay
const lendingPool = new ethers.Contract(
LENDING_POOL_ADDRESS,
LENDING_POOL_ABI,
signer
);
const repayTx = await lendingPool.repay(assetAddress, amount);
await repayTx.wait();
}```javascript
const pools = await fetch('https://lending-api.paxeer.app/api/pools')
.then(res => res.json());
```
```javascript
const token = new ethers.Contract(assetAddress, ERC20_ABI, signer);
await token.approve(LENDING_POOL_ADDRESS, amount);
```
```javascript
const lendingPool = new ethers.Contract(
LENDING_POOL_ADDRESS,
LENDING_POOL_ABI,
signer
);
// Deposit
await lendingPool.deposit(assetAddress, amount);
// Or Borrow
await lendingPool.borrow(assetAddress, amount);
```
```javascript
const userData = await fetch(
`https://lending-api.paxeer.app/api/user/${userAddress}`
).then(res => res.json());
console.log('Credit Score:', userData.creditScore);
console.log('Borrowing Power:', userData.borrowingPower);
```
[
{
"inputs": [
{ "internalType": "address", "name": "asset", "type": "address" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"name": "deposit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "asset", "type": "address" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"name": "withdraw",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "asset", "type": "address" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"name": "borrow",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "asset", "type": "address" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"name": "repay",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]import { useState, useEffect } from 'react';
export function useLendingPools() {
const [pools, setPools] = useState([]);
const [loading, setLoading] = useState(true);
useEffect(() => {
async function fetchPools() {
try {
const response = await fetch('https://lending-api.paxeer.app/api/pools');
const data = await response.json();
setPools(data);
} catch (error) {
console.error('Error fetching pools:', error);
} finally {
setLoading(false);
}
}
fetchPools();
const interval = setInterval(fetchPools, 30000); // Refresh every 30s
return () => clearInterval(interval);
}, []);
return { pools, loading };
}
export function useUserLending(address: string) {
const [userData, setUserData] = useState(null);
const [loading, setLoading] = useState(true);
useEffect(() => {
if (!address) return;
async function fetchUserData() {
try {
const response = await fetch(
`https://lending-api.paxeer.app/api/user/${address}`
);
const data = await response.json();
setUserData(data);
} catch (error) {
console.error('Error fetching user data:', error);
} finally {
setLoading(false);
}
}
fetchUserData();
const interval = setInterval(fetchUserData, 30000);
return () => clearInterval(interval);
}, [address]);
return { userData, loading };
}Credit scores in the lending protocol range from 300 to 850 and affect:
Higher credit scores increase your maximum borrowing limit. Better credit scores result in lower borrowing rates. - Deposit assets consistently - Repay loans on time - Maintain healthy collateralization ratios Always ensure you: - Understand the risks of lending and borrowing - Monitor your health factor to avoid liquidation - Keep track of accruing interest - Maintain sufficient collateral Tips for success: - Start with small amounts to learn the protocol - Monitor APY changes regularly - Diversify across multiple assets - Set up alerts for health factor changes Complete API reference Get help from the community View our security audits View source code