Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetching historical data #235

Open
Robiquet opened this issue Oct 29, 2024 · 3 comments
Open

Fetching historical data #235

Robiquet opened this issue Oct 29, 2024 · 3 comments

Comments

@Robiquet
Copy link

Are there any plans to build something to get historical data such as trade history, fill history, price history etc? Let me know if there is something already in the repo that I'm missing. I see you already have FillFeed.ts which could be a good starting point

@brittcyr
Copy link
Contributor

That would require storing that data offchain and doing the indexing there. We are talking to teams about that, particularly for those that want to run their own UIs. But we do not plan on managing that indexing code ourselves.

@Robiquet
Copy link
Author

Even if you don't run the infra it might still be nice to have an open source version that others can run. But would the general approach be to follow what in use what's in fillFeed.ts and deserialize using the various Log.ts files inside client/ts/src/manifest/accounts?

So for example if I wanted to index new orders I would replace:

const fillDiscriminant = genAccDiscriminator('manifest::logs::FillLog');

with:

const placeOrderDiscriminant = genAccDiscriminator('manifest::logs::PlaceOrderLog');

and:

const deserializedFillLog: FillLog = FillLog.deserialize(
  buffer.subarray(8),
)[0];      

with:

const deserializedPlaceOrder: FillLog = PlaceOrderLog.deserialize(
  buffer.subarray(8),
)[0];      

Though I'm a little confused about what this check is for, is that needed?

.equals(Buffer.from([52, 81, 147, 82, 119, 191, 72, 172]))

@brittcyr
Copy link
Contributor

Thats what the comment above is referring to. It probably is no longer needed after modifying the way we do testing. It is from when the local validator tests would deploy the program to a different address

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants