Navi lending
Build something meaningful, on Sui. A superpower for AI coding agents (Claude Code, Codex, Cursor, Grok Build) to ship real products on Sui.
npx -y skills add pivyme/suiperpower --skill navi-lendingAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 12 stars12 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Integrate Navi lending protocol on Sui. Use when the user mentions Navi or wants to lend or borrow on Sui via Navi.
SKILL.md
8.2 KB, as published. Nobody here has run it
Preamble (run first)
# Suiperpower telemetry. Routes through the CLI so projects.json + Convex stay in sync.
# Silent on failure so the skill never blocks. Opt out: SUIPERPOWER_TELEMETRY=off.
#
# AGENT NOTE: when this skill finishes, run the matching completion command:
# suiperpower track navi-lending build completed
# Or use "failed" / "aborted" if it ended that way.
command -v suiperpower >/dev/null 2>&1 && suiperpower track navi-lending build started >/dev/null 2>&1 &
true
If TEL_PROMPTED is no, before doing real work, ask the user:
Help suiperpower get better. We track which skills get used and how long they take. No code, no file paths, no PII. Change anytime in
~/.suiperpower/config.json.A) Sure, anonymous B) No thanks
Write the answer to ~/.suiperpower/config.json telemetryTier field and create ~/.suiperpower/.telemetry-prompted. Then continue.
What this skill does
Integrates NAVI Protocol lending into the project. Sets up the @naviprotocol/lending SDK (PTB-native, no standalone client class), walks through deposit, borrow, repay, and withdraw flows, adds health factor monitoring, and optionally wires up flash loans. Verifies a real lending operation executes on mainnet before declaring done.
When to use it
- Building a lending frontend, yield aggregator, liquidation bot, or DeFi app that needs lending primitives on Sui.
- The user wants flash loans for arbitrage or liquidation flows.
- The user needs E-Mode for higher LTV on correlated asset pairs (e.g., vSUI/SUI).
- The user is targeting the DeFi & Payments track at Sui Overflow 2026.
When NOT to use it
- For Scallop lending, use
scallop-money-marketinstead. Both are production protocols. NAVI uses PTB-native functions with coin type identifiers. Scallop uses sCoins receipt tokens and a builder pattern (depositQuick). Pick based on asset coverage and API preference. - For token swaps or AMM liquidity, use
cetus-swapordeepbook-orderbook. - For DeFi research without implementation, use
defillama-sui. - If the user has not scaffolded a project, use
scaffold-projectfirst.
Inputs
- A Sui project (Move package and/or TS frontend).
- Optional:
.suiperpower/build-context.mdfromscaffold-project. Read it if present. - Which operations: deposit only, deposit + borrow, flash loans.
- Which assets: SUI, USDC, USDT, WETH, etc. (35 supported assets total).
If unclear, interview the user for:
- Deposit only, or deposit plus borrow?
- Which collateral asset, which borrow asset?
- Need flash loans?
- Who manages the position: end user via wallet, or app keeper?
Outputs
-
NAVI SDK integration code with PTB-based deposit, borrow, repay, withdraw.
-
Health factor check before any borrow.
-
Optional: flash loan flow with
flashloanPTB+repayFlashLoanPTB. -
Append to
.suiperpower/build-context.md:## navi-lending session, <timestamp> - markets: <list of asset symbols> - operations: deposit | borrow | repay | withdraw | flash-loan - sample tx digest: <digest> - health factor: <value> - oracle: Pyth + Supra (15s validity) - open issues: <list>
The skill never deletes files outside the integration source path without explicit user confirmation.
Workflow
-
Context gathering
- Read
.suiperpower/build-context.mdif it exists. - Confirm which assets the user needs and the flow shape (deposit only, deposit + borrow, flash loan).
- Verify the target assets are in NAVI's 35 supported assets. Check via
getPools().
- Read
-
SDK setup
- Install:
npm install @naviprotocol/lending(peer dep:@mysten/sui >=1.25.0). - The old
navi-sdkpackage is deprecated. Do NOT use it. - There is no standalone client class. All operations are PTB functions:
depositCoinPTB(tx, identifier, coinObj, opts). - AssetIdentifier: a coin type string (e.g.,
'0x2::sui::SUI'), a Pool object, or a numeric asset ID. - Options pattern:
{ env: 'prod', accountCap, market: 'main' }. - Two markets: Main (id: 0, key:
'main') and Ember (id: 1, key:'ember'). Default is Main.
- Install:
-
Pool queries
getPools()returns all pool data (rates, capacity, LTV, oracle prices, APY, liquidation params).getPool(identifier)returns a single pool by coin type, asset ID, or Pool object.getStats()returns aggregate protocol stats.- Document pool parameters (LTV, liquidation threshold, borrow cap) in
build-context.md.
-
Core operations
- Deposit:
depositCoinPTB(tx, identifier, coinObject, { amount }). Merge coins first withmergeCoinsPTB(). - Borrow:
borrowCoinPTB(tx, identifier, amount, { accountCap }). A 0.3% borrow fee is applied at borrow time. - Withdraw:
withdrawCoinPTB(tx, identifier, amount, { accountCap }). - Repay:
repayCoinPTB(tx, identifier, coinObject, { amount, accountCap }). - All return or modify a
Transactionthat must be signed and executed.
- Deposit:
-
Health monitoring
getHealthFactor(address)returns current health factor. Below 1.0 triggers liquidation.getSimulatedHealthFactor(address, identifier, operations)predicts the impact of a new borrow.- Always check health factor before submitting a borrow. Refuse to submit if simulated HF would drop below a safe threshold (recommend >= 1.5).
- Liquidation: 35% close factor, 5-15% bonus depending on asset.
-
Flash loans (optional)
flashloanPTB(tx, identifier, amount)returns[balance, receipt].repayFlashLoanPTB(tx, identifier, receipt, coinObject)repays the flash loan.- Both MUST be in the same PTB transaction. If the transaction fails, the flash loan reverts.
- Fee is asset-dependent. Query available assets via
getAllFlashLoanAssets(). - Not all pools support flash loans. Verify first.
-
Writeback
- Append session details to
.suiperpower/build-context.md.
- Append session details to
-
Closing handoff
- If
.suiperpower/intent.mdexists and the session was non-trivial (new module, new sponsor integration, or material changes to public functions), recommendverify-against-intentas the next step so drift is caught before shipping. - If no
intent.mdexists and the session was non-trivial, surface that gap once: offerclarify-intentto backfill, do not force it.
- If
Quality gate (anti-slop)
Before reporting done, the skill asks itself the following and refuses to declare success if any answer is no:
- Did a real deposit or borrow execute on chain, with a recorded transaction digest?
- Is the health factor checked before every borrow, with a clear refuse-if-unsafe path?
- Are pool parameters (LTV, liquidation threshold, borrow fee) documented, not hardcoded from stale data?
- Does the code use
@naviprotocol/lending, not the deprecatednavi-sdk? - Are coin types passed as full type strings, not pre-imported constants (the new SDK removed those)?
- For flash loans: do
flashloanPTBandrepayFlashLoanPTBboth appear in the same PTB? - Is oracle staleness addressed? (Pyth + Supra, 15-second validity. Call
updateOraclePricesPTB()before time-sensitive ops.)
If any answer is no, the skill reports the gap and works through it before claiming the integration is complete.
References
On-demand references (load when relevant to the user's question):
references/navi-quickstart.md: Install, deposit, borrow, repay, withdraw, flash loan, health factor recipes for the@naviprotocol/lendingSDK.
SDK documentation (load when scope expands beyond what is in references):
- SDK docs: https://sdk.naviprotocol.io/lending
- Migration guide: https://sdk.naviprotocol.io/navi-sdk-migration/lending
- Protocol docs: https://naviprotocol.gitbook.io/navi-protocol-docs
Use in your agent
- Claude Code:
claude "/suiper:navi-lending <your message>" - Codex:
codex "/navi-lending <your message>" - Grok Build: run
grok, then/navi-lending <your message>in the session - Cursor: paste a chat message that includes a phrase like "NAVI lending" or "borrow on NAVI", or load
~/.cursor/rules/navi-lending.mdcand reference it.
If you activated this and the user actually wants something else, consult skills/SKILL_ROUTER.md and hand off.