mirror of
https://github.com/alexgo-io/DefiLlama-Adapters.git
synced 2026-01-12 08:34:23 +08:00
25 lines
563 B
JavaScript
25 lines
563 B
JavaScript
const {get} = require("../helper/http")
|
|
|
|
async function getData(api) {
|
|
const isoTimestamp = new Date((api.timestamp - 5 * 60 * 60) * 1000).toISOString();
|
|
return await get('https://prodv1.securesecrets.org/defillama/moneymarket/' + isoTimestamp);
|
|
}
|
|
|
|
async function tvl(api) {
|
|
const data = await getData(api)
|
|
api.addUSDValue(data.collateralTvl + data.loanableTvl)
|
|
}
|
|
|
|
async function borrowed(api) {
|
|
const data = await getData(api)
|
|
api.addUSDValue(data.lentTvl)
|
|
}
|
|
|
|
module.exports = {
|
|
misrepresentedTokens: true,
|
|
secret: {
|
|
tvl,
|
|
borrowed,
|
|
}
|
|
}
|