Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(token-lists): Automated Top100 token list generation #134

Merged
merged 3 commits into from
Jun 11, 2021
Merged

feat(token-lists): Automated Top100 token list generation #134

merged 3 commits into from
Jun 11, 2021

Conversation

ChefKai
Copy link
Contributor

@ChefKai ChefKai commented Jun 3, 2021

Automate the generation of pancakeswap-top-100 token list.

@ChefKai ChefKai changed the title feat(token-lists): Automated Top100 token list feat(token-lists): Automated Top100 token list generation Jun 3, 2021
packages/token-lists/src/top-100.ts Outdated Show resolved Hide resolved
packages/token-lists/package.json Outdated Show resolved Hide resolved
}

// Default token list for exchange + manual exclusion of broken BEP-20 token(s)
const blacklist: string[] = [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple 'blacklist' to remove default tokens already included in PancakeSwap exchange default list; plus broken/unverified BEP-20 tokens.

const getDateRange = (): string[] => {
const today = new Date();
const todayISO = today.toISOString();
today.setMonth(today.getMonth() - 1);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this works even when the month is January.

*
* @returns string[]
*/
const getDateRange = (): string[] => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the simpler/only way to do this without requiring an external library.

}
`,
{
from: monthAgo,
Copy link
Contributor Author

@ChefKai ChefKai Jun 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now() - 1 month
Specified as 1 month, and not 30 days, for specific months like February, ...

name: item.baseCurrency.name,
symbol: item.baseCurrency.symbol.toUpperCase(),
address: checksummedAddress,
chainId: 56,
Copy link
Contributor Author

@ChefKai ChefKai Jun 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default to chainId: 56; as PancakeSwap v2 isn't on the testnet (yet) + no data is indexed on Chapel.

@ChefKai ChefKai marked this pull request as ready for review June 7, 2021 19:22
@ChefKai ChefKai requested review from Chef-Cheems and ChefHutch June 7, 2021 20:04
Copy link
Contributor

@Chef-Cheems Chef-Cheems left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Discussion about bad tokens in slack.

Comment on lines 5 to 6
const command = process.argv[2];
const listName = process.argv[3];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My personal style but I prefer doing this. No need to change.

const [,, command, listName] = process.argv

packages/token-lists/src/top-100.ts Show resolved Hide resolved
@Chef-Chungus Chef-Chungus merged commit c7e69a5 into pancakeswap:master Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants