Skip to main content

Lending API

Endpoints for lending, borrowing, and managing DeFi lending positions.

Supported protocols

EVM: aave, compound, euler, morpho, venus (multi-chain). Solana: kamino (chain ID 999). For Solana, pass protocol: "kamino", chainId: 999, SPL mint addresses, and a base58 wallet address. Solana lending endpoints return a base64-encoded transaction to sign.

Supply & Withdraw

Supply Assets

POST /lending/supply

Deposit assets into a lending protocol to earn interest.

Request Body:

FieldTypeRequiredDescription
chainIdnumberYesChain ID (use 999 for Solana)
protocolstringYesLending protocol (aave, compound, euler, morpho, venus, kamino)
tokenAddressstringYesToken to supply (EVM address or SPL mint)
amountstringYesAmount to supply
walletAddressstringYesUser wallet address (EVM or Solana)

Withdraw Assets

POST /lending/withdraw

Withdraw supplied assets from a lending protocol.

Request Body:

FieldTypeRequiredDescription
chainIdnumberYesChain ID
protocolstringYesLending protocol
tokenAddressstringYesToken to withdraw
amountstringYesAmount to withdraw
walletAddressstringYesUser wallet address

Borrowing

Borrow Assets

POST /lending/borrow

Borrow assets against supplied collateral.

Request Body:

FieldTypeRequiredDescription
chainIdnumberYesChain ID
protocolstringYesLending protocol
tokenAddressstringYesToken to borrow
amountstringYesAmount to borrow
walletAddressstringYesUser wallet address

Repay Loan

POST /lending/repay

Repay borrowed assets.

Request Body:

FieldTypeRequiredDescription
chainIdnumberYesChain ID
protocolstringYesLending protocol
tokenAddressstringYesToken to repay
amountstringYesAmount to repay
walletAddressstringYesUser wallet address

Position Management

Get User Positions

GET /lending/getUserPositions

Retrieve all lending positions for a user.

Query Parameters:

ParameterTypeRequiredDescription
walletAddressstringYesUser wallet address
chainIdnumberYesChain ID
protocolstringNoFilter by protocol

Response:

{
"positions": [
{
"protocol": "aave",
"tokenAddress": "0x...",
"symbol": "USDC",
"balance": "1000.00",
"assetsUsd": "1000.00",
"APY": "4.52",
"isCollateral": true,
"collateralFactor": "0.80"
}
]
}

Get Reserve List

GET /lending/getReserveList

Retrieve available lending reserves and their current rates.

Query Parameters:

ParameterTypeRequiredDescription
chainIdnumberYesChain ID
protocolstringYesLending protocol

Set Collateral

POST /lending/setReserveAsCollateral

Enable or disable an asset as collateral.

Request Body:

FieldTypeRequiredDescription
chainIdnumberYesChain ID
protocolstringYesLending protocol
tokenAddressstringYesToken address
useAsCollateralbooleanYesEnable/disable collateral

Get Borrowable Assets

GET /lending/getBorrowableAssets

Get a list of assets available for borrowing.


Get Max Borrow Amount

GET /lending/getMaxBorrowAmount

Calculate the maximum amount a user can borrow based on their collateral.


Refresh User Positions

GET /lending/refreshUserPositions

Force a refresh and sync of user lending positions from on-chain data.


Get Market List

GET /lending/getMarketList

Retrieve available lending markets for a protocol/chain with supply and borrow rates (supports pagination).


Get Lending List Bundle

GET /lending/getLendingListBundle

Fetch reserves, user positions, borrowable assets, and borrowed assets in a single call. (Long-running; allow up to ~60s.)


Get Borrowed Assets List

GET /lending/getBorrowedAssetsList

Retrieve the user's current borrowed positions.


Sync Reserves

POST /lending/syncReserves

Sync all reserves for a user.

Protocol-Specific Endpoints

MethodPathPurpose
GET/lending/morpho/marketListMorpho market list
GET/lending/morpho/checkLtvCheck loan-to-value for a Morpho market
GET/lending/morpho/isAuthorisedCheck Morpho authorization status
POST/lending/morpho/setAuthorisationSet Morpho authorization
GET/lending/euler/checkLtvCheck loan-to-value for an Euler vault
GET/lending/getCollateralTokensCollateral tokens (Compound V3)
GET/lending/exitMarketExit a market (Venus)
GET/lending/getAggregatedLendingDataAggregated lending data across protocols for a token