Skip to content

Add K2 lending protocol to the ecosystem reference - #77

Open
kaankacar wants to merge 1 commit into
mainfrom
add-k2-lending-protocol
Open

Add K2 lending protocol to the ecosystem reference#77
kaankacar wants to merge 1 commit into
mainfrom
add-k2-lending-protocol

Conversation

@kaankacar

Copy link
Copy Markdown
Contributor

What

Adds K2 (k2lend.com, docs) to skills/standards/SKILL.md under DeFi Protocols → Lending & Borrowing, where it sits alphabetically between Blend and Slender. It's a live Soroban money market and was missing entirely, so an agent asked about lending on Stellar only ever saw Blend and Slender.

What the entry covers

Beyond the usual links, the things an integrator has to know before writing a line of code:

  • Position model — per reserve, an aToken (supply receipt) plus a debt-ledger token; balances are scaled balance × current index, with separate liquidity and borrow indices and index updates on first touch per ledger
  • Rates — variable only, two-slope curve kinked at optimal utilization (typically 80%), and the Supply Rate = Borrow Rate × Utilization × (1 − Reserve Factor) formula
  • Risk — 65–85% liquidation thresholds by asset class, HF < 1.0 liquidatable with no grace period, 100% close factor when HF < 0.5 or a leg is under $2,000, 10% bonus on XLM/SolvBTC/wBTC
  • Fees — reserve factor 10–20%, flash premium 9 bps, liquidation protocol fee 0.3%
  • Oracle — RedStone primary / Reflector fallback, with staleness rejection, a 20% circuit breaker that keeps the last good price, zero-price rejection, and a global pause
  • DEX path — Soroswap and Aquarius adapters for collateral swaps and flash liquidations, direct pairs only, no multi-hop (the failure mode people hit first)
  • Liquidation access — whitelisted during launch, permissionless later, so anyone building a liquidation bot should check current state

Contract addresses

The entry lists the mainnet addresses: kinetic_router (the entry point) and its modules, the underlying/aToken/debt-ledger triplet for each of the four live markets, and the external oracle contracts K2 reads.

Verification: all 27 addresses were taken from docs.k2lend.com/contracts and then each one was independently resolved on pubnet before being written into the file — every one exists. I also byte-compared what I wrote against the source table to rule out transcription slips (27 written, 27 unique, 0 mismatches). The K2-owned contracts were created in 2026; the USDC and XLM underlying SACs date to Feb 2024, which is the pattern you'd expect and a good sanity signal. Cross-check: the USDC SAC matches the USDC_PUBNET_ADDRESS already documented in skills/agentic-payments/SKILL.md.

Legacy manual reserve tokens and published-but-uninstantiated WASM hashes are deliberately omitted, with the docs page named as source of truth and a note to re-check before hard-coding since reserves and adapters can rotate.

Two things I chose to be careful about

  • wBTC shows up in K2's risk-parameter, borrowing, and liquidation tables as a supported asset, but the contracts page publishes no reserve token set for it. The entry says only the four documented markets should be treated as live rather than repeating the five-asset list.
  • K2's DEX page prose reads "Soroswap, Sushi and Aquarius" but the next sentence says "Both are limited to direct asset pairs" and only two swap adapters are deployed. I listed the two verifiable adapters rather than carrying the third name through.

Checks

pnpm lint, pnpm lint:ts, and pnpm build all pass; the built output serves the updated skill (site/out/skills/standards/SKILL.md). Skill-content change only — no site code, no card changes, and the skill's frontmatter description already covers DeFi protocol references so it needed no edit.

K2 is a live Soroban money market (modular router, Aave V3-inspired)
that was missing from the Lending & Borrowing section, so agents asking
about Stellar lending only saw Blend and Slender.

The entry covers what an integrator actually needs: the aToken / debt
ledger position model and index-based accrual, the two-slope rate curve
and supply-rate formula, risk parameters (liquidation thresholds, health
factor cutoffs, close-factor exceptions, bonuses), the fee schedule, the
RedStone-primary / Reflector-fallback oracle stack with its staleness and
circuit-breaker behavior, flash-loan mechanics, and the Soroswap +
Aquarius collateral-swap path including the direct-pairs-only limitation.

Includes the mainnet contract addresses: the router entry point and its
modules, plus the underlying/aToken/debt-ledger triplet for each of the
four live markets, and the external oracle contracts K2 reads. All 27
addresses were copied from docs.k2lend.com/contracts and each one was
resolved live on pubnet before being written. Legacy reserve tokens and
published-but-uninstantiated WASM hashes are left out with a pointer to
the docs page as source of truth.

Also flags that wBTC appears in K2's risk tables but has no published
reserve token set, so only the four documented markets should be treated
as live.
Copilot AI review requested due to automatic review settings July 31, 2026 17:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://stellar.github.io/stellar-dev-skill/pr/pr-77/

Built to branch gh-pages at 2026-07-31 17:15 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants