Optimize Contract Submissions to Dune Analytics

UPDATE:

Spoke to 0xBoxer about a few items here and have added updates throughout.


I’ve been playing with Dune Analytics as I know some others have been.

Unfortunately, most of the PieDAO contracts have not been decoded. I wanted to submit all of the contracts for decoding, but as began the process I realized I could use some assistance.

I have compiled the contracts on https://docs.piedao.org/technical/deployed-smart-contracts here:

This link provides edit access to the workbook. If you are uncomfortable making changes, feel free to create a new sheet and paste the existing data there before editing. Otherwise, please feel free to add columns and information. It would be greatly appreciated.

When submitting a contract on Dune, there are some questions about proxies and factories that I do not feel 100% comfortable with.

I could use assistance understanding how to answer the Factory vs. Non-Factory question. I have done my best to visit each contract and check for a proxy. If there is a proxy, I have added the contract in the sheet. As always, I would also appreciate a second set of eyes on my work.

UPDATE:

This is indicative of a factory.

I am also not sure the best way to name the contracts.

Dune suggests grabbing the contract name from Etherscan but as we see here the contract name for PLAY token is PProxy. I think it may be more beneficial to make these names more semantic.

Something like: pie_play

Maybe we could use a prefix and determine a naming convention from the documentation on PieDAO’s GitBook.

I am also not entirely familiar with the various types of contracts:

  • Pies
  • ExperiPie
  • Recipes
  • Ovens
  • Farms
  • Registries
  • Factories
  • Implementations and Facets
  • Misc

Generally, I like to ensure alignment before going on and building. In this case, I made some submissions to Dune without getting alignment and now I want to get alignment.

I am sure we can work with the Dune team to address any issues that exist with existing decoding or submissions.

I know that increasing our ability to query smart contract interactions could bring opportunity and value to PieDAO.

I am asking for input and insight on:

  1. Naming convention <— UPDATE: it may be best to use the contract names on Etherscan
  2. How to best answer proxy questions on each contract
  3. How to best answer factory questions on each contract <-- UPDATE: see above
  4. Contract types

Thank you – looking forward to getting these contracts decoded in Dune and empowering our community to dive deeper into what is going on within the PieDAO ecosystem!

6 Likes

Awesome that you are putting in the effort to get the contracts listed on Dune!

To answer your questions:

  1. IDK, Dune will probably know best

  2. All contracts use proxies and some even use Diamonds on top of proxies. I’m not sure how Dune handles Diamonds

  3. All pies were deployed using factories to simplify deployment. We did use multiple different factories over time

  4. Look below

Pies

Pies with an underlying Balancer pool

Recipes

Logic to source assets and bake a Pie, these are used by the ovens

Ovens

Used to bake pies in batches

Farms

Liquidity mining contracts

Registries

Keeps track of pies deployed. Often used by Ovens and recipes to know if something is a Pie

Factories

Used to deploy other contracts, mainly pies

Facets

Diamond standard facets

Implementations

Implementation contracts used by proxies

Misc

Miscellaneous contracts

Let me know how I can help you further.

1 Like

Mick – thank you for posting this information. I will replace this with a more developed update and response when I have a chance.

I appreciate you sharing these details! I am sure I will have some more questions

I wanted to check in here and apologize.

I have been extremely busy in my day job and haven’t been able to dedicate as much time as I would like to this.

With the Bankless partnership firing up, I have submitted the staking contract for decoding.

Link: https://etherscan.io/address/0x6de77a304609472a4811a0bfd47d8682aebc29df
Underlying Contract Link: https://etherscan.io/address/0x99dc8190e2afa8f4ac366f7f6c451dbd5935a535

Contract Address: 0x6de77a304609472a4811a0bfd47d8682aebc29df
Underlying Contract Address: 0x99dc8190e2afa8f4ac366f7f6c451dbd5935a535

I did not submit this contract as being generated by a factory, I am confident (hoping) that the Dune team is able to decode this successfully!

If this contract is decoded, I think we can start to do some analytics about the success of the partnership, as well as get more insight into traffic in and out of the farms over time.

Hoping to find more time to dedicate here in the near future, though my day job has me firing on all cylinders right now.

If there are any other PieDAO members who can support this initiative with me, I would appreciate it.

1 Like

After getting the staking contract decoded I was able to create an initial dashboard: https://duneanalytics.com/danner_eth/PieDAO

I would prefer to get these values in USD but the LP tokens are not tracked in prices.usd.

I see here that to add a token to prices.usd we need to use coinpaprika

Is anyone familiar with coinpaprika? I don’t see any LP tokens listed so I am not sure if this is possible.

I may try to submit an LP token for tracking here: https://coinpaprika.com/add/

Otherwise, LP token values would need to be calculated but I don’t see the underlying tokens in any of the abstractions.

I understand this is a bit more focused than the main objective of this thread to get contracts decoded, but want to keep some energy in this thread even if it’s just me for now!

1 Like