Skip to content

Instantly share code, notes, and snippets.

@jmcph4
Last active August 2, 2023 01:21
Show Gist options
  • Select an option

  • Save jmcph4/b936712ded60a7ec9058ecb22b9ec8df to your computer and use it in GitHub Desktop.

Select an option

Save jmcph4/b936712ded60a7ec9058ecb22b9ec8df to your computer and use it in GitHub Desktop.
SELECT
blockchain,
project,
version,
SUM(amount_usd) AS cumvol
FROM dex.trades
WHERE
block_date > CURRENT_TIMESTAMP - INTERVAL '12' month
GROUP BY
blockchain,
project,
version
ORDER BY
cumvol DESC
SELECT
blockchain,
project,
SUM(volume_usd) AS cumvol
FROM perpetual.trades
WHERE
block_date > CURRENT_TIMESTAMP - INTERVAL '12' month
GROUP BY
blockchain,
project
ORDER BY
cumvol DESC
SELECT
block_number,
profit_amount,
account_address,
protocols
FROM flashbots.arbitrages
WHERE error IS NULL
ORDER BY profit_amount DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment