Skip to content

Commit

Permalink
feat: revert of the revert of feat: generate assets for all portals n…
Browse files Browse the repository at this point in the history
…etworks (#7412) (#7426)

* revert: revert: feat: generate assets for all portals networks (#7412) (#7425)

This reverts commit d73dea2.

* feat: minLiquidity and minApy heuristics

* feat: regen

---------

Co-authored-by: gomes <[email protected]>
  • Loading branch information
0xApotheosis and gomesalexandre authored Jul 28, 2024
1 parent 703478a commit 1e991eb
Show file tree
Hide file tree
Showing 6 changed files with 109,780 additions and 231,747 deletions.
5 changes: 2 additions & 3 deletions scripts/generateAssetData/bnbsmartchain/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ import uniqBy from 'lodash/uniqBy'

import { bnbsmartchain } from '../baseAssets'
import * as coingecko from '../coingecko'
// import { getPortalTokens } from '../utils/portals'
import { getPortalTokens } from '../utils/portals'

export const getAssets = async (): Promise<Asset[]> => {
const results = await Promise.allSettled([
coingecko.getAssets(bscChainId),
// TODO(gomes): revert me back, there are 10k+ assets for BSC = problems
[], // getPortalTokens(bnbsmartchain),
getPortalTokens(bnbsmartchain),
])

const [assets, portalsAssets] = results.map(result => {
Expand Down
5 changes: 2 additions & 3 deletions scripts/generateAssetData/ethereum/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import uniqBy from 'lodash/uniqBy'
import { ethereum } from '../baseAssets'
import * as coingecko from '../coingecko'
import { generateTrustWalletUrl } from '../generateTrustWalletUrl/generateTrustWalletUrl'
// import { getPortalTokens } from '../utils/portals'
import { getPortalTokens } from '../utils/portals'
import { getIdleTokens } from './idleVaults'
import { getUniswapV2Pools } from './uniswapV2Pools'
// Yearn SDK is currently rugged upstream
Expand Down Expand Up @@ -40,8 +40,7 @@ export const getAssets = async (): Promise<Asset[]> => {
// getUnderlyingVaultTokens(),
getUniswapV2Pools(),
getIdleTokens(),
// TODO(gomes): revert me back, there are 10k+ assets for Ethereum = problems
[], // getPortalTokens(ethereum),
getPortalTokens(ethereum),
])

const [ethTokens, uniV2PoolTokens, idleTokens, portalsAssets] = results.map(result => {
Expand Down
6 changes: 5 additions & 1 deletion scripts/generateAssetData/utils/portals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ export const fetchPortalsTokens = async (

const params = {
limit: '250',
// Minimum 1000 bucks liquidity if asset is a LP token
minLiquidity: '1000',
// Minimum 1% APY if asset is a LP token
minApy: '1',
networks: [network],
page: page.toString(),
}
Expand Down Expand Up @@ -132,7 +136,7 @@ export const getPortalTokens = async (nativeAsset: Asset): Promise<Asset[]> => {
...explorerData,
color: colorMap[assetId] ?? '#FFFFFF',
icon: token.images?.[0],
icons: token.images,
...(token.images?.length && { icons: token.images }),
name: token.name,
precision: Number(token.decimals),
symbol: token.symbol,
Expand Down
Loading

0 comments on commit 1e991eb

Please sign in to comment.