Lend Asset Detail Endpoint
GET /mm/asset/detail?chainId=146&symbol=USDC
GET /mm/asset/detail?chainId=146&symbol=USDC&user=0xYourAddress
Param
Required
Description
chainId
yes
Blockchain ID (146 = Sonic)
symbol
yes
Token symbol (case-insensitive): USDC, wS
user
no
Wallet address — when provided, response includes userData
interface LendAssetDetail {
address : string ; // token contract address
symbol : string ; // e.g. "USDC"
name : string ; // e.g. "USD Coin"
decimals : number ;
chainId : number ;
chainName : string ; // e.g. "Sonic"
isSuppliable : boolean ; // collateral enabled on-chain
isBorrowable : boolean ; // always true for lending tokens
supplyApyPct : number ; // supply APY as percentage, e.g. 4.02
borrowApyPct : number ; // borrow APY as percentage, e.g. 5.13
tokenprice : number ; // USD price float, e.g. 1.0
tokenPriceChange : number ; // absolute 24h change in USD
tokenPriceChangePct : number ; // percentage 24h change
metrics : LendAssetMetrics ;
series : LendAssetSeries ;
userData : LendAssetUserData | null ; // null when no user param
}
interface LendAssetMetrics {
totalDeposited : number ; // native units (cash + borrows)
totalDepositedUsd : number ; // USD value
totalDepositedChange : number ; // 24h change percentage
totalBorrowed : number ; // native units
totalBorrowedUsd : number ;
totalBorrowedChange : number ; // 24h change percentage
totalAvailable : number ; // native units (cash)
totalAvailableUsd : number ;
}
interface LendAssetSeries {
price : LendSeriesPoint [ ] ; // USD price over 30d
depositApy : LendSeriesPoint [ ] ; // supply APY % over 30d
borrowApy : LendSeriesPoint [ ] ; // borrow APY % over 30d
totalAvailable : LendSeriesPoint [ ] ; // available USD over 30d
}
interface LendSeriesPoint {
timestamp : number ; // unix seconds
value : number ; // float
}
interface LendAssetUserData {
walletBalance : number ; // native units in wallet
walletBalanceUsd : number ;
deposited : number ; // native units deposited as collateral
depositedUsd : number ;
borrowed : number ; // native units of debt
borrowedUsd : number ;
activity : LendActivityItem [ ] ;
}
interface LendActivityItem {
action : "deposit" | "withdraw" | "borrow" | "repay" ;
amount : number ; // native units
amountUsd : number ;
timestamp : number ; // unix seconds
txHash : string ;
}
Usage in useLendAsset.tsx
const fetchLendAssetDetail = async (
chainId : number ,
symbol : string ,
user ?: string
) : Promise < LendAssetDetail > => {
const params = new URLSearchParams ( { chainId : String ( chainId ) , symbol } ) ;
if ( user ) params . set ( "user" , user ) ;
const res = await fetch ( `${ API_BASE } /mm/asset/detail?${ params } ` ) ;
if ( ! res . ok ) throw new Error ( await res . text ( ) ) ;
const json = await res . json ( ) ;
return json . data ; // wrapped in { success: true, data: ... }
} ;
All numeric values are number (float64) — no string parsing needed
Series data covers 30 days at 1-hour intervals
userData is null when user param is omitted; when provided and the user has no positions, fields are 0 with an empty activity array
APY values (supplyApyPct, borrowApyPct, series depositApy/borrowApy) are percentages (e.g. 4.02 means 4.02%)
totalDepositedChange and totalBorrowedChange are 24h percentage changes
Price/metrics use on-chain data as primary source with Redis snapshots as fallback
Supported tokens on Sonic (chainId=146): USDC, wS
Error responses: { "success": false, "message": "..." } with HTTP 400