💡Seaport: Real-time Orders
In this example, we'll use the LiveQuery table function tf_latest_contract_events_decoded
to retrieve real-time orders from the Seaport contract.
If you'd like to follow along in your own Flipside Studio Account please make sure you've added the QuickNode integration to your account. QuickNode instructions here.
Here we will query the Seaport Version 1.5 Contract on the Ethereum Mainnet, address: 0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC
Note you must wrap the call to the function in TABLE()
since this function returns a table structure.
The above example will return a table with the following columns:
status
varchar
blockchain
varchar
network
varchar
tx_hash
varchar
block_number
number
event_index
number
event_name
varchar
contract_address
varchar
event_topics
array
event_data
varchar
decoded_data
object
Now that we've covered the basics let's extract the offers from the decoded events:
The above SQL uses a CTE to retrieve the latest events from the Seaport Contract and then uses the LATERAL FLATTEN
function to explode out each offer
in the decoded_data
object into its own row. We also retrieve the offerer
, and orderHash
from the decoded_data
object.
Last updated