Skip to content

Commit

Permalink
chore: disallow bot to buy tokens if already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
JayArrowz committed Sep 22, 2021
1 parent b63009b commit e3732ea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Handlers/TradeHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public async Task<bool> Buy(string tokenAddress, int tokenIdx, string pairAddres
{
try
{
if (_ownedTokenList.Any(t => t.Address == tokenAddress)) {

Log.Logger.Information("[CANNOT BUY] Token: {0} Cause: {1}", tokenAddress, "Already has token");
return false;
}
if (_sniperConfig.BuyDelaySeconds > 0)
{
await Task.Delay(TimeSpan.FromSeconds(_sniperConfig.BuyDelaySeconds));
Expand Down

0 comments on commit e3732ea

Please sign in to comment.