Open
Conversation
0xRektified
reviewed
Feb 25, 2026
programs/metlev-engine/src/instructions/initialize_lending_vault.rs
Outdated
Show resolved
Hide resolved
0xRektified
reviewed
Feb 25, 2026
| pub sol_vault: SystemAccount<'info>, | ||
| pub token_y_vault: InterfaceAccount<'info, TokenAccount>, | ||
|
|
||
| // mint_x = NATIVE_MINT for WSOL |
Contributor
Author
There was a problem hiding this comment.
As you said, more granular seeds like [b"token", mint.key().as_ref()] feels apt here. Will make necessary changes.
Contributor
Author
There was a problem hiding this comment.
amalnathsathyan
commented
Feb 26, 2026
| pub sol_vault: SystemAccount<'info>, | ||
| pub token_y_vault: InterfaceAccount<'info, TokenAccount>, | ||
|
|
||
| // mint_x = NATIVE_MINT for WSOL |
Contributor
Author
There was a problem hiding this comment.
| let rent_exempt = Rent::get()?.minimum_balance(0); | ||
| // let rent_exempt = Rent::get()?.minimum_balance(0); | ||
| //not sure whether it is safer to treat the WSOL as a token account and use token_vault.amount here | ||
| // as we have used the sync_native to sync the balances |
Contributor
Author
There was a problem hiding this comment.
@0xRektified this needs to be resolved to move to actual withdraw fn
|
|
||
| let accounts = Transfer{ | ||
| from: self.sol_vault.to_account_info(), | ||
| from: self.token_vault.to_account_info(), |
Contributor
Author
There was a problem hiding this comment.
@0xRektified This isn't complete. Confused whether I should use the transfer_checked from token_interface or normal transfer from system program,, Becasue the to transfer the WSOL back using Token program,, the user may not have the ATA,,,, wdyt ?
Contributor
There was a problem hiding this comment.
if the user send WSOL he has to have an ATA for it when withdrawing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@0xRektified don't merge now, this is for you to review,
withdraw_vault_lp.rsand tests are pending !!supply.rsrenamed tosupply_vault_lp.rsLendingVault,LpPositionfor supporting both token_x and token_ysync_native