New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Where the Bufficorns Are: An Intro to NFT Data Analytics - Caron Schaller

Ethereum DenverSun, Oct 9, 2022, 12:00 AM

Transcript

thanks for coming uh so this is going to be a an intro to on-chain data analytics science getting data from chains because that's what they're all about storing data in a way that's reachable accessible for everybody and it's going to be a bit of a an intro so if you're advanced it may not be that relevant but some of the conclusions that you can draw from the from the graphs and such uh yeah might be interesting for you still yeah so i'm from i'm a block demon i'm a data scientist there got a couple of my colleagues in the crowd here come come come speak to us if you're interested in what we do and uh yeah hope you enjoy this is uh all done in jupiter notebook and i'm presenting it uh in slides so it's going to be going through some of the code and then some of the results from that code so what i want to do with this with this presentation is show you kind of how you can take a more data driven approach uh to making decisions with uh with well on chain and here we're going to be taking um the buffer corn nft as what we're going to dive into can i get a show of hands who has python experience here and how many of you like python nice great so we're going to be digging into the data that's logged on the chain and besides block data and transaction data we have access to a whole bunch of different things what we're most interested in here is event data some of the use cases for getting data directly from the chains is this this so we recently blocked him and acquired any block analytics where we've had produced uh various metrics and graphs uh to to to understand how how the chains are doing how the gas fees are how the network metrics are at the moment and so on this for example is a the dashboard that shows the lido tokens and staked eth and how much volume there's been and how many holders there are etc so let's dig into it what do we need we need the data of course but we need to set it up with uh well web 3 pi here um where we're going to be using the block daemon ubiquity api suite to create a an rpc endpoint for ethereum and what we need for that is the buffer coin address so i've got that right here 0x1e etc and we need the abi from the contract you can get that from etherscan which is why i linked it up here you just put it in and and plug it into web3pi as i do here so with our with our rpc um endpoint you need to pass a bearer token which um you can get from just signing up on on our website and here i want to plug our bounty if you use the ubiquity api for any of the projects during this hackathon definitely apply for a bounty because you'll be eligible by just using here our api so what this looks like then is here you have your contract and then you can start calling the functions that you can also see on etherscan such as the name and here based on the address that i plugged in and the api you can see that the name of this nft set is the buffer coin biddlebrade and then we can start pulling more from it here in a loop you make a bunch of calls to to the chain and you can fetch each individual owner of the buffer coins here you see 0x01 owns two of the first five um in the in the index these are these are nfts one two three four and five but uh that takes a lot of well that's a lot of requests if you wanted to fetch all 10 000 or 8 000 or however many there are now um so we don't want to do that generally uh we can also fetch other stuff here's the metadata that's stored on aws unfortunately so which is not not good guys but yeah taking the image for for for this individual um buff coin i think this was one of the more expensive ones um it looks quite cool right so like i said all this metadata is hosted on aws and what we also do at block daemon is index nft data so um we we pull that metadata and those images and we store them um in in our suite as well so in that way even if eat denver ends and even if they stop paying um their aws dues then um we've still got it but the good thing about in an index such as this is you don't need to query the the chain every time right you you can you can you can get it from from us from a primary data source instead of from the decentralized data source uh and here's an example of me using our ubiquity api to pull that data and you can see it's stored with us here the image and the metadata is as well and so if you wanted to get a bunch of information about uh these nft sets it'd be quicker to do so with an index than directly calling the chain right but moving on we also have an elastic search index where you can get all sorts of event logs and transactions and whatever but now we're going to go into events and specifically here the transfer event you can plug in a json query and get all of all of that but um i'm think i'm going a bit too slowly so i'll just move on a bit further uh to the results so you start seeing something so i've fetched uh all the transactions of the pa since since the inception of the buff coin um using this elastic search query and we can see there have been 12 000 transactions and if it if if the from address is zero that means it's a mint right and if it's not it's it's a transfer and we can yeah 12k results is quite a lot it's quite a quite a busy nft project um but let's see how the um who holds the most right because that's the most most interesting bit always here's a list of uh all the owners of a buff coins and we can see the number one uh address holds almost 1300 buff coins and this happened about four days ago actually but uh it's it's not it's not an individual wallet it's it's a contract but i don't know what's going on there they amassed a whole bunch of buffer coins four days ago second one is is the uh is the mint um address so we're going to be excluding those and then we can assume that the top holder has 291 buff coins which is still quite a lot i only have one right but let's see how whether they're actually transferred or just minted like i said earlier if we take the zero address as as as a minting event um then we can classify them into transfer minting and then show that most movement on chain was was through minting 82 but that's not that doesn't say much so let's look at it over time and you can see right here before denver started or the first few days of eath denver there's a huge spike in in minting uh interest and that is actually four days ago when that one address got 1300 buffer coins i haven't looked into why that happened but maybe somebody here knows great then we can also see when they're minted this is i mean you could this could be relevant for for for different projects or but i don't think it's very very relevant for for the buffet coin right now but i'm going to show you kind of how it's how it looks um taking all 12 000 transactions we can group them by weekday and then show them all as a heat map and then you can see that most people minted on saturdays or monday very late at night utc now more interesting what was the gas cost for all these buffet coins we can run another elastic search query and sum up all the gas costs and you can see that all buffer coins that were minted and transferred have cost 128 eth total in gas fees so in fiat if we pair that with uh with with coin gecko data we can see that it was a considerable amount of us dollars on this day specifically which was four days ago again forty four thousand dollars were spent on gas fees minting buffer coins in total 470 thousand dollars now all right i'll show you kind of what you can do with this does anybody here play defy kingdoms you know d5 kingdoms yeah yeah so it's it's a play to earn game and you and there's and you have nfts you can breed them and uh there's i think they have over 120 000 heroes now and they keep it you can you can quest with them you can trade them you can sell them and yeah breed them and you can take a very data driven approach to this and optimize it optimize your your strategies by going directly to the chain because a lot of the information that is on chain isn't being shown in the front end of the game because it would make the game a bit too confusing right because all the metadata doesn't it would really clutter up the front of the front end but if you dig into the chain you can do you can just work with the data exactly how you need it so here i show um hero sales ignore these two dips this is when my my yeah when my code stopped working but after that it's been continued continually working but this is hero sales over time in the over the past almost a month you can see it's been dipping and there's been less interest in buying heroes in d5 kingdoms so this may influence your decisions and whether you want to buy an nft now or one of these heroes now or you want to wait here i'm showing the amount of heroes in the tavern which is increasing so there's more supply and which makes sense that uh or or less demand which makes sense that the the price is going down but if and if you see here the median prize of all heroes in the d5 kingdom tavern has decreased right but if you have all of these data points if you if you if you've collected all of this data and the metadata of all the heroes that have been sold over the past month then you can parse it using something like this where you where you want a very specific hero you want to make sure that you that you're not overpaying for that that one you wanna you wanna because yeah there's a floor for all heroes but then there's individual floors based on the signals that you want so if you have a very specific type of hero you want you're going to be looking at a at a different floor than the overall floor because it might be a more they they might in general be more valuable so here i've appended a couple of signals or it parses all heroes in in my data frame um to see whether the heroes of interest or not and then i remove the ones that are not of interest and then graph only the ones of of interest so so you'll see there's a different price median price for these interesting ones that i that i actually care about because there's a lot of there's a lot of useless nfts on there as well uh heroes on there as well and you can then also set up um yeah you can go take it a step further and further and you can set up some sort of algorithm to to make sure that you immediately buy a hero that matches the parameters you've set and yeah yeah great um yeah this is a bit over optimized i would say for a game but if that's your thing it's my thing then uh enjoy i'll be around if you want uh if you have questions or join our discord um to uh have access to to to this code i'll upload it there and you can also get a get a po and get more info on our bounty

Automatic transcript — names and jargon may be misspelled.