diff --git a/src/adapters/peggedAssets/helper/chains.json b/src/adapters/peggedAssets/helper/chains.json index a5195ccf..bb187db7 100644 --- a/src/adapters/peggedAssets/helper/chains.json +++ b/src/adapters/peggedAssets/helper/chains.json @@ -136,5 +136,6 @@ "mantle", "agoric", "emoney", - "concordium" + "concordium", + "pulse" ] diff --git a/src/adapters/peggedAssets/index.ts b/src/adapters/peggedAssets/index.ts index d4a91a44..0063b9ce 100644 --- a/src/adapters/peggedAssets/index.ts +++ b/src/adapters/peggedAssets/index.ts @@ -149,6 +149,7 @@ import myusd from "./myusd"; import usds from "./sable-coin"; import scb from "./colb-usd-stablecolb"; import zkusd from "./zkusd"; +import usdl from "./liquid-loans-usdl"; export default { tether, @@ -301,5 +302,6 @@ export default { myusd, //fake coingecko, replace once live "sable-coin": usds, "colb-usd-stablecolb": scb, - "goal3": zkusd + "goal3": zkusd, + "liquid-loans-usdl": usdl }; diff --git a/src/adapters/peggedAssets/liquid-loans-usdl/index.ts b/src/adapters/peggedAssets/liquid-loans-usdl/index.ts new file mode 100644 index 00000000..08efdad6 --- /dev/null +++ b/src/adapters/peggedAssets/liquid-loans-usdl/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 = { + pulse: { + issued: ["0x0deed1486bc52aa0d3e6f8849cec5add6598a162"], + }, +}; + +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 = { + pulse: { + minted: chainMinted("pulse", 18), + unreleased: async () => ({}), + }, +}; + +export default adapter; \ No newline at end of file diff --git a/src/peggedData/peggedData.ts b/src/peggedData/peggedData.ts index 1060da39..338da1ec 100644 --- a/src/peggedData/peggedData.ts +++ b/src/peggedData/peggedData.ts @@ -3042,4 +3042,24 @@ export default [ twitter: "https://twitter.com/Goal3_xyz", wiki: "https://docs.goal3.xyz/sportsbook/technical-overview/usdzkusd", }, + { + id: "152", + name: "Liquid Loans USDL", + address: "pulse:0x0deed1486bc52aa0d3e6f8849cec5add6598a162", + symbol: "USDL", + url: "https://www.liquidloans.io/", + description: + "USDL is a stablecoin with 110% collateralization, no repayment schedule, immutability, and no governance or admin keys", + mintRedeemDescription: + "USDL is minted when users deposit PLS (PulseChain coin) as collateral that has been locked into individual smart contracts called Vaults.", + onCoinGecko: "true", + gecko_id: "liquid-loans-usdl", + cmcId: null, + pegType: "peggedUSD", + pegMechanism: "crypto-backed", + priceSource: "coingecko", + auditLinks: null, + twitter: "https://twitter.com/liquidloansio", + wiki: null, + }, ] as PeggedAsset[];