orca-so / typescript-sdk

The Orca SDK contains a set of simple to use APIs to allow developers to integrate with the Orca platform.
159 stars 49 forks source link

How can we gain access to deprecated pools? #59

Closed schnetzlerjoe closed 3 years ago

schnetzlerjoe commented 3 years ago

Hello. I am trying to use a Solong wallet (not supported naturally via Orca) to remove liquidity in the deprecated SOL/USDC pool. I provided this liquidity through Step.Finance and it seems like since it is deprecated now I cannot remove it. I was hoping to use the SDK to do this. How can I get that done?

ghost commented 3 years ago

@schnetzlerjoe - here's the info for the deprecated SOL/USDC, you should be able to interact with this pool by adding this info to the sdk

address: 6fTRDD7sYxCN7oyoSQaN1AWC3P2m8A6gVZzGrpej9DvL
nonce: 253
authority: B52XRdfTsh8iUGbGEBJLHyDMjhaTW8cAFCmpASGJtnNK
poolTokenMint: ECFcUGwHHMaZynAQpqRHkYeTBnS5GnPWZywM8aggcs3A
poolTokenDecimals: 9
feeAccount: 4pdzKqAGd1WbXn1L4UpY4r58irTfjFYMYNudBrqbQaYJ
tokenAccountA: FdiTt7XQ94fGkgorywN1GuXqQzmURHCDgYtUutWRcy4q
tokenAccountB: 7VcwKUtdKnvcgNhZt5BQHsbPrXLxhdVomsgrr7k2N5P5
schnetzlerjoe commented 2 years ago

@schnetzlerjoe - here's the info for the deprecated SOL/USDC, you should be able to interact with this pool by adding this info to the sdk

address: 6fTRDD7sYxCN7oyoSQaN1AWC3P2m8A6gVZzGrpej9DvL
nonce: 253
authority: B52XRdfTsh8iUGbGEBJLHyDMjhaTW8cAFCmpASGJtnNK
poolTokenMint: ECFcUGwHHMaZynAQpqRHkYeTBnS5GnPWZywM8aggcs3A
poolTokenDecimals: 9
feeAccount: 4pdzKqAGd1WbXn1L4UpY4r58irTfjFYMYNudBrqbQaYJ
tokenAccountA: FdiTt7XQ94fGkgorywN1GuXqQzmURHCDgYtUutWRcy4q
tokenAccountB: 7VcwKUtdKnvcgNhZt5BQHsbPrXLxhdVomsgrr7k2N5P5

@0xscuba I am getting an incorrect program id for instruction with this info. Here are the logs:

logs: [ 'Program 11111111111111111111111111111111 invoke [1]', 'Program 11111111111111111111111111111111 success', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]', 'Program log: Instruction: InitializeAccount', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3680 of 200000 compute units', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success', 'Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL invoke [1]', 'Program log: Transfer 2039280 lamports to the associated token account', 'Program 11111111111111111111111111111111 invoke [2]', 'Program 11111111111111111111111111111111 success', 'Program log: Allocate space for the associated token account', 'Program 11111111111111111111111111111111 invoke [2]', 'Program 11111111111111111111111111111111 success', 'Program log: Assign the associated token account to the SPL Token program', 'Program 11111111111111111111111111111111 invoke [2]', 'Program 11111111111111111111111111111111 success', 'Program log: Initialize the associated token account', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]', 'Program log: Instruction: InitializeAccount', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3412 of 161872 compute units', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success', 'Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL consumed 42189 of 200000 compute units', 'Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL success', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]', 'Program log: Instruction: Approve', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 2297 of 200000 compute units', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success', 'Program 9W959DqEETiGZocYWCQPaJ6sBmUzgfxXfqGeTEdp3aQP invoke [1]', 'Program log: Instruction: WithdrawAllTokenTypes', 'Program log: Error: IncorrectProgramId', 'Program 9W959DqEETiGZocYWCQPaJ6sBmUzgfxXfqGeTEdp3aQP consumed 5423 of 200000 compute units', 'Program 9W959DqEETiGZocYWCQPaJ6sBmUzgfxXfqGeTEdp3aQP failed: incorrect program id for instruction' ] }

schnetzlerjoe commented 2 years ago

@0xscuba I changed the contract address to DjVE6JNiYqPL2QXyCUUh8rNjHrbz9hXHNYt99MQ59qw1 and fixed that. But now I get:

logs: [ 'Program 11111111111111111111111111111111 invoke [1]', 'Program 11111111111111111111111111111111 success', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]', 'Program log: Instruction: InitializeAccount', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3680 of 200000 compute units', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success', 'Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL invoke [1]', 'Program log: Transfer 2039280 lamports to the associated token account', 'Program 11111111111111111111111111111111 invoke [2]', 'Program 11111111111111111111111111111111 success', 'Program log: Allocate space for the associated token account', 'Program 11111111111111111111111111111111 invoke [2]', 'Program 11111111111111111111111111111111 success', 'Program log: Assign the associated token account to the SPL Token program', 'Program 11111111111111111111111111111111 invoke [2]', 'Program 11111111111111111111111111111111 success', 'Program log: Initialize the associated token account', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]', 'Program log: Instruction: InitializeAccount', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3412 of 161872 compute units', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success', 'Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL consumed 42189 of 200000 compute units', 'Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL success', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]', 'Program log: Instruction: Approve', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 2297 of 200000 compute units', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success', 'Program DjVE6JNiYqPL2QXyCUUh8rNjHrbz9hXHNYt99MQ59qw1 invoke [1]', 'Program log: Instruction: WithdrawAllTokenTypes', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]', 'Program log: Instruction: Burn', 'Program log: Error: insufficient funds', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 2237 of 183346 compute units', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA failed: custom program error: 0x1', 'Program DjVE6JNiYqPL2QXyCUUh8rNjHrbz9hXHNYt99MQ59qw1 consumed 200000 of 200000 compute units', 'Program DjVE6JNiYqPL2QXyCUUh8rNjHrbz9hXHNYt99MQ59qw1 failed: custom program error: 0x1' ] }

Even though I have plenty of SOL in my account. What should I do?

schnetzlerjoe commented 2 years ago

Just in case anyone needs this. I got this to finally work. I had to go on Raydium and then it asked me to migrate the tokens. Once I did that I was able to run my Node script to withdraw from the deprecated pool.