Skip to content

Commit

Permalink
Arca-labs (RCOIN) (#10907)
Browse files Browse the repository at this point in the history
* Arc-Labs protocol, RWA

* Adjust Supply

---------

Co-authored-by: 0xpeluche <[email protected]>
  • Loading branch information
0xpeluche and 0xpeluche authored Jul 6, 2024
1 parent 73d3e2c commit 6c30723
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions projects/arca-labs/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const ADDRESSES = require('../helper/coreAssets.json')

const RCOIN = "0x252739487c1fa66eaeae7ced41d6358ab2a6bca9"

module.exports = {
ethereum: {
tvl: async (api) => {
const [usdcDecimals, rcoinDecimals,totalSupply] = await Promise.all([
api.call({target: ADDRESSES.ethereum.USDC, abi:'erc20:decimals'}),
api.call({target: RCOIN, abi:'erc20:decimals'}),
api.call({target: RCOIN, abi:'erc20:totalSupply'})
])
// Adjusting the total supply of RCOIN to match the decimal places of USDC
// USDC has 6 decimals, whereas RCOIN has 8 decimals
const rcoinDecimalAdjustment = Math.pow(10, usdcDecimals) / Math.pow(10, rcoinDecimals);
const adjustedSupply = totalSupply * rcoinDecimalAdjustment

return api.add(ADDRESSES.ethereum.USDC, adjustedSupply)
}
}
}

0 comments on commit 6c30723

Please sign in to comment.