Hi folks,
I am using Golang Solana, exactly “GitHub - gagliardetto/solana-go: Go SDK library and RPC client for the Solana Blockchain”
I am trying to get the seed arrays to be able to create a Swap on an Orca pool, but I am having issues getting the start indexes of each account. Basically my code fetches the LP’s info (from the Solana RPC method “GetAccountInfo”) and I get “tick_spacing” and “current_tick_index”, so then I calculate all 3 array start indexes by doing:
a = (TickCurrentIndex / ticks_in_array)
b = ticks_in_array
startIndex = a * b
//If "a" is negative, I round down to the closest number (if "a" = -1.02 --> round down to 2), if positive the round down (if "a" = 1.02 --> round down to 1)
I then convert the Index , the LP account address , and a “tick_array” all to bytes, then I pass all these bytes and the programID (whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc) to the “solana.FindProgramAddress” method.
But no matter what I do I get the wrong address, I am checking by seeing what Seed arrays a transaction on Solscan has and seeing if my results match
Pls help me