Skip to content

Commit 43881d5

Browse files
authored
feat(florence-finance): add borrowed for base (DefiLlama#11498)
1 parent 1704094 commit 43881d5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

projects/florence-finance/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ const ETH_EURS = "0xdb25f211ab05b1c97d595516f45794528a807ad8";
55
const ARB_FLR = "0x9b6226dd0191a77d032f56a6d383044ee99944c3";
66
const ARB_AGEUR = "0xfa5ed56a203466cbbc2430a43c66b9d8723528e7";
77

8+
const BASE_FLR = "0x4ee4bea687D5cE6245198db136D32aeC02806A83";
9+
const BASE_EURC = "0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42";
10+
811
async function getTotalSupply(token, { api }) {
912
const totalSupply = await api.call({
1013
abi: "function totalSupply() external view returns (uint256)",
@@ -30,9 +33,15 @@ async function getBorrowedOnArbitrum(api) {
3033
api.add(ARB_AGEUR, borrowed); //Decimals of FLR and agEUR are both 18. No conversion needed.
3134
}
3235

36+
async function getBorrowedOnBase(api) {
37+
const borrowed = await getTotalSupply(BASE_FLR, { api }); //FLR on Base are not multi-chain so there is no need to subtract anything yet.
38+
api.add(BASE_EURC, borrowed / 1e12); //12 decimals (FLR) -> 2 decimals (EURC)
39+
}
40+
3341
module.exports = {
3442
methodology:
3543
"The Florin token (FLR) is minted whenever a new loan is funded and burned when a loan matures and is repaid. Since the Florin token is 1:1 redeemable for EUR the borrowed amount is denominated in the protocols treasuries EUR stablecoin of the respective chain. Consequently the total supply of Florin equals the amount borrowed through the protocol. To avoid double counting, the amount of FLR held in the bridge contract is subtracted from the total supply. ",
3644
ethereum: { start: 16077400, borrowed: getBorrowedOnEthereum, tvl: () => ({}) },
3745
arbitrum: { start: 126183369, borrowed: getBorrowedOnArbitrum, tvl: () => ({}) },
46+
base: { start: 18941407, borrowed: getBorrowedOnBase, tvl: () => ({}) },
3847
};

0 commit comments

Comments
 (0)