Skip to content

Align lend amount types with swap pattern#346

Closed
its-applekid wants to merge 11 commits into
ethereum-optimism:mainfrom
its-applekid:feature/align-lend-amount-types
Closed

Align lend amount types with swap pattern#346
its-applekid wants to merge 11 commits into
ethereum-optimism:mainfrom
its-applekid:feature/align-lend-amount-types

Conversation

@its-applekid
Copy link
Copy Markdown

Summary

Aligns lend module type patterns with the swap module's consistent input/output amounts, resolving issue #303.

Closes #303

Changes

SDK Types

  • LendTransaction: Added amountRaw: bigint, changed amount from bigint to number (human-readable)
  • LendMarketPosition: Changed balance/shares from bigint to number, added balanceRaw/sharesRaw
  • LendClosePositionParams: Renamed amount: bigintamountRaw: bigint for consistency

Providers

  • Morpho provider: Updated _openPosition, _closePosition, _getPosition to return human-readable amounts/balances
  • Aave provider: Same updates across all position methods (ETH and ERC-20)
  • LendProvider core: Updated closePosition to use amountRaw parameter

Principle

Developers pass human-readable numbers in, receive human-readable numbers out with the same field names. Raw bigint values are always suffixed with Raw.

Verification

  • ✅ SDK builds successfully
  • ✅ All 449 tests pass (52 test files, 10 skipped)
  • ✅ No lint errors

Breaking Changes

This is a breaking change to the public API:

  • LendTransaction.amount is now number instead of bigint
  • New LendTransaction.amountRaw field for raw bigint values
  • LendMarketPosition.balance/shares are now number instead of bigint
  • New LendMarketPosition.balanceRaw/sharesRaw fields
  • LendClosePositionParams.amount renamed to amountRaw

@its-applekid its-applekid requested a review from a team as a code owner March 30, 2026 06:02
@its-applekid its-applekid requested a review from jefr90 March 30, 2026 06:02
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 30, 2026

👷 Deploy request for actions-ui pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 81c997f

@jefr90
Copy link
Copy Markdown
Contributor

jefr90 commented May 15, 2026

Thanks. Closing in favor of #347.

@jefr90 jefr90 closed this May 15, 2026
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.

Align lend amount types with swap pattern

2 participants