0

How to filter most recently created pdas of a program, How should date be store in pda data so that we can directly filter based on the data stored in pda. For ex. filtering all pda of a program created in last 2 days.

Fetching all pda and then filter out is too heavy operation, as number of pda increases. so want to directly fetch pda based on the data stored in them.

1 Answer 1

0

There may be better solutions through different RPC providers, but using the default Solana RPC, there's no way to create a "greater than" or "less than" filter, just exact memory comparison. So your options are:

  • call getProgramAccounts with a memcmp filter on every possible timestamp
  • call getProgramAccounts and filter on the client side

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.