Markets
Get Market Metrics
Read live pool metrics directly from the market contract
GET
/
lending-external-securities
/
api
/
markets
/
{marketId}
/
metrics
curl "https://api.trusset.org/lending-external-securities/api/markets/{marketId}/metrics" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities/api/markets/${marketId}/metrics`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
if (!data.isOnChain) throw new Error('Market metrics unavailable');
console.log(`Borrow APR ${(Number(data.borrowRate) / 100).toFixed(2)}%`);
{
"success": true,
"data": {
"isOnChain": true,
"paused": false,
"liquidationContract": "0x067a3FeEA46649AdAd8e31c33B3a4D8774b8d8cF",
"totalDeposits": "1000000.000000",
"totalBorrows": "250000.000000",
"availableLiquidity": "750000.000000",
"utilizationRate": "2500",
"borrowRate": "450",
"supplyRate": "84",
"totalShares": "1000000.000000000000000000",
"totalCollateral": "5000.000000000000000000",
"activeLoans": 4,
"totalLoansCreated": 11,
"activeAuctions": 0,
"totalAuctions": 0,
"pendingLiquidations": 0,
"pendingLiquidationDebt": "0.000000"
}
}
{
"success": true,
"data": {
"isOnChain": false,
"totalDeposits": "0",
"totalBorrows": "0",
"availableLiquidity": "0",
"utilizationRate": "0",
"borrowRate": "200",
"supplyRate": "0",
"pendingLiquidations": 0,
"pendingLiquidationDebt": "0"
}
}
{
"success": false,
"error": {
"code": "NO_MARKET_ADDRESS",
"message": "No on-chain address"
}
}
Returns current liquidity, borrows, utilization, rates, and liquidation counters read from the chain at request time. This is the endpoint to poll for a live market dashboard.
Path Parameters
string
required
Market ID.
Response Fields
object
Show child attributes
Show child attributes
boolean
Whether the contract read succeeded. When
false, every other field is a placeholder and must not be displayed as real data.boolean
Whether the market contract is paused.
string
Liquidation router the market is wired to, or
null if unreadable.string
Total supplied liquidity, in borrow asset units.
string
Total outstanding principal, in borrow asset units.
string
Liquidity available for new borrows, in borrow asset units.
string
Utilization in basis points.
2500 is 25 percent.string
Annualized borrow rate in basis points.
string
Annualized supply rate in basis points, net of the 25 percent reserve factor.
string
Total LP shares outstanding, always formatted at 18 decimals regardless of the borrow asset.
string
Total collateral locked, in collateral token units.
integer
Loans currently in
ACTIVE status.integer
Lifetime loan counter from the contract.
integer
Dutch auctions currently accepting bids.
integer
Lifetime auction counter from the contract.
integer
Liquidations seized but not yet settled or written off.
string
Debt awaiting settlement proceeds, in borrow asset units.
When the RPC is unavailable the endpoint returns
200 with isOnChain: false rather than an error status. Branch on isOnChain before rendering any figure.Rate Derivation
borrowRate is taken from the market’s interest model when the contract reports a non-zero rate, and computed from the current utilization curve otherwise. supplyRate is always derived as borrowRate * utilization * 0.75, reflecting the protocol reserve factor of 25 percent. Both are basis points, so divide by 100 to get a percentage.
curl "https://api.trusset.org/lending-external-securities/api/markets/{marketId}/metrics" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities/api/markets/${marketId}/metrics`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
if (!data.isOnChain) throw new Error('Market metrics unavailable');
console.log(`Borrow APR ${(Number(data.borrowRate) / 100).toFixed(2)}%`);
{
"success": true,
"data": {
"isOnChain": true,
"paused": false,
"liquidationContract": "0x067a3FeEA46649AdAd8e31c33B3a4D8774b8d8cF",
"totalDeposits": "1000000.000000",
"totalBorrows": "250000.000000",
"availableLiquidity": "750000.000000",
"utilizationRate": "2500",
"borrowRate": "450",
"supplyRate": "84",
"totalShares": "1000000.000000000000000000",
"totalCollateral": "5000.000000000000000000",
"activeLoans": 4,
"totalLoansCreated": 11,
"activeAuctions": 0,
"totalAuctions": 0,
"pendingLiquidations": 0,
"pendingLiquidationDebt": "0.000000"
}
}
{
"success": true,
"data": {
"isOnChain": false,
"totalDeposits": "0",
"totalBorrows": "0",
"availableLiquidity": "0",
"utilizationRate": "0",
"borrowRate": "200",
"supplyRate": "0",
"pendingLiquidations": 0,
"pendingLiquidationDebt": "0"
}
}
{
"success": false,
"error": {
"code": "NO_MARKET_ADDRESS",
"message": "No on-chain address"
}
}
⌘I
curl "https://api.trusset.org/lending-external-securities/api/markets/{marketId}/metrics" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities/api/markets/${marketId}/metrics`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
if (!data.isOnChain) throw new Error('Market metrics unavailable');
console.log(`Borrow APR ${(Number(data.borrowRate) / 100).toFixed(2)}%`);
{
"success": true,
"data": {
"isOnChain": true,
"paused": false,
"liquidationContract": "0x067a3FeEA46649AdAd8e31c33B3a4D8774b8d8cF",
"totalDeposits": "1000000.000000",
"totalBorrows": "250000.000000",
"availableLiquidity": "750000.000000",
"utilizationRate": "2500",
"borrowRate": "450",
"supplyRate": "84",
"totalShares": "1000000.000000000000000000",
"totalCollateral": "5000.000000000000000000",
"activeLoans": 4,
"totalLoansCreated": 11,
"activeAuctions": 0,
"totalAuctions": 0,
"pendingLiquidations": 0,
"pendingLiquidationDebt": "0.000000"
}
}
{
"success": true,
"data": {
"isOnChain": false,
"totalDeposits": "0",
"totalBorrows": "0",
"availableLiquidity": "0",
"utilizationRate": "0",
"borrowRate": "200",
"supplyRate": "0",
"pendingLiquidations": 0,
"pendingLiquidationDebt": "0"
}
}
{
"success": false,
"error": {
"code": "NO_MARKET_ADDRESS",
"message": "No on-chain address"
}
}
