JustLend Source of Truth for AI Agents¶
Use this page to decide which JustLend documentation or runtime source an AI agent should trust for a specific task.
Priority order¶
- OpenAPI spec — use for public read-only HTTP integrations.
- File:
/developers/apis/justlend_apis.yaml - Base URL:
https://openapi.just.network -
Best for: market lists, account positions, protocol dashboard, mining rewards, response schemas, units, and error responses.
-
MCP server tools — use for agent workflows and wallet-aware actions.
- Docs:
mcp_tools.md,MCP Server - Package:
@justlend/mcp-server-justlend -
Best for: account analysis, market queries, transaction pre-flight, supply, borrow, repay, withdraw, sTRX staking, energy rental, governance voting, transfers, and general TRON utilities.
-
Contract directory — use for deployed addresses.
- File:
/developers/contracts.json - Schema:
/developers/contracts.schema.json -
Best for: Mainnet/Nile contract addresses, Base58/EVM/TRON-hex formats, active vs. legacy market status.
-
JSON ABI files — use for contract calls and event decoding.
- Directory:
/developers/abis/ -
Best for: function signatures, event topics, jToken calls, Comptroller, PriceOracle, governance, sTRX, and Energy Rental contracts.
-
Human documentation — use for explanations and risk context.
- Examples: Supply, Borrow, Common Pitfalls, Glossary
- Best for: conceptual explanations, integration pitfalls, examples, and user education.
Do not use stale assumptions¶
- Do not hard-code market counts, APYs, TVL, utilization, prices, rewards, or active/legacy status. Query OpenAPI or MCP.
- Do not infer token decimals from symbols. Use the token metadata from OpenAPI, contracts JSON, ABIs, or MCP tool output.
- Do not assume Mainnet when the user is testing. Ask for or default to
nileonly when the workflow is explicitly a testnet workflow. - Do not use rendered HTML tables as the primary source for programmatic integrations; prefer YAML/JSON/tool output.
Units and amounts — where to get self-describing values¶
The public HTTP API returns numbers in their on-chain form (e.g. base units, mantissa-scaled, annualized decimals) without an inline _unit/decimals envelope, by design. To interpret amounts correctly:
- Need a ready-to-use amount? Prefer MCP tools — balance/amount fields return a self-describing object
{ raw, _unit, decimals, display }(e.g.get_token_balance,get_trx_balance), so you never re-apply decimals. - Using the HTTP API directly? Read the unit and precision from the OpenAPI spec: each amount field carries structured
x-unit/x-decimalsextensions (and a prose description). Do not infer decimals from the symbol. - Quick reference: jTokens always use 8 decimals; each underlying TRC20 uses its own
decimals;*Rate/apyare annualized decimals (×100 for %);exchangeRate/borrowIndexand other mantissa fields are scaled by1e18. See APIs §1.3–1.4.
Common source mapping¶
| User asks for | Use first | Fallback |
|---|---|---|
| “What markets does JustLend support?” | MCP get_supported_markets or OpenAPI /lend/jtoken |
contracts.json |
| “What is the APY / TVL / utilization?” | MCP get_market_data / get_all_markets |
OpenAPI /lend/jtoken |
| “What is this address's health factor?” | MCP get_account_summary |
OpenAPI /lend/account/{address} |
| “Supply / borrow / repay / withdraw for me” | MCP guided prompt + tool | Human docs for explanation only |
| “What contract address should I use?” | contracts.json |
MCP get_supported_markets / chains.ts |
| “How do I decode events?” | ABI JSON files | developer pages |
| “Is a transaction safe?” | MCP pre-flight tools + safety docs | human review |
Answering rule for agents¶
When answering an integration question, include:
- The recommended source or MCP tool.
- Required inputs.
- Important units and precision rules.
- Whether the operation is read-only or signs/broadcasts a transaction.
- Links to the relevant machine-readable source.
Chinese source mapping¶
- “查市场 / APY / TVL / 利用率” → MCP
get_market_data/get_all_marketsor OpenAPIjustlend_apis.yaml. - “查我的仓位 / 健康度 / 清算风险” → MCP
get_account_summaryand Account Positions. - “存款 / 借款 / 还款 / 赎回” → MCP write tools plus MCP Safety Policy.
- “合约地址 / ABI / 事件解析” →
contracts.jsonanddevelopers/abis/.