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

The blacklist! #94

Open
owodunni opened this issue Dec 15, 2020 · 2 comments
Open

The blacklist! #94

owodunni opened this issue Dec 15, 2020 · 2 comments

Comments

@owodunni
Copy link
Owner

We need to be able to blacklist tokens. This can be done at two points.

  1. When finding the tokens
  2. When dpoing trades

When can use the Hardhat network to trade against a forked ethereum chain. On that chain we can detect any bad tokens and add them to the blacklist!

@owodunni
Copy link
Owner Author

Creat article regarding why tokens can be weird:
https://medium.com/hummingbot/the-myth-of-the-erc-20-token-standard-ab0d76cf8532

@owodunni
Copy link
Owner Author

Even though the #97 took away some of the main issues that required the implementation of the Blacklist it is still a valid feature.

Here is a log from executing a trade against a invlaid token:

2021-01-23 09:36:42,842 [MainThread  ] [INFO ]  Executing trade 
Trade(
    pools:[
Pool(
  Tokens: [Token(Name: NiceToken, Price: 0.364173587419268, Address: 0x53F64bE99Da00fec224EAf9f8ce2012149D2FC88), Token(Name: Wrapped Ether, Price: 1, Address: 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2)],
  Balances: [Balance(Token: NiceToken, Value: 30.019577880574428), Balance(Token: Wrapped Ether, Value: 9.12832906154464)],
  Weights: [Balance(Token: NiceToken, Value: 0.5), Balance(Token: Wrapped Ether, Value: 0.5)],
  Fee: 0.003
  Address: 0x6D5416567E09b99D7B4b7897129Edb19C2F1305A), 
Pool(
  Tokens: [Token(Name: NiceToken, Price: 0.364173587419268, Address: 0x53F64bE99Da00fec224EAf9f8ce2012149D2FC88), Token(Name: Tether USD, Price: 0.0008174873575946463, Address: 0xdAC17F958D2ee523a2206206994597C13D831ec7)],
  Balances: [Balance(Token: NiceToken, Value: 4.8879831779332665), Balance(Token: Tether USD, Value: 2260.513207)],
  Weights: [Balance(Token: NiceToken, Value: 0.5), Balance(Token: Tether USD, Value: 0.5)],
  Fee: 0.003
  Address: 0x2CC61dA33Bc68e541ED9e4BcE07AD3FD3d37ff60), 
Pool(
  Tokens: [Token(Name: RottenToken, Price: 2.601781834255753e-06, Address: 0xD04785C4d8195e4A54d9dEc3a9043872875ae9E2), Token(Name: Tether USD, Price: 0.0008174873575946463, Address: 0xdAC17F958D2ee523a2206206994597C13D831ec7)],
  Balances: [Balance(Token: RottenToken, Value: 690242.9748620626), Balance(Token: Tether USD, Value: 2207.706655)],
  Weights: [Balance(Token: RottenToken, Value: 0.5), Balance(Token: Tether USD, Value: 0.5)],
  Fee: 0.003
  Address: 0xE488C45ADEa8d83E25EbC548F711CeF799E5A24E), 
Pool(
  Tokens: [Token(Name: BloodyToken, Price: 5.125515127799606e-07, Address: 0x892F5A0B08BB7B1eeCCCC63EF3916fF201c93664), Token(Name: RottenToken, Price: 2.601781834255753e-06, Address: 0xD04785C4d8195e4A54d9dEc3a9043872875ae9E2)],
  Balances: [Balance(Token: BloodyToken, Value: 9476862.44238604), Balance(Token: RottenToken, Value: 1535591.0704434272)],
  Weights: [Balance(Token: BloodyToken, Value: 0.5), Balance(Token: RottenToken, Value: 0.5)],
  Fee: 0.003
  Address: 0x7d2C778A923648A7288e38554b9433BE8d51B57E), 
Pool(
  Tokens: [Token(Name: BloodyToken, Price: 5.125515127799606e-07, Address: 0x892F5A0B08BB7B1eeCCCC63EF3916fF201c93664), Token(Name: Wrapped Ether, Price: 1, Address: 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2)],
  Balances: [Balance(Token: BloodyToken, Value: 10628726.711341627), Balance(Token: Wrapped Ether, Value: 5.447769954822926)],
  Weights: [Balance(Token: BloodyToken, Value: 0.5), Balance(Token: Wrapped Ether, Value: 0.5)],
  Fee: 0.003
  Address: 0xc01E75AFbEdD5F9B9B8BCC619852D839B182cD38)],
    path:[Token(Name: Wrapped Ether, Price: 1, Address: 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2), Token(Name: NiceToken, Price: 0.364173587419268, Address: 0x53F64bE99Da00fec224EAf9f8ce2012149D2FC88), Token(Name: Tether USD, Price: 0.0008174873575946463, Address: 0xdAC17F958D2ee523a2206206994597C13D831ec7), Token(Name: RottenToken, Price: 2.601781834255753e-06, Address: 0xD04785C4d8195e4A54d9dEc3a9043872875ae9E2), Token(Name: BloodyToken, Price: 5.125515127799606e-07, Address: 0x892F5A0B08BB7B1eeCCCC63EF3916fF201c93664), Token(Name: Wrapped Ether, Price: 1, Address: 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2)],
    amount_in:0.106377372391389,
    profit:0.0231498027283421,
    balance:None,
    ratio:0.6648477650447155)
2021-01-23 09:36:42,940 [MainThread  ] [WARNI]  execution reverted: UniswapV2: K

Idealy this should add the failing token to the Blacklist.

Repository owner deleted a comment from tobarbaro Feb 10, 2024
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

No branches or pull requests

1 participant