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
We need to map out what information we get about offers from the new ingestion system. We also need to know what the output to BigQuery should look like. Part of #19.
Why
This issue helps us know what information about offers we can get from the ingestion system and what information may have to be reconstructed or omitted.
The text was updated successfully, but these errors were encountered:
There are two different ways to get the information on Offers. The first is to use a LedgerTransactionReader and read
in Transactions one at a time. Then for each transaction, by looking at the Offers and their types, we can isolate what is relevant to offers. The Operation types that affect offers are: OperationTypeManageSellOffer (3), OperationTypeCreatePassiveSellOffer (4), and OperationTypeManageBuyOffer (12). Keeping track of these operations would allow us to create a list of offer operations and their timestamps. We also can use MakeSingleLedgerStateReader() to get the changes in a given ledger. Each change has a type, the relevant one being LedgerEntryTypeOffer. It also contains the LedgerEntry for before and after. This allows us to reconstruct the offer table in BigQuery.
For a given change of the correct type, we can do offer := change.Post.Data.Offer to get offer data in the ledger.
In order reconstruct the table, we need a struct with the following fields:
seller_id: string - get from offer.SellerId.GetAddress()
offer_id: integer - get from offer.OfferId
selling_asset: string - get from offer.Selling; call on xdr.MarshalBase64() on the asset to put into table
buying_asset: string - get from offer.Buying; call xdr.MarshalBase64() on the asset to put into table
amount: integer - get from offer.Amount
price_fraction: Price struct - get from offer.Price
price: float - get from offer.Price.N/offer.Price.D
flags: integer - get from offer.Flags
last_modified_ledger: integer - get from change.Post.LastModifiedLedgerSeq
deleted: boolean - should be false if there is information in change.Post, true otherwise
What
We need to map out what information we get about offers from the new ingestion system. We also need to know what the output to BigQuery should look like. Part of #19.
Why
This issue helps us know what information about offers we can get from the ingestion system and what information may have to be reconstructed or omitted.
The text was updated successfully, but these errors were encountered: