Adapter

Honeyswap Fees

HoneySwap is a permissionless, decentralized exchange

Sub-Adapters 1

Preview and test each sub adapter.

HoneySwap (honeyswap)

Metadata

ID
honeyswap
name

"HoneySwap"

icon
category

"dex"

description

"HoneySwap is a permissionless, decentralized exchange"

feeDescription

"Trading fees are paid by traders to liquidity providers"

website

"https://honeyswap.org"

blockchain

"Gnosis Chain"

source

"The Graph Protocol"

adapter

"honeyswap"

protocolLaunch

"2020-09-03"

tokenCoingecko

"honey"

tokenSymbol

"HNY"

Queries

Adapter Code

Check the entire code written for the Adapter.

Source code

Showing TS source.
1export const name = 'Honeyswap Fees';
2export const version = '0.1.0';
3export const license = 'MIT';
4
5const ONE_DAY = 86400;
6
7export function setup(sdk: Context) {
8  const getFees = async (date: string): Promise<number> => {
9    const dateId = Math.floor(sdk.date.dateToTimestamp(date) / ONE_DAY);
10    const nextDate = dateId + 1;
11
12    const graphQuery = `query fees($dateId: Int!, $nextDate: Int!) {
13      uniswapDayData(id: $dateId) {
14        date
15        dailyVolumeUSD
16      }
17      nextDay: uniswapDayData(id: $nextDate) {
18        date
19      }
20    }`;
21    const data = await sdk.graph.query('1hive/honeyswap-v2', graphQuery, { dateId, nextDate });
22
23    if (!data.nextDay) {
24      throw new Error('Day incomplete');
25    }
26
27    const oneDayVolume = data.uniswapDayData.dailyVolumeUSD;
28    const oneDay = oneDayVolume * 0.003;
29
30    return oneDay;
31  }
32
33  sdk.register({
34    id: 'honeyswap',
35    queries: {
36      oneDayTotalFees: getFees,
37    },
38    metadata: {
39      name: 'HoneySwap',
40      icon: sdk.ipfs.getDataURILoader('QmTZCcuspuSki2823DVqTc1YpfDnvA4nTJuVduZHeuysxH', 'image/svg+xml'),
41      category: 'dex',
42      description: 'HoneySwap is a permissionless, decentralized exchange',
43      feeDescription: 'Trading fees are paid by traders to liquidity providers',
44      website: 'https://honeyswap.org',
45      blockchain: 'Gnosis Chain',
46      source: 'The Graph Protocol',
47      adapter: 'honeyswap',
48      protocolLaunch: '2020-09-03',
49      tokenCoingecko: 'honey',
50      tokenSymbol: 'HNY',
51    },
52  })
53}
54

It's something off?

Report it to the discussion board on Discord, we will take care of it.

Adapter Info

Version

0.1.0

License

MIT

IPFS CID

QmRokrhhV2ycAnSxvxDnGoAF1aUf3E1VkwctotwDvtpYP1

CID (source)

QmdCNreE7BQ1LSNaKfvc2iCPRnTpZci1DzJkyzuBuxhPeY

Collections

Author

mihal.eth