Skip to content
Logo

Offchain Systems

Lucent's offchain systems make the Soroban protocol usable, observable, and maintainable.

Frontend

The frontend should support Freighter Connect and Stellar Wallets Kit.

The transaction lifecycle should expose simulation before signing:

  1. Build the transaction.
  2. Simulate and inspect footprint/result.
  3. Assemble.
  4. Ask the wallet to sign.
  5. Submit.
  6. Poll confirmation.

User flows should include trustline onboarding, XLM reserve checks, and position simulation for resulting collateral ratio, redemption queue rank, distance to MCR, debt changes, price changes, and rate changes.

Public API and SDK

The TypeScript SDK should wrap contract calls, simulation, errors, and indexed reads. APIs are versioned so integrators can safely depend on them.

Indexer

The indexer builds durable views of:

  • Troves and owner portfolios.
  • Stability Pool positions.
  • Liquidations and redemptions.
  • Parameter changes.
  • Revenue and interest routing.
  • Oracle state.
  • Contract versions.

Contract events are treated as a versioned public API. Event replay tests must prove the indexer can reconstruct user and protocol state.

Bots

Lucent uses several offchain agents:

BotResponsibility
Redemption botMonitors starUSD peg, redemption fee, sorted Troves, expected XLM output, and slippage.
Liquidation botMonitors oracle price, ICR/TCR, Stability Pool depth, liquidation profitability, and reserves.
Interest-rate delegate botManages approved individual or batch rate strategies.
TTL keeperExtends or restores contract code, contract instances, and important persistent storage.
JIT liquidation botSources missing starUSD at liquidation time and executes profitable liquidation routes.

Monitoring

Internal monitoring tracks RPC health, indexer lag, bot liveness, oracle freshness, TTL health, failed transactions, admin activity, redemptions, liquidations, risk thresholds, and upgrade proposals.

External monitoring should track exploit patterns, multisig activity, oracle anomalies, treasury risk, and incident response triggers.

Release Process

Frontend, indexer, SDKs, and bots ship through GitHub CI. CI should run tests and staged releases before production deployment.