Skip to content

feat: add lending optimizer and integration tooling - #877

Open
Davidemulo wants to merge 2 commits into
Smartdevs17:mainfrom
Davidemulo:feat/davidemulo-stellarlend-ops-804-812-forkbase
Open

feat: add lending optimizer and integration tooling#877
Davidemulo wants to merge 2 commits into
Smartdevs17:mainfrom
Davidemulo:feat/davidemulo-stellarlend-ops-804-812-forkbase

Conversation

@Davidemulo

Copy link
Copy Markdown
Contributor

Summary

  • Add a backend lending pool allocation optimizer with deterministic supply/withdraw/monitor recommendations.
  • Extend gas benchmark reports with structured optimization findings in JSON and Markdown output.
  • Add reusable cross-contract scenario utilities and an E2E lending/oracle/liquidation flow.
  • Expand oracle-contract stress coverage for stale prices, quorum aggregation, source divergence, and deviation boundaries.

Tests

  • npx jest src/__tests__/portfolio.service.test.ts --runInBand --coverage=false
  • npm test -- cross-contract-harness.e2e.test.ts --runInBand
  • $env:NODE_PATH = (Resolve-Path .\e2e\node_modules).Path; .\e2e\node_modules\.bin\jest.cmd --config .\e2e\package.json --rootDir . --testMatch **/oracle-stress.test.ts --runInBand --forceExit --testTimeout=30000

Rust benchmark unit tests were attempted with cargo test --manifest-path stellar-lend/benchmarks/Cargo.toml report::tests --quiet, but this Windows host is missing the MSVC linker link.exe.

Closes #805.
Closes #804.
Closes #809.
Closes #812.

@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

@Obiajulu-gif is attempting to deploy a commit to the smartdevs17's projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch was cut a long time ago and had drifted far behind
Smartdevs17/stellarlend's main (large doc cleanup, restructuring,
many unrelated feature merges) — GitHub flagged the PR as conflicting
in three files, all of which come from this branch's own Smartdevs17#805/Smartdevs17#809/Smartdevs17#812
work overlapping with unrelated upstream additions of the same name:

- stellar-lend/benchmarks/src/report.rs: pure textual conflict from
  interleaved insertions (this branch's optimization-findings section
  in the Markdown report and its unit tests) around unrelated upstream
  edits to the same functions — no logic actually competed, so both
  sides' additions are kept.
- tests/e2e/scenarios/harness.ts and
  tests/stress/oracle-contract/oracle-stress.test.ts: add/add conflicts
  where this branch and upstream/main each independently ended up with
  a file at the same path. Diffed both versions directly: this branch's
  copy is a strict superset of upstream's (same base content plus this
  branch's Smartdevs17#809 `runCrossContractScenario` helper and Smartdevs17#812 quorum-price-
  consensus test/method, plus one intentional oracle-stress fix — a
  50%-deviation test threshold changed from 1.5x to 1.51x so it actually
  exceeds the >50% check it's asserting). Kept this branch's version
  in full; nothing from upstream's copy was lost.

.github/workflows/*: left untouched at this branch's pre-merge content
(both the files upstream modified and the ones it added) — the token
used for this push lacks the `workflow` OAuth scope, so any push that
changes workflow file content is rejected by GitHub regardless of
branch. Syncing those files needs a token with that scope; not done here.

No local rustc/link toolchain or Node toolchain available in this
sandbox to run cargo build/test or the TS test suite (linking fails on
proc-macro build scripts, unrelated to this change), so this merge is
verified by manual diff review of every conflicting hunk rather than a
local build — CI on the PR is the first real build/test signal.
@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@Davidemulo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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

Labels

None yet

Projects

None yet

2 participants