From 032500c16a56008bb6f2953547537aa0805dc398 Mon Sep 17 00:00:00 2001 From: amadiaflare Date: Tue, 9 Dec 2025 14:11:49 -0500 Subject: [PATCH] add: kinetic fxrp --- projects/kinetic-fxrp/index.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 projects/kinetic-fxrp/index.js diff --git a/projects/kinetic-fxrp/index.js b/projects/kinetic-fxrp/index.js new file mode 100644 index 00000000000..09aff4b6b0b --- /dev/null +++ b/projects/kinetic-fxrp/index.js @@ -0,0 +1,27 @@ +const { ChainApi } = require('@defillama/sdk'); +const ADDRESSES = require('../helper/coreAssets.json'); + +const FXRP = '0xAd552A648C74D49E10027AB8a618A3ad4901c5bE'; +const KINETIC_ISO_FXRP = '0x870f7B89F0d408D7CA2E6586Df26D00Ea03aA358'; + +async function lockedXRPL(api) { + const flareApi = new ChainApi({ chain: 'flare', timestamp: api.timestamp }); + await flareApi.getBlock(); + + // Kinetic: getCash() + totalBorrows() = total FXRP supplied + const [kineticCash, kineticBorrows] = await Promise.all([ + flareApi.call({ abi: 'uint256:getCash', target: KINETIC_ISO_FXRP }), + flareApi.call({ abi: 'uint256:totalBorrows', target: KINETIC_ISO_FXRP }), + ]); + + const totalFxrp = BigInt(kineticCash) + BigInt(kineticBorrows); + api.add(ADDRESSES.ripple.XRP, totalFxrp.toString()); + return api.getBalances(); +} + +module.exports = { + ripple: { + tvl: lockedXRPL, + }, + methodology: "Counts total FXRP supplied to Kinetic lending protocol on Flare. FXRP is 1:1 backed by XRP.", +};