Skip to content

Commit

Permalink
add usdl coin
Browse files Browse the repository at this point in the history
  • Loading branch information
realdealshaman committed Jan 18, 2024
1 parent ee785ee commit 4be8f65
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/adapters/peggedAssets/helper/chains.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,6 @@
"mantle",
"agoric",
"emoney",
"concordium"
"concordium",
"pulse"
]
4 changes: 3 additions & 1 deletion src/adapters/peggedAssets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
};
56 changes: 56 additions & 0 deletions src/adapters/peggedAssets/liquid-loans-usdl/index.ts
Original file line number Diff line number Diff line change
@@ -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;
20 changes: 20 additions & 0 deletions src/peggedData/peggedData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];

0 comments on commit 4be8f65

Please sign in to comment.