xbidi / pancakeswapbot Goto Github PK
View Code? Open in Web Editor NEWPancakeSwap prediction bot
License: MIT License
PancakeSwap prediction bot
License: MIT License
How do you find the current epoch number for initialEpoch? Thanks.
I'm not sure how it suppose to work but I'll explain my situation.
It wins one round, then it waits one.
When the next round starts, it shows this in the console.
Claimable epochs empty: []
Tx Success
But it doesn't claim it for some reason.
If I check the pancakeswap interface, the reward is still there, waiting to be claimed.
Could you please explain to me why is that happening?
Thank you!
DONT USE
root@Ubuntu-2004-focal-64-minimal ~/PancakeSwapBot # npm start
[email protected] start
ts-node src/bot.ts
Bot started at 9:05
/root/PancakeSwapBot/node_modules/@ethersproject/logger/src.ts/index.ts:225
const error: any = new Error(message);
^
Error: call revert exception (method="currentEpoch()", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.5.0)
at Logger.makeError (/root/PancakeSwapBot/node_modules/@ethersproject/logger/src.ts/index.ts:225:28)
at Logger.throwError (/root/PancakeSwapBot/node_modules/@ethersproject/logger/src.ts/index.ts:237:20)
at Interface.decodeFunctionResult (/root/PancakeSwapBot/node_modules/@ethersproject/abi/src.ts/interface.ts:425:23)
at Contract. (/root/PancakeSwapBot/node_modules/@ethersproject/contracts/src.ts/index.ts:392:44)
at step (/root/PancakeSwapBot/node_modules/@ethersproject/contracts/lib/index.js:48:23)
at Object.next (/root/PancakeSwapBot/node_modules/@ethersproject/contracts/lib/index.js:29:53)
at fulfilled (/root/PancakeSwapBot/node_modules/@ethersproject/contracts/lib/index.js:20:58)
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
reason: null,
code: 'CALL_EXCEPTION',
method: 'currentEpoch()',
errorArgs: null,
errorName: null,
errorSignature: null,
address: '0x6e17072D6B2524aBB63134c632144F59Ca0aebbF',
args: [],
transaction: {
data: '0x76671808',
to: '0x6e17072D6B2524aBB63134c632144F59Ca0aebbF',
from: '0x6e17072D6B2524aBB63134c632144F59Ca0aebbF'
}
}
Started epoch 57619, waiting
Waiting time ended
Bet selected: bear
The round 57618 is not ended, cant bet without knowing the last result
C:\Users\PancakeSwapBot\node_modules@ethersproject\logger\src.ts\index.ts:225
const error: any = new Error(message);
^
Error: missing revert data in call exception (error={"reason":"missing response","code":"SERVER_ERROR","requestBody":"{"method":"eth_call","params":[{"from":"0xde9bf5fd7e9fb1f6277f5c9d2b0e1ecb48e01af5","to":"0x18b2a687610328590bc8f2e5fedde3b582a49cda","data":"0x76671808"},"latest"],"id":120,"jsonrpc":"2.0"}","requestMethod":"POST","serverError":{"code":"ECONNRESET","path":null,"host":"bsc-dataseed.binance.org","port":443},"url":"https://bsc-dataseed.binance.org/"}, data="0x", code=CALL_EXCEPTION, version=providers/5.5.0)
at Logger.makeError (C:\Users\PancakeSwapBot\node_modules@ethersproject\logger\src.ts\index.ts:225:28)
at Logger.throwError (C:\Users\PancakeSwapBot\node_modules@ethersproject\logger\src.ts\index.ts:237:20)
at checkError (C:\Users\PancakeSwapBot\node_modules@ethersproject\providers\src.ts\json-rpc-provider.ts:34:16)
at JsonRpcProvider. (C:\Users\PancakeSwapBot\node_modules@ethersproject\providers\src.ts\json-rpc-provider.ts:562:20)
at step (C:\Users\PancakeSwapBot\node_modules@ethersproject\providers\lib\json-rpc-provider.js:48:23)
at Object.throw (C:\Users\PancakeSwapBot\node_modules@ethersproject\providers\lib\json-rpc-provider.js:29:53)
at rejected (C:\Users\PancakeSwapBot\node_modules@ethersproject\providers\lib\json-rpc-provider.js:21:65)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
reason: 'missing revert data in call exception',
code: 'CALL_EXCEPTION',
error: Error: missing response (requestBody="{"method":"eth_call","params":[{"from":"0xde9bf5fd7e9fb1f6277f5c9d2b0e1ecb48e01af5","to":"0x18b2a687610328590bc8f2e5fedde3b582a49cda","data":"0x76671808"},"latest"],"id":120,"jsonrpc":"2.0"}", requestMethod="POST", serverError={"code":"ECONNRESET","path":null,"host":"bsc-dataseed.binance.org","port":443}, url="https://bsc-dataseed.binance.org/", code=SERVER_ERROR, version=web/5.5.0)
at Logger.makeError (C:\Users\PancakeSwapBot\node_modules@ethersproject\logger\src.ts\index.ts:225:28)
at Logger.throwError (C:\Users\PancakeSwapBot\node_modules@ethersproject\logger\src.ts\index.ts:237:20)
at C:\Users\PancakeSwapBot\node_modules@ethersproject\web\src.ts\index.ts:234:28
at step (C:\Users\PancakeSwapBot\node_modules@ethersproject\web\lib\index.js:33:23)
at Object.throw (C:\Users\PancakeSwapBot\node_modules@ethersproject\web\lib\index.js:14:53)
at rejected (C:\Users\PancakeSwapBot\node_modules@ethersproject\web\lib\index.js:6:65)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
reason: 'missing response',
code: 'SERVER_ERROR',
requestBody: '{"method":"eth_call","params":[{"from":"0xde9bf5fd7e9fb1f6277f5c9d2b0e1ecb48e01af5","to":"0x18b2a687610328590bc8f2e5fedde3b582a49cda","data":"0x76671808"},"latest"],"id":120,"jsonrpc":"2.0"}',
requestMethod: 'POST',
serverError: Error: Client network socket disconnected before secure TLS connection was established
at connResetException (node:internal/errors:692:14)
at TLSSocket.onConnectEnd (node:_tls_wrap:1587:19)
at TLSSocket.emit (node:events:539:35)
at TLSSocket.emit (node:domain:475:12)
at endReadableNT (node:internal/streams/readable:1345:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
code: 'ECONNRESET',
path: null,
host: 'bsc-dataseed.binance.org',
port: 443,
localAddress: undefined
},
url: 'https://bsc-dataseed.binance.org/'
},
data: '0x'
}
Your strategy is very simple and you should state it outright. It bets on the higher payout at the time the bet is made. Your backtest is also inaccurate since it uses the final payout as the bet, but this is not known the time the bet is made.
You should make the strategy explicit in the README as it's simple to understand.
const bet = roundBullAmount < roundBearAmount ? 'bull' : 'bear';
https://github.com/xBidi/PancakeSwapBot/blob/main/src/bot.ts#L73
Hi there, sometimes I get the error below and it resets the whole bot, if you have 2-3 consecutive lost bets it will reset it back to the start, you'll be losing money.
Why would that happen?
Thank you!
1|ts-node | Tx Started
1|ts-node | Tx Error, calling reduceWaitingTimeByOneBlocks(waitingTime) Error: transaction failed (transactionHash="0xf6867c02184e5da80bfce0b63a99ec76d8bf51cab77a996ac42377ff7cf23e54", transaction={"nonce":1435,"gasPrice":{"type":"BigNumber","hex":"0x012a05f200"},"gasLimit":{"type":"BigNumber","hex":"0x01cd17"},"to":"0x18B2A687610328590Bc8F2e5fEdDe3b582A49cdA","value":{"type":"BigNumber","hex":"0x011c37937e080000"},"data":"0xaa6b873a0000000000000000000000000000000000000000000000000000000000007539","chainId":56,"v":148,"r":"0x13b9040f2407bab5df6b64562907774597b77ee38095e648b589a5a0481cf24d","s":"0x362069f6ec2834f1b2abcb2d2f55db7b0e1b4c817e8963c8185a01f901ccded8","from":"0xbA85c23C2C1A1aABDd86D0AAAA544C933FFeDa35","hash":"0xf6867c02184e5da80bfce0b63a99ec76d8bf51cab77a996ac42377ff7cf23e54","type":null,"confirmations":0}, receipt={"to":"0x18B2A687610328590Bc8F2e5fEdDe3b582A49cdA","from":"0xbA85c23C2C1A1aABDd86D0AAAA544C933FFeDa35","contractAddress":null,"transactionIndex":194,"gasUsed":{"type":"BigNumber","hex":"0x7475"},"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","blockHash":"0x02b12189416b117c8dc865e4d7913f9d973ee6bdb2b342ee23641e8736fe6ec5","transactionHash":"0xf6867c02184e5da80bfce0b63a99ec76d8bf51cab77a996ac42377ff7cf23e54","logs":[],"blockNumber":13700008,"confirmations":1,"cumulativeGasUsed":{"type":"BigNumber","hex":"0x01cf6ca3"},"status":0,"type":0,"byzantium":true}, code=CALL_EXCEPTION, version=providers/5.5.0)
1|ts-node | at Logger.makeError (/root/PSP/PancakeSwapBot/node_modules/@ethersproject/logger/src.ts/index.ts:225:28)
1|ts-node | at Logger.throwError (/root/PSP/PancakeSwapBot/node_modules/@ethersproject/logger/src.ts/index.ts:237:20)
1|ts-node | at JsonRpcProvider.<anonymous> (/root/PSP/PancakeSwapBot/node_modules/@ethersproject/providers/src.ts/base-provider.ts:1314:24)
1|ts-node | at step (/root/PSP/PancakeSwapBot/node_modules/@ethersproject/providers/lib/base-provider.js:48:23)
1|ts-node | at Object.next (/root/PSP/PancakeSwapBot/node_modules/@ethersproject/providers/lib/base-provider.js:29:53)
1|ts-node | at fulfilled (/root/PSP/PancakeSwapBot/node_modules/@ethersproject/providers/lib/base-provider.js:20:58) {
1|ts-node | reason: 'transaction failed',
1|ts-node | code: 'CALL_EXCEPTION',
1|ts-node | transactionHash: '0xf6867c02184e5da80bfce0b63a99ec76d8bf51cab77a996ac42377ff7cf23e54',
1|ts-node | transaction: {
1|ts-node | nonce: 1435,
1|ts-node | gasPrice: BigNumber { _hex: '0x012a05f200', _isBigNumber: true },
1|ts-node | gasLimit: BigNumber { _hex: '0x01cd17', _isBigNumber: true },
1|ts-node | to: '0x18B2A687610328590Bc8F2e5fEdDe3b582A49cdA',
1|ts-node | value: BigNumber { _hex: '0x011c37937e080000', _isBigNumber: true },
1|ts-node | data: '0xaa6b873a0000000000000000000000000000000000000000000000000000000000007539',
1|ts-node | chainId: 56,
1|ts-node | v: 148,
1|ts-node | r: '0x13b9040f2407bab5df6b64562907774597b77ee38095e648b589a5a0481cf24d',
1|ts-node | s: '0x362069f6ec2834f1b2abcb2d2f55db7b0e1b4c817e8963c8185a01f901ccded8',
1|ts-node | from: '0xbA85c23C2C1A1aABDd86D0AAAA544C933FFeDa35',
1|ts-node | hash: '0xf6867c02184e5da80bfce0b63a99ec76d8bf51cab77a996ac42377ff7cf23e54',
1|ts-node | type: null,
1|ts-node | confirmations: 0,
1|ts-node | wait: [Function (anonymous)]
1|ts-node | },
1|ts-node | receipt: {
1|ts-node | to: '0x18B2A687610328590Bc8F2e5fEdDe3b582A49cdA',
1|ts-node | from: '0xbA85c23C2C1A1aABDd86D0AAAA544C933FFeDa35',
1|ts-node | contractAddress: null,
1|ts-node | transactionIndex: 194,
1|ts-node | gasUsed: BigNumber { _hex: '0x7475', _isBigNumber: true },
1|ts-node | logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
1|ts-node | blockHash: '0x02b12189416b117c8dc865e4d7913f9d973ee6bdb2b342ee23641e8736fe6ec5',
1|ts-node | transactionHash: '0xf6867c02184e5da80bfce0b63a99ec76d8bf51cab77a996ac42377ff7cf23e54',
1|ts-node | logs: [],
1|ts-node | blockNumber: 13700008,
1|ts-node | confirmations: 1,
1|ts-node | cumulativeGasUsed: BigNumber { _hex: '0x01cf6ca3', _isBigNumber: true },
1|ts-node | status: 0,
1|ts-node | type: 0,
1|ts-node | byzantium: true
1|ts-node | }
1|ts-node | }
Hi there, thank you very much for this bot. I have been having lots of fun with it. However, sometimes it would get stuck with 'cannot estimate gas; transaction may fail or may require manual gas limit'.
Sometimes this happens in a timem where the bot is recovering from loss, and then it need to start from the beginning bet gain. Is there a way to resolve this?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.