You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to write a Solana smart contract to get the market id via Cross Program Invocation (CPI) by providing the address of the tokens ,is this achievable, is there a simple example please? Thanks.
The text was updated successfully, but these errors were encountered:
Hi, the market pubkey cannot be derived from the token mints. There can be many markets for a given pair. You would have to look it up off-chain using a getProgramAccounts RPC call with a memcmp filter or two to target the correct base_mint/quote_mint, then choose the best market for your pair by whatever criteria and pass that in to your program.
I want to write a Solana smart contract to get the market id via Cross Program Invocation (CPI) by providing the address of the tokens ,is this achievable, is there a simple example please? Thanks.
The text was updated successfully, but these errors were encountered: