Skip to content

Skip redundant USDC approve transactions when allowance is sufficient #38

Merged
koko1123 merged 5 commits intomainfrom
luke/approval-check
Feb 13, 2026
Merged

Skip redundant USDC approve transactions when allowance is sufficient #38
koko1123 merged 5 commits intomainfrom
luke/approval-check

Conversation

@lukemacauley
Copy link
Contributor

The frontend is adding a one-time USDC approval step so users don't need to send an approve transaction on every trade. Without this SDK change, the SDK always calls approve regardless of existing allowance.

  • Checks on-chain USDC allowance before calling approve in openTakerPosition and openMakerPosition, skipping the tx when the existing allowance already covers the required amount
  • Enables a one-time max approval flow from the frontend — users approve USDC once and every subsequent trade saves a transaction
  • Adds integration tests verifying approval is skipped when allowance is sufficient and still triggered when allowance is zero

@lukemacauley
Copy link
Contributor Author

@coderabbitai review

@koko1123 koko1123 self-requested a review February 13, 2026 19:03
@koko1123 koko1123 merged commit ef4efe1 into main Feb 13, 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

Development

Successfully merging this pull request may close these issues.

2 participants