Giter Club home page Giter Club logo

ethereum-lake's Introduction

ethereum-lake

ethereum-lake provide you a one-stop tool to Extract/Transform/Load data from Ethereum like EVM Block chain.

All you need to do is changing the destination endpoints like MySQL / Postgresql / MongoDB / TiDB / CockroachDB.

Test GoDoc GoReportCard

Goals

This project aims to solve the pain points and difficulties encountered when pulling data from EVM-based public chains such as Ethereum for ETL purposes, helping users synchronize on-chain data and supporting data synchronization to various types of OLAP/OLTP/HTAP databases. And Provide users a best way to explore on-chain DeFi data with portfolio API with Chainbase's SQL API or using synchronized data.

Key Features

  • Support for multiple databases to meet users' various scenario requirements. OLTP database with MySQL / PostgreSQL protocol and OLAP database with ClickHouse protocol.
  • Support on-chain DeFi protocol portfolio API.
  • Resolving reorg issue - when reorg occurs, the data already consumed by the database will be corrected/modified.
  • Real-time updates - users can obtain the latest data.
  • Provide blazing-fast, easy solution to synchronize data.
  • Support dual-write on data to enhance the experience of HTAP. If you want to take into account the analysis scenario, you can register MySQL and ClickHouse in the service at the same time. When you need to index a certain row, you can use MySQL or other OLTP databases to query your data while ClickHouse when you need to analyze.
  • Support Spark calculation tools for ClickHouse / PostgreSQL / TiDB to support massive data computing. When your dataset's getting larger and it's hard to execute some SQL.
  • Integrated Cache Layer to reduce the rpc call and accelerate process when synchronizing data.

Use As A Client

Requirement Go 1.20+

go get github.com/indexer3/ethereum-lake
package main

import (
	"context"
	"fmt"

	"github.com/ethereum/go-ethereum/common"
	"github.com/indexer3/ethereum-lake/common/client"
	"github.com/indexer3/ethereum-lake/constant"
)

func main() {
	ethCli, err := client.NewNodeClientsWithEndpoints([]string{"https://rpc.ankr.com/eth"})
	if err != nil {
		panic(err)
	}

	wethInETHContractAddress := common.HexToAddress("0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2")
	uniswapInETHTokenContractAddress := common.HexToAddress("0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984")

	ctx := context.Background()

	wethPrice, err := ethCli.TokenPrice(ctx, constant.NetworkEthereum, wethInETHContractAddress, nil)
	if err != nil {
		panic(err)
	}

	fmt.Println("ethereum network: WETH price:", wethPrice)

	uniPrice, err := ethCli.TokenPrice(ctx, constant.NetworkEthereum, uniswapInETHTokenContractAddress, nil)
	if err != nil {
		panic(err)
	}

	fmt.Println("ethereum network: UNI price:", uniPrice)
}

DeFi Compatiable

Protocol Client Compatiable Portfolio Compatiable
AaveV2 x
AaveV3 x x
Curve x x
Balancer x
Bancor x
Compound x
Convex x
UniswapV2 x x
UniswapV3 x x
GMX x
1Inch x
Synthetix x
Stargate x
Tornado x
Yearn x

Contribution

  • Suggestions, comments (including criticisms) and contributions are welcome.
  • Please follow the PR/issue template provided to ensure that your contributions are clear and easy to understand.

License

MIT License

ethereum-lake's People

Contributors

ddl-hust avatar fenghaojiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

ddl-hust

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.