Skip to content

docs: clarify withdraw preconditions - #173

Open
babymakh2026-maker wants to merge 2 commits into
aave:mainfrom
babymakh2026-maker:agent/clarify-withdraw-preconditions
Open

babymakh2026-maker wants to merge 2 commits into
aave:mainfrom
babymakh2026-maker:agent/clarify-withdraw-preconditions

Conversation

@babymakh2026-maker

@babymakh2026-maker babymakh2026-maker commented Aug 2, 2026

Copy link
Copy Markdown

Summary

  • Document the difference between modeled ResultAsync validation outcomes and thrown SDK invariant errors.
  • Clarify in the package README, client withdraw action docs, and useWithdraw docs that withdraw assumes the sender already has a supply position for the selected market and reserve.
  • Point client and React users to userSupplies / useUserSupplies before submitting a withdrawal.
  • Update the touched examples to use the current sender request field.

Why

Issue #150 surfaced that consumers can mistake thrown invariant failures, such as attempting to withdraw without an existing supply position, for execution-plan validation errors. The maintainer guidance is that these are violated preconditions, while modeled outcomes such as InsufficientBalanceError remain part of the normal execution flow.

This PR makes that contract explicit where integrators are likely to read it, so they know which checks to perform before calling withdraw and avoid depending on invariant message text.

Refs #150.

Validation

  • pnpm lint
  • pnpm build

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.

1 participant