An 2186/nft markets batch 1 (#67)

* addtional markets

* add to test

* is_purchased fix
This commit is contained in:
Jack Forgash 2022-09-27 11:47:34 -06:00 committed by GitHub
parent b541b628cc
commit 44d45693aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 75 additions and 2 deletions

View File

@ -8,6 +8,7 @@ models:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- tx_id
- seller
- buyer
- nft_collection
- nft_id

View File

@ -8,6 +8,7 @@ models:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- tx_id
- seller
- buyer
- nft_collection
- nft_id

View File

@ -12,8 +12,6 @@ WITH silver_events AS (
*
FROM
{{ ref('silver__events_final') }}
-- WHERE
-- event_data :: STRING != '{}'
{% if is_incremental() %}
WHERE
@ -35,6 +33,13 @@ sale_trigger AS (
event_data,
COALESCE(
event_data :purchased :: BOOLEAN,
event_data :accepted :: BOOLEAN,
IFF(
event_data :status = 'sold'
OR event_data :status IS NULL,
TRUE,
FALSE
),
TRUE
) AS is_purchased,
_ingested_at,
@ -46,9 +51,25 @@ sale_trigger AS (
AND -- each market uses a slightly different sale trigger
(
(
event_contract = 'A.8f9231920da9af6d.AFLPack'
AND event_type = 'PackBought'
)
OR (
event_contract = 'A.e2e1689b53e92a82.AniqueMarket'
AND event_type = 'CollectiblePurchased'
)
OR (
event_contract = 'A.9969d64233d69723.BlockleteMarket_NFT_V2'
AND event_type = 'BlockletePurchased'
)
OR (
event_contract = 'A.64f83c60989ce555.ChainmonstersMarketplace'
AND event_type = 'CollectionRemovedSaleOffer'
)
OR (
event_contract = 'A.c8c340cebd11f690.DarkCountryMarket'
AND event_type = 'SaleOfferAccepted'
)
OR (
event_contract = 'A.921ea449dffec68a.FlovatarMarketplace'
AND event_type IN (
@ -60,14 +81,58 @@ sale_trigger AS (
event_contract = 'A.09e03b1f871b3513.TheFabricantMarketplace'
AND event_type = 'NFTPurchased'
)
OR (
event_contract = 'A.097bafa4e0b48eef.FindMarketAuctionEscrow'
AND event_type = 'EnglishAuction'
)
OR (
event_contract = 'A.097bafa4e0b48eef.FindMarketDirectOfferEscrow'
AND event_type = 'DirectOffer'
)
OR (
event_contract = 'A.097bafa4e0b48eef.FindMarketSale'
AND event_type = 'Sale'
)
OR (
event_contract = 'A.abda6627c70c7f52.GeniaceMarketplace'
AND event_type = 'SaleOfferCompleted'
)
OR (
event_contract = 'A.82ed1b9cba5bb1b3.KaratNFTMarket'
AND event_type = 'SaleOfferAccepted'
)
OR (
event_contract = 'A.2162bbe13ade251e.MatrixMarketOpenOffer'
AND event_type = 'OfferCompleted'
)
OR (
event_contract = 'A.49b8e5d4d66ae880.MintStoreMarketFactory'
AND event_type = 'MintStoreItemPurchased'
)
OR (
event_contract = 'A.a49cc0ee46c54bfb.MotoGPNFTStorefront'
AND event_type = 'SaleOfferCompleted'
)
OR (
event_contract = 'A.856bd81e73e6752b.PonsNftMarketContract'
AND event_type = 'PonsNFTSold'
)
OR (
event_contract = 'A.52cbea4e6f616b8e.PublishedNFTStorefront'
AND event_type = 'ListingCompleted'
)
OR (
event_contract = 'A.489fcc527edc21cf.TuneGOMarket'
AND event_type = 'SaleOfferAccepted'
)
OR (
event_contract = 'A.4eb8a10cb9f87357.NFTStorefront' -- general storefront
AND event_type = 'ListingCompleted'
)
OR (
event_contract = 'A.85b8bbf926dcddfa.NFTStoreFront'
AND event_type = 'ListingSold'
)
OR (
event_contract = 'A.85b075e08d13f697.OlympicPinMarket'
AND event_type = 'PiecePurchased'
@ -76,6 +141,10 @@ sale_trigger AS (
event_contract = 'A.5b82f21c0edf76e3.StarlyCardMarket'
AND event_type = 'CollectionRemovedSaleOffer'
)
OR (
event_contract = 'A.62b3063fbe672fc8.ZeedzMarketplace'
AND event_type = 'RemovedListing'
)
)
),
excl_multi_buys AS (
@ -95,6 +164,7 @@ omit_nft_nontransfers AS (
ARRAY_AGG(
DISTINCT event_type
) AS events,
-- don't forget to update below if adding any new movement method !
ARRAY_SIZE(
array_intersection(
['Deposit', 'Withdraw', 'FlovatarSaleWithdrawn', 'FlovatarComponentSaleWithdrawn'],

View File

@ -8,6 +8,7 @@ models:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- tx_id
- seller
- buyer
- nft_collection
- nft_id