Skip to content

Commit

Permalink
orders shuffling
Browse files Browse the repository at this point in the history
  • Loading branch information
rouzwelt committed Sep 16, 2023
1 parent 0cdfd8b commit e9d34ab
Show file tree
Hide file tree
Showing 17 changed files with 212 additions and 143 deletions.
10 changes: 1 addition & 9 deletions arb-bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ const arbRound = async options => {
{
orderHash : options.orderHash,
orderOwner : options.orderOwner,
orderInterpreter: options.orderInterpreter,
shuffle : options.shuffle
orderInterpreter: options.orderInterpreter
}
);
await clear(
Expand All @@ -148,7 +147,6 @@ const main = async argv => {
const rpcs = [...options.rpc];
let roundGap = 10000;
let rpcTurn = 0;
let shuffle = 0;

if (options.repetitions) {
if (/^\d+$/.test(options.repetitions)) repetitions = Number(options.repetitions);
Expand All @@ -169,7 +167,6 @@ const main = async argv => {
// eslint-disable-next-line no-constant-condition
if (repetitions === -1) while (true) {
options.rpc = rpcs[rpcTurn];
options.shuffle = shuffle;
try {
await arbRound(options);
console.log("\x1b[32m%s\x1b[0m", "Round finished successfully!");
Expand All @@ -181,13 +178,10 @@ const main = async argv => {
}
if (rpcTurn === rpcs.length - 1) rpcTurn = 0;
else rpcTurn++;
if (shuffle === 3) shuffle = 0;
else shuffle++;
await sleep(roundGap);
}
else for (let i = 1; i <= repetitions; i++) {
options.rpc = rpcs[rpcTurn];
options.shuffle = shuffle;
try {
await arbRound(options);
console.log("\x1b[32m%s\x1b[0m", `Round ${i} finished successfully!`);
Expand All @@ -201,8 +195,6 @@ const main = async argv => {
}
if (rpcTurn === rpcs.length - 1) rpcTurn = 0;
else rpcTurn++;
if (shuffle === 3) shuffle = 0;
else shuffle++;
await sleep(roundGap);
}
};
Expand Down
4 changes: 2 additions & 2 deletions docs/html/curve.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ <h1 class="page-title">Source: curve.js</h1>
console.log(
"------------------------- Bundling Orders -------------------------", "\n"
);
bundledOrders = await bundleTakeOrders(ordersDetails, orderbook, arb);
bundledOrders = await bundleTakeOrders(ordersDetails, orderbook, arb, undefined, config.rpc !== "test");
const availableSwaps = getAvailableSwaps(config);
bundledOrders = prepare(
bundledOrders,
Expand Down Expand Up @@ -673,7 +673,7 @@ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.htm
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Sat Sep 16 2023 00:48:16 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Sat Sep 16 2023 15:09:46 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
Loading

0 comments on commit e9d34ab

Please sign in to comment.