Skip to content

Commit 63a9293

Browse files
authored
Divide Pryzm Protocol into Liquid Staking and Yield Protocols (DefiLlama#12927)
2 parents 8c7da58 + 6ae98c0 commit 63a9293

File tree

2 files changed

+36
-27
lines changed

2 files changed

+36
-27
lines changed

projects/pryzm/index.js renamed to projects/pryzm-liquid-staking/index.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ const host_chains = {
3434
};
3535

3636
const endpoint = endPoints["pryzm"]
37-
const amm_vault_address = "pryzm1y7d08j5uy7kgurnv4pwag8h34m2cgptcwe75wn";
3837

3938
function tvlOnChain(chain) {
4039
return async (api) => {
@@ -49,32 +48,6 @@ function tvlOnChain(chain) {
4948
};
5049
}
5150

52-
async function tvl(api) {
53-
const { balances: data } =
54-
await get(`${endpoint}/cosmos/bank/v1beta1/balances/${amm_vault_address}?pagination.limit=1000`);
55-
56-
for (const { denom, amount } of data) {
57-
if (denom.startsWith("c:") ||
58-
denom.startsWith("p:") ||
59-
denom.startsWith("y:") ||
60-
denom.startsWith("lp:")
61-
) {
62-
continue
63-
}
64-
if (denom === 'ibc/B8AF5D92165F35AB31F3FC7C7B444B9D240760FA5D406C49D24862BD0284E395')
65-
api.addCGToken('terra-luna-2', amount/1e6)
66-
else
67-
api.add(denom, amount);
68-
}
69-
}
70-
71-
module.exports = {
72-
methodology: "Counts the liquidity on liquid staking module and all AMM pools",
73-
pryzm: {
74-
tvl
75-
},
76-
};
77-
7851
for (const chainName of Object.keys(host_chains)) {
7952
module.exports[chainName] = { tvl: tvlOnChain(host_chains[chainName]) };
8053
}

projects/pryzm-protocol/index.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
const { get } = require('../helper/http')
2+
const { endPoints, } = require('../helper/chain/cosmos');
3+
const { concat } = require("ethers");
4+
5+
const endpoint = endPoints["pryzm"]
6+
const amm_vault_address = "pryzm1y7d08j5uy7kgurnv4pwag8h34m2cgptcwe75wn";
7+
const refractor_vault_address = "pryzm1xtnrr4e6553hap0zuveautjstc3w2sxmf2zph3";
8+
9+
async function tvl(api) {
10+
const [{ balances: amm_balances }, { balances: refractor_balances }] =
11+
await Promise.all([
12+
await get(`${endpoint}/cosmos/bank/v1beta1/balances/${amm_vault_address}?pagination.limit=1000`),
13+
await get(`${endpoint}/cosmos/bank/v1beta1/balances/${refractor_vault_address}?pagination.limit=1000`)
14+
]);
15+
16+
let all_balances = amm_balances.concat(refractor_balances);
17+
for (const { denom, amount } of all_balances) {
18+
if (denom.startsWith("p:") ||
19+
denom.startsWith("y:") ||
20+
denom.startsWith("lp:")
21+
) {
22+
continue
23+
}
24+
if (denom === 'ibc/B8AF5D92165F35AB31F3FC7C7B444B9D240760FA5D406C49D24862BD0284E395')
25+
api.addCGToken('terra-luna-2', amount/1e6)
26+
else
27+
api.add(denom, amount);
28+
}
29+
}
30+
31+
module.exports = {
32+
methodology: "Counts the liquidity on the refractor module and all AMM pools",
33+
pryzm: {
34+
tvl
35+
},
36+
};

0 commit comments

Comments
 (0)