superfluid-finance / tokenlist

A Superfluid TokenList builder for https://tokenlists.org/
3 stars 2 forks source link

Add `minimumDeposit` and `liquidationPeriod` to the token list #11

Open kasparkallas opened 1 year ago

kasparkallas commented 1 year ago

Why? This information is necessary to build wrap/unwrap/send UI-s.

Solution This is the query from Subgraph. If Token.governanceConfig === null then the default value from 0x0000000000000000000000000000000000000000 should be used.

query {
  tokenGovernanceConfig(id: "0x0000000000000000000000000000000000000000") {
    minimumDeposit
    liquidationPeriod
  }
  tokens {
    governanceConfig {
      liquidationPeriod
      minimumDeposit
    }
  }
}

I propose adding these values to the superTokenInfo extension in exactly the same shape.

Example:

{
  "address": "0x7cd00c2b9a78f270b897457ab070274e4a17de83",
  "name": "Super Dai Stablecoin",
  "symbol": "DAI.ex",
  "decimals": 18,
  "chainId": 43114,
  "extensions": {
    "superTokenInfo": {
      "type": "Wrapper",
      "underlyingTokenAddress": "0xd586e7f844cea2f87f50152665bcbc2c279d8d70",
      "minimumDeposit": "0",
      "liquidationPeriod": "14400"
    }
  },
  "logoURI": "https://raw.githubusercontent.com/superfluid-finance/assets/master/public/tokens/dai/icon.svg",
  "tags": ["supertoken"]
}

Notes Maybe an RPC query is preferred over putting this in the token list.

vmichalik commented 9 months ago

I don't believe adding to the tokenlist would be viable, since governance updates won't automatically invoke a tokenlist update. unless you'd proposing we also add that