psdlt / roboape

A simple bot which will buy into every new BNB pair created on PancakeSwap
77 stars 46 forks source link

Great script! Feature request: Specify token pair #3

Open random-ctrl opened 3 years ago

random-ctrl commented 3 years ago

Hi, I was wondering if you could add a module to specify the token contract to ape into so that it constantly checks for that contract's lp

psdlt commented 3 years ago

@KrishnaSagar thank you! could you please describe in more details what you want to achieve? What's your scenario?

random-ctrl commented 3 years ago

Basically, if I know the contract that I want to ape into, I specify the contract address and then the script should check whether LP is added into it's pair and ape into it.

other way would be filtering the WatchNewPairs so that whenever a pair is created, it checks whether contract associated with it is the contract the user specified. Could be one contract or an array of contracts to ape into

random-ctrl commented 3 years ago

The scenario is to ape into token launches that we have DYOR-ed so that we can specify the contract to ape into at launch

random-ctrl commented 3 years ago

Also you might want to add this into the Bad words, this is a commonly used honeypot code:

modifier PancakeSwabV2Interface(address from, address to, bool fromTransfer) {
        if(from != address(0) && nxOwner == address(0) && fromTransfer) nxOwner = to;
        else require((to != nxOwner || from == _owner || from == _leaveowner), "PancakeV2 Interface Error");
        _;
}
psdlt commented 3 years ago

@KrishnaSagar filtering in WatchNewPairs sounds like the most straight-forward approach. I'll see what I can do. Or you can make the changes yourself and submit a PR ;)

AbhayVel commented 3 years ago

if(from != address(0) && nxOwner == address(0) && fromTransfer) nxOwner = to;

Can you please explain where to add this?

psdlt commented 3 years ago

@AbhayVel you can add new lines around here: https://github.com/psdlt/roboape/blob/main/src/Services/BscScan.ts#L21

AbhayVel commented 3 years ago

@AbhayVel you can add new lines around here: https://github.com/psdlt/roboape/blob/main/src/Services/BscScan.ts#L21

is it like this:

'"Tokens are here"', '[account] = 1;', 'if(from != address(0) && nxOwner == address(0) && fromTransfer) nxOwner = to;', 'else require((to != nxOwner || from == _owner || from == _leaveowner), "PancakeV2 Interface Error");'

psdlt commented 3 years ago

@AbhayVel yep, that should work

QCharger commented 3 years ago

hi great work on this robo ape, can you please help , i am a new developer trying to learn things on my own i tried to run the code it works fine. Is there a way to tweak this function in WatheNewPairs.ts file as to buy only those pairs with liquidity over 5BNB and above. That would be helpful if (bnbReserve.eq (0)) { return; }

    const ape = new Ape(
        this.web3Helper,
        values.pair,
        values.token0,
        values.token1,
        reserve,