indexer
indexer copied to clipboard
Change how we cache last sale in tokens table
Currently we break out the last sale of every token into last_sell
and last_buy
. I can't really remember why, and it just causes problems, because people are usually just interested in the last sale, no matter which type it is. So let's combine these into a single last_sale
field.
While we're at it, let's also add the tx hash for the last sale, so it's possible to lookup more info.
- last_sale_price
- last_sale_timestamp
- last_sale_type (sell / buy)
- last_sale_tx_hash
We will need to do a backfill. But this is probably good to do either way, because we had a bug in the past that was making this data incorrect. So this could help clean that up too.
We will also need to update any APIs that use last sells or buys and update them to use last sales instead.