Unbiased Historical Event Indexing

Greetings guys,

As much as I have been studying serum_dex so far, I have (unfortunately) been unable to index the events happening in the entire Serum environment.

My goal is simple:

  1. Record every filled order on-chain (Without Bonfida’s public API, and purely via RPC)

However, it is noted that getProgramAccounts is needed. I am wondering if there’s any way to derive a fill event just by reading the instruction and the transaction that owns the instruction in its entirety.

Is there a sample?

Thank you!

You cannot really do this simply by looking at the tx history. You need to look at the event queue to get all the fills. You can do it either by:

The event queue will contain the fill events, so you will just have to deserialize the data and store the fills in a db.