Skip to content

Commit

Permalink
Add myield treasury
Browse files Browse the repository at this point in the history
  • Loading branch information
MuesliSwapTeam committed Sep 20, 2023
1 parent 1e597a9 commit 0c0b97c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import minFetcher from "./tokens/min";
import mintFetcher from "./tokens/mint";
import mntFetcher from "./tokens/mnt";
import moaiFetcher from "./tokens/moai";
import myieldFetcher from "./tokens/myield";
import newmFetcher from "./tokens/newm";
import ninjazFetcher from "./tokens/ninjaz";
import nmkrFetcher from "./tokens/nmkr";
Expand Down Expand Up @@ -182,4 +183,5 @@ export const supplyFetchers: Record<string, SupplyFetcher> = {
utilFetcher,
a3931691f5c4e65d01c429e473d0dd24c51afdb6daf88e632a6c1e516f7263666178746f6b656e:
factFetcher,
"8f9c32977d2bacb87836b64f7811e99734c6368373958da20172afba4d5949454c44": myieldFetcher,
};
22 changes: 22 additions & 0 deletions src/tokens/myield.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";

const MYIELD = "8f9c32977d2bacb87836b64f7811e99734c6368373958da20172afba4d5949454c44";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const total = 100_000_000;
const treasuryRaw = await getAmountInAddresses(blockFrost, MYIELD, [
"stake1ux2veurnjdppn4x6tvulrj6jthqk54asu3yehcs427xztzsjhs5d8", // treasury
"addr1vxg4dazeyyzc40g26ty22uyz5nrnax4gmyfj8m87xl44wvsw3pyfp", // transformer
"addr1v9fcrvald5nsm3dc63lcchrra2xckmq9stt0pwkeshd4c5gvwax06", // rewards
"addr1vxfa8dwzflct4re7qn2ls7t46w6rc479rafnwzqx4z2asuq6cg00t", // rewards
]);
const treasury = Number(treasuryRaw) / 1e6;
return {
circulating: (total - treasury).toString(),
total: total.toString(),
};
};

export default fetcher;

0 comments on commit 0c0b97c

Please sign in to comment.