Skip to content

Commit e0aa76a

Browse files
authored
Merge pull request #1837 from Liqwid-Labs/fix/drop-registry
fix(Liqwid adaptor): drop registry dependency
2 parents 6da53a4 + 69195b6 commit e0aa76a

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

src/adaptors/liqwid/index.js

+4-14
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const fetch = require('node-fetch');
33

44
const apy = async () => {
55
const endpoint = 'https://v2.api.liqwid.finance/graphql';
6-
const registryEndpoint = 'https://public.liqwid.finance/registry.json';
76

87
const query = gql`
98
query {
@@ -23,6 +22,9 @@ const apy = async () => {
2322
asset {
2423
price
2524
}
25+
registry {
26+
actionScriptHash
27+
}
2628
}
2729
}
2830
}
@@ -32,16 +34,6 @@ const apy = async () => {
3234

3335
const data = await request(endpoint, query);
3436

35-
//NOTE: Action validator will be added to the API in the near future
36-
const registryData = await fetch(registryEndpoint)
37-
.then((res) => res.json())
38-
.then((data) =>
39-
data.scriptInfos.filter(
40-
(script) =>
41-
script.type === 'Validator' && script.tag === 'liqwidMainnet'
42-
)
43-
);
44-
4537
// These are the markets that are either disabled or not borrowable, so no yield can be generated
4638
const disableMarkets = ['AGIX', 'WMT', 'POL', 'LQ'];
4739

@@ -51,9 +43,7 @@ const apy = async () => {
5143

5244
const getPool = (market) => {
5345
return {
54-
pool: registryData.find(
55-
(script) => script.name === `Liqwid${market.id}Action`
56-
)?.scriptHash,
46+
pool: market.registry.actionScriptHash,
5747
chain: 'Cardano',
5848
project: 'liqwid',
5949
symbol: market.id,

0 commit comments

Comments
 (0)