Since 2009, we have been utilizing our extensive expertise in blockchain technologies to help businesses, both large and small, maximize their efficiency.
Explore More
With more than 400+ experts, Oodles comprises a fantastic resource of business knowledge that spans multiple industries. Whatever the circumstances, we keep to our obligations.
Explore More
At Oodles, we help our clients work with a human understanding but at superhuman speed something that others can't. They thus advance and maintain their lead
29th May 2023
21 min read
Sr. Associate Consultant L2 - Development
A whale alert is a notification system that notifies the user whenever a large amount of cryptocurrency is moved or traded. Whale alerts keep track of the blockchain transactions and/or wallets that have a large number of cryptocurrencies and have the ability to influence the market with their actions.
To detect large transactions, whale alert services use different algorithms to analyze the blockchain and identify transactions that meet certain criteria, such as transactions that involve a large amount of cryptocurrency or transactions that involve specific wallets or addresses known to belong to whales.
You may also like to explore | Cryptocurrency Development Services
Once a large transaction is detected, the whale alert service sends out an alert through various channels, such as social media, email, or mobile notifications. The alert typically includes information about the transaction, such as the amount of cryptocurrency involved, the sender and recipient addresses, and the time and date of the transaction.
In this guide, we will create our whale alert using NodeJs and web3.js library.
To make a whale alert service you need to decide a few things before starting the development:
Below is the code for our custom whale alert - We are keeping track of the transactions of each block and if the value of any transaction is greater than the threshold value, then the code will print an alert in the console with the details of the transaction.
The threshold value set in our example is 0.5 ethers, you can change the value on line 8 and use the whale alert according to your requirements.
const { ethers } = require('ethers');
const INFURA_URL = '';
// Connect to Blockchain node
const provider = new ethers.JsonRpcProvider(INFURA_URL);
// Threshold value
const THRESHOLD = ethers.parseEther('0.5');
console.log('Welcome to our Custom Whale Alert!\n');
// Whenever a new block is created,
// the callback function is called with the blockNumber
provider.on('block', async (blockNumber) => {
console.log(`Watching ${blockNumber} Block\n`);
// Getting the block details
const block = await provider.getBlock(blockNumber);
const transactions = block.transactions;
// Looping over the transactions of the block
for (const transactionHash of transactions) {
const transaction = await provider.getTransaction(transactionHash);
// Check if the 'value' of the current transaction
// is greater than the THRESHOLD value
if (transaction.value > THRESHOLD) {
// Create an alert
console.log(
'WHALE ALERT\n',
`Transaction Hash: ${transaction.hash}\n`,
`Sender's Address: ${transaction.from}\n`,
`Reciever's Address: ${transaction.to}\n`
);
}
}
});
Mohd Yasar
Mohd Yasar is a skilled Backend Developer, with proficiency in NodeJs, MongoDB, MySql, Docker, Solidity, NFT's, and microservices architecture. He has extensive experience in developing secure and scalable solutions for complex applications, and has delivered successful projects such as Scaffold, Cryptomining, Mintlab, WalletPort, Data Management in Distributed Systems, and Bluechain, meeting the clients' requirements. Overall, he seems to have a diverse skill set and a strong foundation in developing scalable and reliable projects using a variety of technologies.
Sr. Associate Consultant L2 - Development
By using this site, you allow our use of cookies. For more information on the cookies we use and how to delete or block them, please read our cookie notice.
We would love to
hear from you!
Innovate with confidence!