Skip to content

Commit

Permalink
Add VNM circulating supply (#106)
Browse files Browse the repository at this point in the history
Co-authored-by: jacobwarren44 <[email protected]>
  • Loading branch information
TheTapHouse and jacobwarren44 authored Sep 19, 2023
1 parent a4aa0a0 commit 2e65ad2
Show file tree
Hide file tree
Showing 2 changed files with 21 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 @@ -52,6 +52,7 @@ import snowFetcher from "./tokens/snow";
import societyFetcher from "./tokens/society";
import stableFetcher from "./tokens/stable";
import sundaeFetcher from "./tokens/sundae";
import vnmFetcher from "./tokens/vnm";
import vyfiFetcher from "./tokens/vyfi";
import wmtFetcher from "./tokens/wmt";
import wozFetcher from "./tokens/woz";
Expand Down Expand Up @@ -166,4 +167,5 @@ export const supplyFetchers: Record<string, SupplyFetcher> = {
"1ddcb9c9de95361565392c5bdff64767492d61a96166cb16094e54be4f5054": optFetcher,
b316f8f668aca7359ecc6073475c0c8106239bf87e05a3a1bd5697647856594649:
xvyfiFetcher,
"2d92af60ee429bce238d3fd9f2531b45457301d74dad1bcf3f9d1dca564e4d": vnmFetcher,
};
19 changes: 19 additions & 0 deletions src/tokens/vnm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";

const VNM = "2d92af60ee429bce238d3fd9f2531b45457301d74dad1bcf3f9d1dca564e4d";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const total = 150e6;
const blockFrost = getBlockFrostInstance(options);
const treasuryRaw = await getAmountInAddresses(blockFrost, VNM, [
"stake1u8uv6eaj6ulpymd7ua6ag203fet6ypv9xj7aj8525vnjwyqlqyqsp",
]);
const treasury = Number(treasuryRaw) / 1e4;
return {
circulating: (total - treasury).toString(),
total: total.toString(),
};
};

export default fetcher;

0 comments on commit 2e65ad2

Please sign in to comment.