Anti-whale functions are an important extra security layer to a farm. They limit big players (whales ór malicious developers) to dump or pump huge amounts of their token by setting a maximum sell/buy limit. In this guide we will show you how to check whether or not a farm, on the Avalanche network, has an anti-whale function in place.
Step 1. Find the MasterChef contract address #
The first thing we need to do is to find the MasterChef contract address. You can do so by going through our reviewed farms list or by looking on the website of the farm. Usually, the doc page should have some info about the MasterChef contract. If you’re still confused on how to get the MasterChef contract address, check out this guide.
Step 2. Open the MasterChef contract #
Open the Avalanche block explorer and paste the MasterChef contract address in the search bar and hit enter. In this guide we’ll use Onyx Farm’s MasterChef.
Step 3. Search for the anti-whale function #
Once you have opened the MasterChef contract, look for the ‘Code’ tab and select it.
Look for a section that contains the name of the farm’s governance token. In this case, the section is called ‘OnyxToken.sol’. Click inside the code box and press Ctrl+f. Use one of the following keywords to find the anti-whale function: ‘Whale’, ‘Anti’ or ‘maxtransferamount’.
You can conclude from the following lines that in Onyx Farm’s case, there’s a 1% anti-whale function present with a minimum of 0.5%:
// Max transfer amount rate in basis points. (default is 1% of total supply)
uint16 public maxTransferAmountRate = 100;
// Min value of the max transfer amount rate. (0.5%)
uint16 public constant maxTransferAmountRateMinValue = 50;
Good job! You have succesfully verified whether or not there’s an anti-whale function present for the farm of your interest! Make sure to read our other articles on our wiki too.