Trading Back-End on Solana #152936
-
Select Topic AreaQuestion BodyNow I am developing Perpetual contract trading back-end. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
hello, please look at this: // Function to simulate a task with some execution time // Simulate tasks for each circle from 0 to 1000 console.log(tasks); Promise.all(tasks) if you run this, code, several task is finished at once. This is main thing in trading back-end. Thank you |
Beta Was this translation helpful? Give feedback.
-
I think touchsk000's opinion is right. |
Beta Was this translation helpful? Give feedback.
hello,
This is very good question in trading back-end development.
MT5, MT4 and Crypto trading is similar to each other.
I think you will develop back-end with Node.js
There is promise function in node.js
This function enable to compose and chain multi async function.
please look at this:
// Function to simulate a task with some execution time
function simulateTask(id, time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
console.log(
Task ${id} completed in ${time}ms
);resolve(
Task ${id} result
);}, time);
});
}
// Simulate tasks for each circle from 0 to 1000
const tasks = [];
for (let i = 0; i <= 50; i++) {
const taskTime = Math.floor(Math.random() * 100) + 1;
tasks.push(…