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

feat: add base network #609

Merged
merged 46 commits into from
Sep 11, 2023
Merged

feat: add base network #609

merged 46 commits into from
Sep 11, 2023

Conversation

0xBasically
Copy link
Contributor

Related issue # (if applicable):

What I did:

add base network to exporter

How I did it:

How to verify it:

source .env
make up network=base

Checklist:

Network: Base
Chain ID: 8453

Make sure all points are addressed. This is a list for adding full network support to the exporter.
To configure the network correctly you must add the following constants:

  • in ./yearn/constants.py:

    • specify Treasury address. (if Yearn has a treasury contract deployed) This would be the rewards() address of any vault.
    • specify Multisig address. This would be the governance() address of any vault
    • specify Strategist Multisig address. (if Yearn has a SMS deployed) This would be the management() address of any vault.
  • in ./yearn/prices/constants.py:

    • add weth address to tokens_by_network.
    • add usdc address to tokens_by_network.
    • add dai address to tokens_by_network.
    • configure stablecoins using popular + "safe" stablecoins on the chain.
    • add the {{network}} gas token address to wrapped_gas_coin field.
  • in ./yearn/multicall2.py:

    • specify the appropriate multicall2 contract address.
  • in ./yearn/ironbank.py:

    • [-] add ironbank deployment address
  • in ./yearn/prices/compound.py:

    • [-] add ib comptroller
  • in ./yearn/v2/registry.py:

    • add v2 vault release registry
  • in yearn/yearn.py:

    • add v2 vault registry and
    • [-]ironbank registry
  • in ./yearn/prices/constants.py:

    • specify ib_snapshot_block_by_network, if any, the start block of Ironbank on this network or specify '1' if not applicable.
  • in ./yearn/prices/uniswap/v2.py:

    • [-] specify the factory and router address for any important uni v2 forks on the chain.

in ./yearn/prices/uniswap/v3.py:

  • add info about uni v3 deployed on network

  • in ./yearn/utils.py:

    • specify BINARY_SEARCH_BARRIER as 0 if all historical data is available. If historical data not available due to a network upgrade/etc, specify the first block of the available historical data.
  • in ./yearn/middleware/middleware.py:

    • [-] specify BATCH_SIZE of approx 1 day based on avg block times on the chain.
  • in ./scripts/historical-exporter.py:

    • configure end to equal the date + hour of deployment for the first Yearn product on the chain.
    • [-] configure data_query. See mapping in ./yearn/outputs/victoria/output_helper.py to figure out the metric to specify based on what type of product was the first deployed on the chain.
  • in ./scripts/historical-treasury-exporter.py:

    • configure end to equal the date + hour of deployment for the Yearn Treasury on the chain.
    • configure data_query using the existing networks as an example.
  • in ./scripts/historical-sms-exporter.py:

    • configure end to equal the date + hour of deployment for the Strategist Multisig on the chain.
    • configure data_query using the existing networks as an example.

You also need to set up containers for each exporter on the new chain. This is a little more complicated but you can use existing containers as an example:

  • define common envs for the chain
  • [] add one new service entry for forwards exporter
  • add one new service entry for treasury exporter
  • add one new service entry for sms exporter
  • add one new service entry for wallet exporter
  • add one new service entry for transactions exporter
  • adapt entrypoint.sh

in ./Makefile: Set up network specific make command.

  • network
  • logs-network

It's important to test to make sure everything works!

Once you've handled everything above, type make up <network> into your terminal replacing network with your network name at the project root. The network specific exporters will start running in docker and any exceptions will show in your terminal. If there are no exceptions, and everything appears to be running smoothly then it should be working correctly.

  • yes I have tested it and it is running as expected

@0xBasically 0xBasically force-pushed the feat-add-base branch 3 times, most recently from 69deb4b to b876f22 Compare September 11, 2023 21:22
@0xBasically 0xBasically merged commit 5491960 into master Sep 11, 2023
0 of 18 checks passed
@0xBasically 0xBasically deleted the feat-add-base branch September 11, 2023 23:50
0xBasically added a commit to 0xBasically/yearn-exporter that referenced this pull request Sep 13, 2023
* add: constants info

* add: prices/constants

* add: mc3

* add: release registry

* add: yearn.py products

* add: uni v3

* add: uni v3 2

* add: binary search barrier

* add: vaults start date

* add: base network

* add: base network make

* add: base docker-compose

* fix: set network envs

* add hacky brownie init fix

* rebase

* fix: batch size

* update contant

* fix: vaults.py

* update: treasury.py

* rebase

* refactor: yearn.py

* bump dank

* bump ypm

* add: delegated partners contract

* add: lens v2

* update: s3

* fix: registry

* temp: no curve pool base

* delete: no cache

* rebase: async update ypm

* update: uni v3 quoter for base

* fix: typo

* add: batch_size and block info to transactions.py

* fix: transactions batch end block

* update: s3 registry

* update s3 registry adapter

* increase: batchsize

* fix: wallets.py start time

* fix: wallets

* fix-treasury rebase messed up

* fix: tuple error wallets

* bump ypm

* add: base wrapped gas coin

* chore: add debug logger

* fix: rebase err

* fix: EventLookupError

---------

Co-authored-by: BobTheBuidler <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants