diff --git a/src/adapters/peggedAssets/colb-usd-stablecolb/index.ts b/src/adapters/peggedAssets/colb-usd-stablecolb/index.ts new file mode 100644 index 00000000..9f41462c --- /dev/null +++ b/src/adapters/peggedAssets/colb-usd-stablecolb/index.ts @@ -0,0 +1,56 @@ +const sdk = require("@defillama/sdk"); +import { sumSingleBalance } from "../helper/generalUtil"; +import { + ChainBlocks, + PeggedIssuanceAdapter, + Balances, +} from "../peggedAsset.type"; + +type ChainContracts = { + [chain: string]: { + [contract: string]: string[]; + }; +}; + +const chainContracts: ChainContracts = { + polygon: { + issued: ["0x72C96C73207936E94066b4C8566C6987c9a1f1dE"], + }, +}; + +async function chainMinted(chain: string, decimals: number) { + return async function ( + _timestamp: number, + _ethBlock: number, + _chainBlocks: ChainBlocks + ) { + let balances = {} as Balances; + for (let issued of chainContracts[chain].issued) { + const totalSupply = ( + await sdk.api.abi.call({ + abi: "erc20:totalSupply", + target: issued, + block: _chainBlocks?.[chain], + chain: chain, + }) + ).output; + sumSingleBalance( + balances, + "peggedUSD", + totalSupply / 10 ** decimals, + "issued", + false + ); + } + return balances; + }; +} + +const adapter: PeggedIssuanceAdapter = { + polygon: { + minted: chainMinted("polygon", 18), + 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 70a7014a..4deaffc2 100644 --- a/src/adapters/peggedAssets/index.ts +++ b/src/adapters/peggedAssets/index.ts @@ -147,6 +147,7 @@ import usde from "./ethena-usde"; import aeur from "./anchored-coins-eur"; import myusd from "./myusd"; import usds from "./sable-coin"; +import scb from "./colb-usd-stablecolb" export default { tether, @@ -297,5 +298,6 @@ export default { "ethena-usde": usde, "anchored-coins-eur": aeur, myusd, //fake coingecko, replace once live - "sable-coin": usds + "sable-coin": usds, + "colb-usd-stablecolb": scb }; diff --git a/src/peggedData/peggedData.ts b/src/peggedData/peggedData.ts index 9a976972..276911ad 100644 --- a/src/peggedData/peggedData.ts +++ b/src/peggedData/peggedData.ts @@ -3002,4 +3002,24 @@ export default [ twitter: "https://twitter.com/SableFinance", wiki: "https://sable-finance.gitbook.io/docs/", }, + { + id: "150", + name: "USD Stable Colb", + address: "polygon:0x72c96c73207936e94066b4c8566c6987c9a1f1de", + symbol: "SCB", + url: "https://www.colb.finance", + description: + "A USD-backed stablecoin, strictly pegged 1:1 to the United States Dollar and issued in full compliance with Swiss legislation. SCB is fully collateralised by cash and cash equivalents, securely held in custody with a Swiss private bank and verified by third-party attestations.", + mintRedeemDescription: + "When a user triggers an SCB issuance request through a USD bank transfer, our compliance team undertakes an initial verification to uphold regulatory adherence. When a whitelisted user decides to redeem SCB, he must firstly sign a transaction in his non-custodial wallet to send the SCB to the burn address. At this stage, our compliance team is informed and undertakes a client file verification. Then, Colb Trust advances to reduce the circulating supply, ultimately burning the stablecoins. Then it is the custodian bank's job to be as efficient as possible to send the USD bank transfer to the user (1 to 4 business days).", + onCoinGecko: "true", + gecko_id: "colb-usd-stablecolb", + cmcId: null, + pegType: "peggedUSD", + pegMechanism: "fiat-backed", + priceSource: "coingecko", + auditLinks: null, + twitter: "https://twitter.com/colb_finance", + wiki: "https://www.colb.finance/faq", + }, ] as PeggedAsset[];