API
The JUST API provides two groups of endpoints.
Market Data - Endpoints relating to Supply and Borrow Markets, sTRX Staking Markets
Activity - Endpoints relating to user interactions with Supply and Borrow Markets, sTRX Staking Markets and Energy Rental Markets
Base URL
The JustLend Protocol API is decentralized and hosted on IPFS, mapping the following DNS names to their respective gateways:
Mainnet: https://openapi.just.network Testnet: https://testopenapi.just.network
Endpoint Details
Market Endpoints
Get Supply and Borrow Market Information
GET
/lend/jtoken
Returns the list of market information.
Parameters
No parameters.
Responses
{
"code": 0,
"data": {
"tokenList": [
{
"address": "TE2RzoSV3wFK99w6J9UnnZ4vLfXYoxvRwP",
"borrowIndex": "1224530412174750380",
"borrowRate": "0.064673716541040000",
"cash": "349909392.537020000000000000",
"collateralFactor": "0.750000000000000000",
"exchangeRate": "0.010448063811832339",
"reserveFactor": "0.100000000000000000",
"reserves": "2300647.881336000000000000",
"supplyRate": "0.009044500002192000",
"symbol": "jTRX",
"totalBorrows": "63951044.565948000000000000",
"totalSupply": "39391010299.49149122",
"underlyingAddress": "T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb",
"underlyingDecimal": 6,
"underlyingPriceInTrx": "1.000000000000000000000000",
"underlyingSymbol": "TRX"
},
...
]
},
"message": "SUCCESS"
}
Get sTRX Staking and Energy Rental Markets Information
GET
/lend/strx
Returns the sTRX staking and energy rental markets information.
Parameters
No parameters.
Responses
{
"code": 0,
"data": {
"rentInfo": {
"priceFor10KEnergByBurn": "4.20000000",
"priceFor10KEnergByRent": "0.62942700",
"priceFor10KEnergByStake": "751.26757603",
"rentMarketAddress": "TU2MJ5Veik1LRAgjeSzEdvmDYx7mefJZvd",
"totalDelegatedEnergyRate": "0.09000960",
"totalDelegatedEnergyTrx": "44655753.977400"
},
"stakeInfo": {
"decimal": "18",
"exchangeRate": "1.066512539052733131",
"rentReserveFactor": "0.200000000000000000",
"reserves": "6388303.396213",
"rewardReserveFactor": "0.200000000000000000",
"strxAddress": "TU3kjFuhtEo42tsCBtfYUAZxoqQ4yuSLQ5",
"supplyRate": "0.05523306",
"symbol": "sTRX",
"totalSupply": "465151516.636180968215445743",
"totalSupplyUsd": "60500822.89916245",
"totalUnderlying": "496089925.051883",
"trxPrice": "0.121955354954719223",
"underlyingDecimal": "6"
}
},
"message": "SUCCESS"
}
Activity
Get Account Information
GET
/lend/account
Returns the list of user account information.
Parameters
Query
addresses String Query of the addresses list
minBorrowValueInTrx String Query the minimum value of borrowed asset in TRX
mathHealth String Query the max health level
pageNo Int Page number
pageSize Int Page size, maximum 1000
Responses
{
"code": 0,
"data": {
"tokenList": [
{
"address": "TE2RzoSV3wFK99w6J9UnnZ4vLfXYoxvRwP",
"borrowIndex": "1224530412174750380",
"borrowRate": "0.064673716541040000",
"cash": "349909392.537020000000000000",
"collateralFactor": "0.750000000000000000",
"exchangeRate": "0.010448063811832339",
"reserveFactor": "0.100000000000000000",
"reserves": "2300647.881336000000000000",
"supplyRate": "0.009044500002192000",
"symbol": "jTRX",
"totalBorrows": "63951044.565948000000000000",
"totalSupply": "39391010299.49149122",
"underlyingAddress": "T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb",
"underlyingDecimal": 6,
"underlyingPriceInTrx": "1.000000000000000000000000",
"underlyingSymbol": "TRX"
},
...
]
},
"message": "SUCCESS"
}
Get user data of sTRX liquidity staking
GET
/lend/strxStake/account
Returns the list of user sTRX staking information.
Parameters
Query
addresses String Query of the addresses list
pageNo Int Page number, starting from 1
pageSize Int Page size
minStrxBalance String Minimum amount of sTRX held
Responses
{
"code": 0,
"data": {
"totalPage": 61,
"list": [
{
"address": "TU3kjFuhtEo42tsCBtfYUAZxoqQ4yuSLQ5",
"availableWithdrawAmount": "150865439.643028",
"unstakingAmount": "5839206.921368",
"sTRXBalance": "1.000000000000000000"
},
{
"address": "TUTde1uYe37xK6G4k3EkxiHheHkNxka1Yo",
"availableWithdrawAmount": "1.000000",
"unstakingAmount": "0.000000",
"sTRXBalance": "99.000000000000000000"
},
{
"address": "TXU8sXdSJYzhMrxWKQmoEXffvaWcFXbQXE",
"availableWithdrawAmount": "0.000007",
"unstakingAmount": "0.000000",
"sTRXBalance": "10.850239779339813291"
},
...
],
"totalCount": 3029
},
"message": "SUCCESS"
}
Get user data of resource rent (only supports Energy Rental currently)
GET
/lend/rentResource/account
Returns the list of user energy rental information.
Parameters
Query
addresses String Query of the addresses list
pageNo Int Page number, starting from 1
pageSize Int Page size
minStrxBalance String Minimum amount of sTRX staked
maxRemainingRentAmount String Maximum remaining rent
Responses
{
"code": 0,
"data": {
"totalPage": 847,
"list": [
{
"rentRemainAmount": "0.000000",
"receiver": "TWdWEHRLPBVGsXhwjSUv45XwnsfUHXydJa",
"delegatedAmount": "0.000000",
"rentAmountPerDay": "0.000000",
"rentType": "Energy",
"renter": "TWdWEHRLPBVGsXhwjSUv45XwnsfUHXydJa"
},
{
"rentRemainAmount": "0.000000",
"receiver": "TFTosnoA2Th26qezdxmXMEsLrEerstzzHm",
"delegatedAmount": "0.000000",
"rentAmountPerDay": "0.000000",
"rentType": "Energy",
"renter": "TFTosnoA2Th26qezdxmXMEsLrEerstzzHm"
},
{
"rentRemainAmount": "0.000000",
"receiver": "TMvjdJCDj619ihifGLnKSLBx9Xf1oqck3C",
"delegatedAmount": "0.000000",
"rentAmountPerDay": "0.000000",
"rentType": "Energy",
"renter": "TMvjdJCDj619ihifGLnKSLBx9Xf1oqck3C"
},
...
],
"totalCount": 42310
},
"message": "SUCCESS"
}
Last updated