Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DAT-2607]; Add Curve Finance Fee substream #156

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ Reference/
**/target/
**/build/
**/data/
**/node_modules/

**/*.spkg
**/*.csv
**/*.clock
**/*.cursor
**/*.session


**/buf.gen.yaml
replay.log
Cargo.lock
50 changes: 42 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ members = [
"eth-supply",
"synthetix",
"aave-v2",
"curve-finance",
]
exclude = ["messari-cli"]

[workspace.dependencies]
substreams = "0.5.0"
substreams-ethereum = "0.8.0"
substreams-ethereum = "0.9"
substreams-solana = "0.1.0"

[build]
Expand Down
28 changes: 28 additions & 0 deletions curve-finance/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[package]
name = "curve_finance_substream"
version = "0.0.1"
edition = "2021"
repository = "https://github.com/messari/substreams/"

[lib]
crate-type = ["cdylib"]

[dependencies]
ethabi = "17"
hex = "0.4.3"
hex-literal = "0.3.4"
num-bigint = "0.4"
num-traits = "0.2.15"
prost = "0.11"
prost-types = "0.11"
substreams = "0.5"
substreams-ethereum = "0.9"
substreams-database-change = "1"
substreams-entity-change = "1"
substreams-helper = { path = "../substreams-helper" }

[build-dependencies]
anyhow = "1"
regex = "1.8"
substreams-ethereum = "0.9"
substreams-common = { path = "../common" }
21 changes: 21 additions & 0 deletions curve-finance/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.PHONY: build_all
build_all:
$(MAKE) -C ../erc20-price build
$(MAKE) -C ../erc20-price pack
cargo build --target wasm32-unknown-unknown --release

.PHONY: build
build:
cargo build --target wasm32-unknown-unknown --release

.PHONY: run
run:
substreams run -e polygon.streamingfast.io:443 substreams.yaml map_pool_created -s 11153725

.PHONY: build_csv
build_csv:
substreams-sink-csv -e polygon.substreams.pinax.network --manifest ./curve-finance-substream-v0.1.0.spkg --module-name map_pool_fees --start-block 13479484 --production-mode true

.PHONY: pack
pack:
substreams pack ./substreams.yaml
159 changes: 159 additions & 0 deletions curve-finance/abi/address_provider.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
[
{
"name": "NewAddressIdentifier",
"inputs": [
{ "type": "uint256", "name": "id", "indexed": true },
{ "type": "address", "name": "addr", "indexed": false },
{ "type": "string", "name": "description", "indexed": false }
],
"anonymous": false,
"type": "event"
},
{
"name": "AddressModified",
"inputs": [
{ "type": "uint256", "name": "id", "indexed": true },
{ "type": "address", "name": "new_address", "indexed": false },
{ "type": "uint256", "name": "version", "indexed": false }
],
"anonymous": false,
"type": "event"
},
{
"name": "CommitNewAdmin",
"inputs": [
{ "type": "uint256", "name": "deadline", "indexed": true },
{ "type": "address", "name": "admin", "indexed": true }
],
"anonymous": false,
"type": "event"
},
{
"name": "NewAdmin",
"inputs": [{ "type": "address", "name": "admin", "indexed": true }],
"anonymous": false,
"type": "event"
},
{
"outputs": [],
"inputs": [{ "type": "address", "name": "_admin" }],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"name": "get_registry",
"outputs": [{ "type": "address", "name": "" }],
"inputs": [],
"stateMutability": "view",
"type": "function",
"gas": 1061
},
{
"name": "max_id",
"outputs": [{ "type": "uint256", "name": "" }],
"inputs": [],
"stateMutability": "view",
"type": "function",
"gas": 1258
},
{
"name": "get_address",
"outputs": [{ "type": "address", "name": "" }],
"inputs": [{ "type": "uint256", "name": "_id" }],
"stateMutability": "view",
"type": "function",
"gas": 1308
},
{
"name": "add_new_id",
"outputs": [{ "type": "uint256", "name": "" }],
"inputs": [
{ "type": "address", "name": "_address" },
{ "type": "string", "name": "_description" }
],
"stateMutability": "nonpayable",
"type": "function",
"gas": 291275
},
{
"name": "set_address",
"outputs": [{ "type": "bool", "name": "" }],
"inputs": [
{ "type": "uint256", "name": "_id" },
{ "type": "address", "name": "_address" }
],
"stateMutability": "nonpayable",
"type": "function",
"gas": 182430
},
{
"name": "unset_address",
"outputs": [{ "type": "bool", "name": "" }],
"inputs": [{ "type": "uint256", "name": "_id" }],
"stateMutability": "nonpayable",
"type": "function",
"gas": 101348
},
{
"name": "commit_transfer_ownership",
"outputs": [{ "type": "bool", "name": "" }],
"inputs": [{ "type": "address", "name": "_new_admin" }],
"stateMutability": "nonpayable",
"type": "function",
"gas": 74048
},
{
"name": "apply_transfer_ownership",
"outputs": [{ "type": "bool", "name": "" }],
"inputs": [],
"stateMutability": "nonpayable",
"type": "function",
"gas": 60125
},
{
"name": "revert_transfer_ownership",
"outputs": [{ "type": "bool", "name": "" }],
"inputs": [],
"stateMutability": "nonpayable",
"type": "function",
"gas": 21400
},
{
"name": "admin",
"outputs": [{ "type": "address", "name": "" }],
"inputs": [],
"stateMutability": "view",
"type": "function",
"gas": 1331
},
{
"name": "transfer_ownership_deadline",
"outputs": [{ "type": "uint256", "name": "" }],
"inputs": [],
"stateMutability": "view",
"type": "function",
"gas": 1361
},
{
"name": "future_admin",
"outputs": [{ "type": "address", "name": "" }],
"inputs": [],
"stateMutability": "view",
"type": "function",
"gas": 1391
},
{
"name": "get_id_info",
"outputs": [
{ "type": "address", "name": "addr" },
{ "type": "bool", "name": "is_active" },
{ "type": "uint256", "name": "version" },
{ "type": "uint256", "name": "last_modified" },
{ "type": "string", "name": "description" }
],
"inputs": [{ "type": "uint256", "name": "arg0" }],
"stateMutability": "view",
"type": "function",
"gas": 12168
}
]
Loading
Loading