Open-sourcing Seaport data abstraction
Karina Qian
0x2A12
June 14th, 2022

Over the next few days, OpenSea will be migrating to Seaport, a brand new web3 marketplace protocol designed for safely and efficiently buying and selling NFTs. We’re going to be one of the first marketplaces using the core Seaport smart contract to build new features for the OpenSea community. 

Seaport as a protocol is decentralized and open source - anyone can use it, with no contract owner, upgradeability, or other special privileges. In that spirit, we’re also sharing the Seaport Dune abstraction table that will allow anyone to easily and quickly query transactions made on Seaport. 

While it’s most directly useful for Dune wizards, we believe this query structure and explanation could also be useful for any on-chain sleuths, and any services utilizing blockchain data. The query structure should help you understand how the on-chain data maps into transaction data -- including variables such as purchase types (e.g. if transaction was a standard offer, collection offer or attribute offer) and number of NFTs transacted.

Calls and successful transactions

Similar to Wyvern, Seaport broadly has two types of tables: calls and completed transactions tables. 

The calls tables, e.g. seaport."Seaport_call_fulfillAdvancedOrder" (where collection and trait offer calls live), include all attempted transactions that are submitted on chain, including failed transactions. These tables are where we get the data we need to categorize transactions into different purchase types (e.g. buy now or collection offer).

The transaction completed tables, most notably seaport."Seaport_evt_OrderFulfilled", is where we find successful transactions through Seaport. This is where we get data on the final purchase amount and fees.

Offers and considerations

Seaport is very different from Wyvern in its usage of offers and considerations. As we shared in our last blog post, offerers can agree to supply a number of ETH / ERC20 / ERC721 / ERC1155 items — this is the “offer.” In order for that offer to be accepted, a number of items must be received by the recipients indicated by the offerer — this is the “consideration.” 

The call and transaction tables include data on both offers and considerations in json arrays. In the abstraction, we turn this data into an easily query-able unique transaction-level table that is formatted similarly to Dune’s current nft.trades table - with some additions (e.g., fees, number of NFTs transacted).

Currently, the query supports offers, auctions, private sales, bundles, bulk purchase and buy now transactions involving transfers of ERC-721 and ERC-1155 NFTs for ERC-20 tokens like Ether. We will continue to update this abstraction and documentation as the community begins to more fully explore Seaport. 

Zones

 We also separate out “zone” as a variable. A zone is an account (usually a contract) that performs additional validation prior to fulfillment, and that can cancel the listing on behalf of the offerer. OpenSea’s current zones are 0xf397619df7bfd4d1657ea9bdd9df7ff888731a11, 0x9b814233894cd227f561b78cc65891aa55c62ad2, and 0x004c00500000ad104d7dbd00e3ae0a5c00560c00.

But Seaport is a flexible, open protocol, and we look forward to seeing many more “zones” pop up and use the contract. You can use this abstraction to query data for different zones as well -- just change the zone you’re selecting for 😎

How do I use it?

The fully-commented query is available here if you want to dig into how it works. You can also simply query the abstraction table from Dune: the table name is seaport.view_transactions. Many thanks to @sohwak, our amazing Dune wizard who wrote this super efficient query! Also special shout out to our frens at Dune, who have been amazing to work with throughout this process.

We will release a larger OpenSea Dune abstraction soon, that will make it even easier to query OpenSea data across Wyvern and Seaport. We’ll also work with Dune on making Seaport part of nft.trades. These are all part of our larger efforts to engage more with our community through data -- including through our recent community analytics bounty program.

This is just the beginning. We look forward to bringing the community more new features -- and more data! -- much faster. LFG! 💪

Arweave TX
DwuyLIgES1Efk_L4Bm3lSKg3aOzta4ZJvhDvqmg9q0I
Ethereum Address
0x2A12aBAd1dEEC70B27cbfEA70fc40e6199B99Ae6
Content Digest
OBpbciXbhz1JsZxwXQ9V7DpOtNgTfhNhtU5YS6gIlpU