Giter VIP home page Giter VIP logo

retroactive-query-6's Introduction

@uniswap/retroactive-query

Run Queries

This repository contains queries that produce the tables of retroactive UNI token distributions.

The queries run in Google BigQuery against the bigquery-public-data.crypto_ethereum dataset.

Data for this dataset is extracted to Google BigQuery using blockchain-etl/ethereum-etl.

Specifications

All queries have a cutoff timestamp of 2020-09-01 00:00:00+00 GMT. Total distribution is aimed at 150_000_000 UNI.

All users

400 UNI goes to:

  • any account that directly calls a Uniswap pair or a Uniswap router contract
  • any address that transfers any liquidity provider tokens or pair tokens to a Uniswap pair or a Uniswap router contract
  • any address that holds liquidity provider tokens for a non-zero number of seconds

Liquidity providers

  • all liquidity is weighted by ETH value of liquidity / total ETH value
  • fixed reward rate per second to all LPs pro-rata
  • total rewards to liquidity providers is 150_000_000 - amount to users

SOCKS users

1000 UNI goes to:

  • every address that burns any SOCKS
  • every address that holds at least 1 SOCKS token

Reproduction

You can reproduce the results of this query by forking this repository and adding your own secrets to run in your own GCP account.

  1. Create a Google Cloud project here
  2. Find your Project ID in the Google Cloud console here
  3. Fork this repository
  4. Add the secret GCP_PROJECT_ID under Settings > Secrets containing your project ID from the GCP dashboard
  5. Add the secret GCP_SA_KEY under Settings > Secrets containing the base64 encoded JSON key of a service account
  6. Go to the actions tab of your fork
  7. Run the workflow (roughly ~20 minutes to complete)
  8. Inspect the resulting tables

Determinism notes

Note that, for floating point input types, the return result of aggregations is non-deterministic, which means you will not get the exact same result each time you aggregate floating point columns.

These queries make use of floating point numbers. However in the final all_earnings_hexadecimal table, we truncate to 6 decimal places so that the result used for production is the same across multiple runs.

See https://cloud.google.com/bigquery/docs/reference/standard-sql/aggregate_functions for more information.

Final results

The blob containing all the proofs of the retroactive distribution can be found at mrkl.uniswap.org.

retroactive-query-6's People

Contributors

moodysalem avatar noahzinsmeister avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.