There isn't enough information in on-chain calls & events to easily get a full picture of Rari Fuse pools on Dune Analytics. This eth-brownie script queries the Rari Fuse contracts on Ethereum mainnet and creates a Dune User-Generated Table SQL file containing the Fuse Pool, Fuse fToken and underlying token details.
The outputs of this are implemented in the Dune Ethereum tables/views:
- rari_capital.view_rari_fuse_ftokens
- dune_user_generated.rari_capital_fuse_ftokens
They will be updated from time to time. The rari_capital.view_rari_fuse_ftokens may lag as it requires a PR to be processed by Dune to update.
Please install or have installed the following:
- Install Brownie, if you haven't already. Here is a simple way to install brownie.
pip install eth-brownie
Or, if that doesn't work, via pipx
pip install --user pipx
pipx ensurepath
# restart your terminal
pipx install eth-brownie
npm install -g ganache-cli
- Set up Brownie Environment
Configure .env file in the rari_fuse_sql folder with an Infura or Alchemy API ID, and an etherscan API id:
export ETHERSCAN_TOKEN=<your etherscan api id>
export WEB3_ALCHEMY_PROJECT_ID=<your api id>
#or
export WEB3_INFURA_PROJECT_ID=<your api id>
If using Alchemy, switch to Alchemy providers using:
brownie networks set_provider alchemy
- Clone this repo
git clone https://github.com/scottincrypto/dune-rari-fuse-assets
- Run the script
cd rari_fuse_sql
brownie run fusepools
- Execute the SQL
The contents of the resulting output file rari.sql can be copy/pasted into Dune Analytics to refresh the token list