Skip to content

Commit f7230e2

Browse files
authored
feat: update tvl and borrow (DefiLlama#11473)
1 parent 648968a commit f7230e2

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

projects/daolama/borrowed.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
const sdk = require("@defillama/sdk");
2-
const { transformBalances } = require("../helper/portedTokens");
3-
const { get } = require('../helper/http');
1+
const sdk = require('@defillama/sdk');
2+
const { transformBalances } = require('../helper/portedTokens');
43
const ADDRESSES = require('../helper/coreAssets.json');
5-
const { BASE_API_URL } = require("./constants");
6-
const nullAddress = ADDRESSES.null;
4+
const { call } = require('../helper/chain/ton');
5+
const { POOL_ADDRESS } = require('./constants');
76

87
async function borrowed(api) {
98
const balances = {};
10-
const result = await get(`${BASE_API_URL}/api/v1/analytics/borrowed`);
11-
sdk.util.sumSingleBalance(balances, nullAddress, result.value, api.chain);
9+
const result = await call({
10+
target: POOL_ADDRESS,
11+
abi: 'get_pool_data',
12+
});
13+
const borrowedTon = result[2];
14+
sdk.util.sumSingleBalance(balances, ADDRESSES.ton.TON, borrowedTon, api.chain);
1215
return transformBalances(api.chain, balances);
1316
}
1417

projects/daolama/constants.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
module.exports = {
2-
BASE_API_URL: 'https://api.daolama.co',
3-
POOL_WALLET_ADDRESS: 'EQAwsDboFl_iGuaflNn5959HOamenkvQEQDwakO55CY2SGB8',
42
POOL_ADDRESS: 'EQCkeTvOSTBwBtP06X2BX7THj_dlX67PhgYRGuKfjWtB9FVb'
53
}

projects/daolama/tvl.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
const ADDRESSES = require("../helper/coreAssets.json");
2-
const { POOL_ADDRESS, POOL_WALLET_ADDRESS } = require("./constants");
3-
const { sumTokensExport } = require("../helper/chain/ton");
1+
const ADDRESSES = require('../helper/coreAssets.json');
2+
const { POOL_ADDRESS } = require('./constants');
3+
const { sumTokensExport } = require('../helper/chain/ton');
44

55
module.exports = {
66
tvl: sumTokensExport({
7-
owners: [POOL_ADDRESS, POOL_WALLET_ADDRESS],
7+
owners: [POOL_ADDRESS],
88
tokens: [ADDRESSES.ton.TON, ADDRESSES.ton.USDT]
99
}),
1010
}

0 commit comments

Comments
 (0)