Price Oracle¶
About this page
- Protocol: JustLend
- Network:* TRON Mainnet
- Pattern:
PriceOracleProxy(entrypoint,TGnYnSn4G9PgWFj7QQemh4YMZKp3fkympJ) →PriceOracle(impl,TMiNCmvD3zdsv6mk7niBU6NPBzVNjYMQTV) - Data source: Chainlink Data Feeds. The
posteraddress relays Chainlink prices on-chain viasetPrice(asset, price) - Units: Prices are denominated in TRX , scaled by
1e^(33 - tokenDecimal). For an 18-decimal token like USDD, the value for the price feed is calculated based on the exchange rate of 1 USDD to TRX (assuming a price of 3.0266), Price Feed Value = 3.0266 * 1e^(33 - 18) = 3.0266 * 1e^15 - ABI:
price-oracle.jsoncontains only the proxy'sgetUnderlyingPriceread.price-oracle-impl.jsoncontains selected backend methods below, includingassetPricesand restrictedsetPrice. These are different contract interfaces; do not call a backend method at the proxy address. - Verification basis:
Comptroller.oracle()and the returned proxy'sv1PriceOracle()were re-read on 2026-10-14; selected backend ABI entries match the node ABI. See getter methods and address roles and the ABI manifest. This documents current pointers, not a deployment performed by this repository.
Blockchain-powered smart contracts, by design, cannot access external market data directly. To ensure accurate and tamper-resistant pricing, the JustLend protocol relies on a multi-source data aggregation system that draws from reputable and decentralized sources.
Chainlink Data Feeds are the key component of this process, helping to strengthen the security and reliability of pricing across markets.
PriceOracle.sol: allows users to:
- Price Poster
- Get Asset Price
- Set Price
The source code is available on Github.
Contracts ABI¶
The methods in the following sections target the Oracle backend, not the proxy. Mainnet's proxy v1PriceOracle() pointer was checked on 2026-10-12 and resolves to TMiNCmvD3zdsv6mk7niBU6NPBzVNjYMQTV. Re-read the pointer before integration. For ordinary collateral/borrow valuation, prefer getUnderlyingPrice(jToken) on the current Comptroller.oracle() entrypoint.
Anchor Token Price¶
Calling this methods returns the current price anchor of a specified token.
function anchors(address) view returns(uint256, uint256)
- Parameter description:
token:the address of the underlying token(e.g. TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t for USDT).
- Returns:
period:the current time period. Calculated as: current block height/ 600 (the TRON network produces approx. 600 blocks per 30 mins);priceMantissa:the current price of the token in TRX, scaled by 1e^(33 - tokenDecimal).
Price Poster¶
Calling this methods returns the current price poster.
function poster() view returns(address)
- Parameter description: N/A.
- Returns: Address of the current poster.
Asset Prices¶
Calling this method returns the current price of the specified asset.
function assetPrices(address asset) public view returns (uint)
- Parameter description:
asset:the address of the token to query.
- Returns: the current price of the token in TRX, scaled by 1e^(33 - tokenDecimal).
Get Price¶
Calling this method returns the current price of the specified asset.
function getPrice(address asset) public view returns (uint)
- Parameter description:
asset:the address of the token to query.
- Returns: the current price of the token in in TRX, scaled by 1e^(33 - tokenDecimal).
Set Price (poster-only)¶
Calling this methods set a token price for the current time period.
function setPrice(address asset, uint requestedPriceMantissa) public returns (uint)
- Parameter description:
asset:the address of the underlying token (e.g. TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t for USDT);requestedPriceMantissa:new price, scaled by 10^27.- Returns: 0 for success, otherwise an error code.