-
Notifications
You must be signed in to change notification settings - Fork 8
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
Display the assets of DAOs #34
Comments
Keep in mind that some tokens are only used in a specific DAO and thus have no fiat conversion. To convert the assets price to fiat, we can use one of the following APIs:
More info on https://github.com/public-apis/public-apis#cryptocurrency |
Before choosing an API, we need to estimate the number of requests we will be doing. I'll try making a notebook to get how many tokens we have, (and which of them have a public price) |
We can use a combination of Coinmarketcap and Etherscan when needed |
AragonThe For example, let's see lexDAO It's address is In Etherscan, it says 1.7 ETH plus various Tokens. Exactly the same information as in the Aragon client. Also with blockscout Why not Using The GraphI don't know why, but it seems to have tokens with a negative balance... Maybe there are two ways of inserting tokens to a DAO, and the |
One problem I think we may have is that we don't have any historical data about the prices, but it might be important for temporal series... |
I found an API with free daily historical data. It's the one used on aragon client https://min-api.cryptocompare.com/pricing We can get the tokens that each vault has using the ethscan API or TheGraph, and then the historical data with cryptocompare. We can use the Aragon Finance subgraph, but It doesn't return the name of the token, and it's just harder to implement than etherscan
|
Hm... Now that I think of it, etherscan has an api just for mainnet, but what about other sidechains? |
Etherscan has to be discarded because it doesn't work with sidechains... Nevertheless, I found blockscout, here is Metacartel xDAI tokens and balance https://blockscout.com/xdai/mainnet/address/0xb152B115c94275b54a3F0b08c1Aa1D21f32a659a/tokens Sample API query: Response: {
"message": "OK",
"result": [
{
"balance": "295692983666393282927",
"contractAddress": "0x6a023ccd1ff6f2045c3309768ead9e68f978f6e1",
"decimals": "18",
"name": "Wrapped Ether on xDai",
"symbol": "WETH",
"type": "ERC-20"
},
{
"balance": "31010000000000000000",
"contractAddress": "0xb0c5f3100a4d9d9532a4cfd68c55f1ae8da987eb",
"decimals": "18",
"name": "DAOhaus Token on xDai",
"symbol": "HAUS",
"type": "ERC-20"
},
{
"balance": "1000000000000000",
"contractAddress": "0xb7d311e2eb55f2f68a9440da38e7989210b9a05e",
"decimals": "18",
"name": "STAKE on xDai",
"symbol": "STAKE",
"type": "ERC-20"
},
{
"balance": "100000000000000000000",
"contractAddress": "0xd3226b12e6188133b19ac0419f34b0ed5b10f069",
"decimals": "18",
"name": "EsportsRef",
"symbol": "ESR",
"type": "ERC-20"
},
{
"balance": "19079758648560662397693",
"contractAddress": "0xe91d153e0b41518a2ce8dd3d7944fa863463a97d",
"decimals": "18",
"name": "Wrapped XDAI",
"symbol": "WXDAI",
"type": "ERC-20"
}
],
"status": "1"
} |
DaohausWe can use either The Graph or blockscout. Blockscout also shows non-whitelisted tokens, but The Graph shows the proprietary of the tokens. Example for LexDAO ( Comparing with the To get the price history and build a time series, we can query the subgraph with a certain block number (easier), or we can just get all transactions and process them. |
DaostackWe can obtain the reputation supply from the subgraph. (Btw, it has 18 decimals), but Alchemy (DAOstack's web platform) seems to use etherscan to get the DAL holdings. For example, with dxDAO, we can get exactly the same data as in Alchemy just using this blockscout link: https://blockscout.com/eth/mainnet/address/0x519b70055af55A007110B4Ff99b0eA33071c720a/tokens#tokens |
Unknown tokensOn MetaCartel ventures treasury we can see a lot of strange tokens called MCV01, MCV02... and so forth. Maybe these kinds of tokens without USD value are not even worth saving on our database. On the other hand, we can't keep a manual list of "worthwhile" tokens, because of the rapid-changing world of crypto. We need an endpoint to get a list of the 1000 most used tokens or something like that so we can filter before saving the datawarehouse. |
Tokens without USD value ARE WORTH saving on our database. However, we will give them a different treatment (no value in USD will be shown). Thus, we need (at least) two lists: one for tokens with fiat value and one for tokens without it. |
According to Blockscout's documentation, Ethereum mainnet hosted instance is discontinued But we can use etherscan for mainnet if we just change our method of obtaining the ballances to a method of processing transactions |
I can't seem to do anything weird with the treemap, because it expects the non-leaf value to be the sum of all its children. Here you have the notebook I've been using to develop this, @javiag https://gist.github.com/daviddavo/b543aad74cd063ff391ca254c8115294 The second to last code frame is the one with the loop we can modify. We should edit the line |
Hi, a quick answer, without looking at your notebook. If you transform the USD value at the leaf level, it should work. That is, if you transform the value of the USD equivalence of crypto X hold by DAO Y deployed in network Z, then you can always go up the tree, that is, aggregate the transformed value and the problem of the non-leaf being the sum of all its children should work. Am I missing something? Regarding the transformation, I think root square could be more interesting than logarithm because:
|
It's finally done on all three platforms. I'll merge it with develop and the visual changes on Monday. |
For example, Aragon provides the Finance app, which lets you see the token balances of a given DAO. I still don't know if this is possible using The Graph, but first we have to fix #18
With other DAOs, we can get the info from Etherscan if The Graph API doesn't provide it, just given the eth address
This is also possible with Aragon using the address of the Vault/Agent app
The generated graphs can break down the tokens and display it in a graph bar using different colors, like "Proposals by type"
Treeview
The text was updated successfully, but these errors were encountered: