From 67b067a0e17d0b6c5a9edd37f88b01411335d02b Mon Sep 17 00:00:00 2001 From: akalmykov Date: Sun, 8 Dec 2024 15:59:11 +0100 Subject: [PATCH] deposit bugfix --- src/driftpy/drift_client.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/driftpy/drift_client.py b/src/driftpy/drift_client.py index b3aff6c6..32d61bc2 100644 --- a/src/driftpy/drift_client.py +++ b/src/driftpy/drift_client.py @@ -1019,14 +1019,15 @@ async def get_deposit_collateral_ix( ), ) instructions.append(deposit_ix) - close_account_params = CloseAccountParams( - program_id=TOKEN_PROGRAM_ID, - account=ata_pubkey, - dest=signer_authority, - owner=signer_authority, - ) - close_account_ix = close_account(close_account_params) - instructions.append(close_account_ix) + if create_WSOL_token_account: + close_account_params = CloseAccountParams( + program_id=TOKEN_PROGRAM_ID, + account=user_token_account, + dest=signer_authority, + owner=signer_authority, + ) + close_account_ix = close_account(close_account_params) + instructions.append(close_account_ix) return instructions async def withdraw(