Adapter

JunoSwap Fees

JunoSwap is an AMM protocol built on Juno

Sub-Adapters 1

Preview and test each sub adapter.

JunoSwap (junoswap)

Metadata

ID
junoswap
name

"JunoSwap"

icon
category

"dex"

description

"JunoSwap is an AMM protocol built on Juno"

feeDescription

"Trading fees are paid to liquidity providers"

blockchain

"Juno"

source

"JunoSwap API"

tokenTicker

"RAW"

tokenCoingecko

"junoswap-raw-dao"

website

"https://junoswap.com"

protocolLaunch

"2022-03-10"

Queries

Adapter Code

Check the entire code written for the Adapter.

Source code

Showing TS source.
1export const name = 'JunoSwap Fees';
2export const version = '0.1.0';
3export const license = 'MIT';
4
5export function setup(sdk: Context) {
6  // Cache the API result, so we only need to request it once
7  let feeDataPromise: Promise<any> | null = null;
8  const getFeeData = () => {
9    if (!feeDataPromise) {
10      feeDataPromise = sdk.http.get('https://api-junoswap.enigma-validator.com/volumes/total/historical/36M/d');
11    }
12    return feeDataPromise;
13  }
14
15  const getFees = async (date: string): Promise<number> => {
16    const data = (await getFeeData()).slice(0, -1); // Remove last, incomplete day
17
18    for (const day of data) {
19      if (day.date === `${date} 00:00:00`) {
20        return day.volume_total * 0.003;
21      }
22    }
23    return 0;
24  }
25
26  sdk.register({
27    id: 'junoswap',
28    queries: {
29      oneDayTotalFees: getFees,
30      oneDayProtocolFees: async () => 0,
31    },
32    metadata: {
33      name: 'JunoSwap',
34      icon: sdk.ipfs.getDataURILoader('QmRAkpGzjXEXXj8GVgHNL3ykSWEbFUXQER8n1mYHNCEJeX', 'image/svg+xml'),
35      category: 'dex',
36      description: 'JunoSwap is an AMM protocol built on Juno',
37      feeDescription: 'Trading fees are paid to liquidity providers',
38      blockchain: 'Juno',
39      source: 'JunoSwap API',
40      tokenTicker: 'RAW',
41      tokenCoingecko: 'junoswap-raw-dao',
42      website: 'https://junoswap.com',
43      protocolLaunch: '2022-03-10',
44    },
45  })
46}
47

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

QmNgCe9zRAfPhiGFKQJqg8uDNhqu5ZLL1MbyC7tEbNm9GJ

CID (source)

QmSvDbowJBZfH47mMzA25BxVEv4JHSjjCNE2Vd4fi8kcPG

Collections

Author

mihal.eth