Skip to content

Commit

Permalink
dojoswap: bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki committed Oct 18, 2024
1 parent b9be118 commit 3d58431
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions projects/helper/portedTokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ async function transformInjectiveAddress() {
addr = addr.replace(/\//g, ':')
if (addr.startsWith('peggy0x'))
return `ethereum:${addr.replace('peggy', '')}`
if (addr.startsWith('injective:') || addr.startsWith('ethereum:')) return addr
return `injective:${addr}`;
};
}
Expand Down
6 changes: 3 additions & 3 deletions projects/terraswap/factoryTvl.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ async function getAllPairs(factory, chain, { blacklistedPairs = [] } = {}) {
return dtos
}

const isNotXYK = (pair) => pair.pair_type && (pair.pair_type.xyk || pair.pair_type.custom === 'concentrated')
const isNotXYK = (pair) => pair.pair_type && pair.pair_type.custom === 'concentrated'

function getFactoryTvl(factory, { blacklistedPairs = [] } = {}) {
return async (api) => {
const pairs = (await getAllPairs(factory, api.chain, { blacklistedPairs })).filter(pair => (pair.assets[0].balance && pair.assets[1].balance))

const xykPairs = pairs.filter(isNotXYK)
const otherPairs = pairs.filter(pair => !isNotXYK(pair))
const otherPairs = pairs.filter(isNotXYK)
const xykPairs = pairs.filter(pair => !isNotXYK(pair))
otherPairs.forEach(({ assets }) => {
api.add(assets[0].addr, assets[0].balance)
api.add(assets[1].addr, assets[1].balance)
Expand Down

0 comments on commit 3d58431

Please sign in to comment.