Sub-Adapters 1
Preview and test each sub adapter.
Index Coop (dseth-adapter)
Metadata
- ID
- dseth-adapter
- name
"Index Coop"
- icon
"https://app.indexcoop.com/static/media/index-logo-black.5c2bd6ea8cb24a7664052bc6572dc9f8.svg"
- description
"Crypto Index Products"
- blockchain
"Ethereum"
- source
"Index Coop API"
- website
"https://app.indexcoop.com/dseth"
- tokenTicker
"dsETH"
- tokenCoingecko
"diversified-staked-eth"
Queries
Adapter Code
Check the entire code written for the Adapter.
Source code
Showing TS source.
1export const name = 'dsETH';
2export const version = '0.0.1';
3export const license = 'MIT';
4
5export function setup(sdk: Context) {
6 const getApy = () => async (): Promise<number> => {
7 const url = "https://api.indexcoop.com/dseth/apy"
8 const res = await sdk.http.get(url)
9 const apy = sdk.ethers.BigNumber.from(res["apy"]);
10 return Number(sdk.ethers.utils.formatUnits(apy, 18));
11 }
12
13 sdk.register({
14 id: 'dseth-adapter',
15 queries: {
16 apyCurrent: getApy(),
17 },
18 metadata: {
19 name: 'Index Coop',
20 icon: 'https://app.indexcoop.com/static/media/index-logo-black.5c2bd6ea8cb24a7664052bc6572dc9f8.svg',
21 description: 'Crypto Index Products',
22 blockchain: 'Ethereum',
23 source: 'Index Coop API',
24 website: 'https://app.indexcoop.com/dseth',
25 tokenTicker: 'dsETH',
26 tokenCoingecko: 'diversified-staked-eth',
27 },
28 });
29}
30
It's something off?
Report it to the discussion board on Discord, we will take care of it.