Skip to content

Integrate real Blend pool calls for index rate and supply - #198

Merged
soomtochukwu merged 15 commits into
DXmakers:mainfrom
codellins:fix/contracts-blend-integration-148-150
May 29, 2026
Merged

Integrate real Blend pool calls for index rate and supply#198
soomtochukwu merged 15 commits into
DXmakers:mainfrom
codellins:fix/contracts-blend-integration-148-150

Conversation

@codellins

Copy link
Copy Markdown
Contributor

Summary

Verification

  • cargo test in contracts/ — 13 tests passed.
  • git log 473500c..HEAD --format confirms author and committer codellins <codellins@gmail.com> on all 15 commits.

Closes #148
Closes #149
Closes #150

Made with Cursor

codellins and others added 15 commits May 29, 2026 15:06
Introduce a Soroban contract client so production code can call the
Blend pool interface instead of duplicating index-rate math locally.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the TotalDeposits storage fallback with a get_index_rate
invocation so yield math tracks the live pool state.

Co-authored-by: Cursor <cursoragent@cursor.com>
Document that calculate_blend_yield and get_blend_position_value
depend on live pool index data rather than local mock storage.

Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the testing-only wording now that production code reads index
rates from the configured Blend pool contract.

Co-authored-by: Cursor <cursoragent@cursor.com>
Align the BlendPoolInterface docs with INDEX_RATE_PRECISION so
integrators know how pool rates map to bToken math.

Co-authored-by: Cursor <cursoragent@cursor.com>
Production callers should read index rates via the configured Blend
pool instead of a router-local mock getter.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace set_mock_index_rate with mock pool set_index_rate so tests
exercise the same external index rate path as production.

Co-authored-by: Cursor <cursoragent@cursor.com>
Clarify that index rate manipulation for yield scenarios belongs on
the mock Blend pool used in unit tests, not on SmasageYieldRouter.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the mock implementation inside the test module so production
wasm builds never ship test-only Blend pool logic.

Co-authored-by: Cursor <cursoragent@cursor.com>
Tests now adjust index rates on the mock Blend pool contract, keeping
yield simulation out of the production router interface.

Co-authored-by: Cursor <cursoragent@cursor.com>
Authorize the configured Blend pool to pull USDC from the router
contract prior to invoking pool supply.

Co-authored-by: Cursor <cursoragent@cursor.com>
Delegate bToken minting to the pool contract so supply matches live
Blend accounting rather than duplicating index-rate formulas.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace local underlying redemption math with BlendPoolClient::withdraw
so redemptions stay consistent with pool state.

Co-authored-by: Cursor <cursoragent@cursor.com>
Clarify that withdraw redeems bTokens to a recipient and returns the
underlying asset amount from the pool contract.

Co-authored-by: Cursor <cursoragent@cursor.com>
Document that the router holds user USDC and approves the pool to pull
funds immediately before the on-chain supply invocation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@drips-wave

drips-wave Bot commented May 29, 2026

Copy link
Copy Markdown

@codellins 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

@soomtochukwu
soomtochukwu merged commit 6a8f720 into DXmakers:main May 29, 2026
3 checks passed
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