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 #577

Closed
wants to merge 42 commits into from
Closed

feat: add base #577

wants to merge 42 commits into from

Conversation

0xBasically
Copy link
Contributor

@0xBasically 0xBasically commented Aug 29, 2023

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 marked this pull request as ready for review August 31, 2023 00:48
@0xBasically 0xBasically added enhancement New feature or request p0 Critical/Needed labels Aug 31, 2023
@0xBasically 0xBasically force-pushed the feat-add-base branch 6 times, most recently from a5e4fe5 to 29645e4 Compare September 6, 2023 19:14
* fix: price err tvl edge case

* chore: cleanup
@0xBasically 0xBasically closed this Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p0 Critical/Needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants