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

Transaction Fail #4

Closed
digitalftl opened this issue Dec 22, 2021 · 1 comment
Closed

Transaction Fail #4

digitalftl opened this issue Dec 22, 2021 · 1 comment

Comments

@digitalftl
Copy link

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  | }

@diego-tobalina
Copy link
Owner

Hi, the transaction fail usually happens when the transacion needs more time and the epoch is closed. The bot calls the function reduce time to place the next bet a few seconds earlier

the bot that you mentioned. This is the strategy

const precalculation =
(bullAmount.gt(bearAmount) && bullAmount.div(bearAmount).lt(5)) ||
(bullAmount.lt(bearAmount) && bearAmount.div(bullAmount).gt(5));

if (strategy === STRATEGIES.Standard) {
return precalculation;
}

do the backtesting, is not viable and will lose over time

Is not the bot owner, is a fork from another one that now is a chrome extension ;)

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