Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add flashmint nav #90

Merged
merged 71 commits into from
Nov 15, 2024
Merged

feat: add flashmint nav #90

merged 71 commits into from
Nov 15, 2024

Conversation

janndriessen
Copy link
Collaborator

@janndriessen janndriessen commented Oct 22, 2024

TODOs

  • add builder
  • build custom quote flow for icUSD in quote provider
  • add input/output token amount to FlashMintQuoteRequest?

Copy link
Collaborator

@tokdaniel tokdaniel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - SO FAR

inputToken: isMinting ? inputToken.address : usdc,
outputToken: isMinting ? usdc : outputToken.address,
// TODO:
inputAmount: inputTokenAmount.toString(),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edkim for the reserve asset quote (to get the swap data) I guess it makes sense to use the inputTokenAmount of the quote request here when minting but what about redeeming? Because then inputTokenAmount would be the index token amount to redeem?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When redeeming you need to swap the reserve asset (USDC) for the user's chosen output token (ex. WETH). So inputTokenAmount should be how much USDC we want to swap. Then 0x gives back a quote for how much WETH you'd get.

To get the USDC value of however many setTokens the user is redeeming you can call this read function on the NAV Issuance Module: https://etherscan.io/address/0x2344674B23aD076908FD2396373CfE9cd48A1ba3#readContract#F2

@janndriessen janndriessen marked this pull request as ready for review November 13, 2024 19:55
@janndriessen janndriessen merged commit ab42751 into main Nov 15, 2024
2 checks passed
@janndriessen janndriessen deleted the feat/add-flashmint-nav branch November 15, 2024 15:50
Copy link

🎉 This PR is included in version 3.12.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants