diff --git a/src/adapters/peggedAssets/hedera-swiss-franc/index.ts b/src/adapters/peggedAssets/hedera-swiss-franc/index.ts new file mode 100644 index 0000000..0b0cd34 --- /dev/null +++ b/src/adapters/peggedAssets/hedera-swiss-franc/index.ts @@ -0,0 +1,36 @@ +const axios = require("axios"); +const retry = require("async-retry"); +import { + Balances, + ChainBlocks, + PeggedIssuanceAdapter, +} from "../peggedAsset.type"; + +async function hederaMinted() { + return async function ( + _timestamp: number, + _ethBlock: number, + _chainBlocks: ChainBlocks + ) { + const issuance = await retry( + async (_bail: any) => + await axios.get( + "https://mainnet-public.mirrornode.hedera.com/api/v1/tokens/0.0.6070123" + ) + ); + const supply = issuance?.data?.total_supply; + let balance = supply / 10 ** 8; + console.log(balance); + return { peggedCHF: balance }; + }; +} + + +const adapter: PeggedIssuanceAdapter = { + hedera: { + minted: hederaMinted(), + unreleased: async () => ({}), + }, +}; + +export default adapter; \ No newline at end of file diff --git a/src/adapters/peggedAssets/index.ts b/src/adapters/peggedAssets/index.ts index e69622c..1a5c4c6 100644 --- a/src/adapters/peggedAssets/index.ts +++ b/src/adapters/peggedAssets/index.ts @@ -33,6 +33,7 @@ import sperax from "./sperax-usd"; import usdp from "./usdp"; import usdb from "./usd-balance"; import mimatic from "./mimatic"; +import hchf from "./hedera-swiss-franc"; //import ratio from "./ratio-stable-coin"; import usdj from "./just-stablecoin"; import stbl from "./stbl"; @@ -397,5 +398,6 @@ export default { "classic-usd": classicusd, "resolv-usr": usr, "stable-jack-ausd": ausd, + "hedera-swiss-franc": hchf, "celo-real-creal": creal }; diff --git a/src/peggedData/peggedData.ts b/src/peggedData/peggedData.ts index 21c0714..f8971e0 100644 --- a/src/peggedData/peggedData.ts +++ b/src/peggedData/peggedData.ts @@ -2202,19 +2202,19 @@ export default [ { id: "110", name: "crvUSD", - address: "0x95ECDC6caAf7E4805FCeF2679A92338351D24297", + address: "0xf939e0a03fb07f59a73314e73794be0e57ac1b4e", symbol: "crvUSD", url: "https://curve.fi", description: "crvUSD is a collateralized-debt-position (CDP) stablecoin pegged to the US Dollar", mintRedeemDescription: "Users deposit collateral to borrow crvUSD", - onCoinGecko: "false", + onCoinGecko: "true", gecko_id: "crvusd", cmcId: null, pegType: "peggedUSD", pegMechanism: "crypto-backed", priceSource: "defillama", - auditLinks: null, + auditLinks: ["https://docs.curve.fi/references/audits/#curve-stablecoin-and-lending"], twitter: "https://twitter.com/CurveFinance", wiki: null, }, @@ -4004,4 +4004,24 @@ export default [ twitter: "https://twitter.com/CeloOrg", wiki: "https://blog.celo.org/celo-launches-the-creal-stablecoin-11da0d560c1c", }, + { + id: "200", + name: "Hedera Swiss Franc", + address: "hedera:0x00000000000000000000000000000000005c9f6b", + symbol: "HCHF", + url: "https://hliquity.org/", + description: + "A stablecoin pegged to the Swiss Franc", + mintRedeemDescription: + "HLiquity offers interest-free loans. Lock up your HBAR, borrow HCHF against it, and repay later without interest", + onCoinGecko: "true", + gecko_id: "hedera-swiss-franc", + cmcId: null, + pegType: "peggedCHF", + pegMechanism: "crypto-backed", + priceSource: "defillama", + auditLinks: null, + twitter: "https://x.com/hliquity_", + wiki: "https://docs.hliquity.org/overview/overview#hchf-the-stablecoin", + }, ] as PeggedAsset[];