6

I am running a script on devnet with a regular interval that requires solana airdrop.

Now I get Error: airdrop request failed. This can happen when the rate limit is reached.

So I was wondering, does anyone know what the limit is? I.e. is there a fixed limit per time unit or something like that?

3 Answers 3

8

Your maximum limit to airdrop has been reached. Maximum 24 SOL are allowed per day. This limit is set so users may not abuse the devnet. You can airdrop SOL to different accounts and use it there or transfer it to the currently blocked account. The SOL airdrop limit will reset the next day and you can airdrop up to 24 SOL again.

2

The devnet airdrop is capped at 2 Sol per request. And there is a fixed limit time as well and it appears to be about 5 seconds (may be more/less but not by much).

1
  • Airdrop 2 SOL per every 5 seconds? That does not sound right. I tried airdropping 2 SOL every hour and got rate limited
    – Burger Bob
    Commented Oct 17, 2022 at 19:46
1

Abdullah's answer is excellent, but I wanted to add:

If you're airdropping on devnet automatically (eg in a unit test or another script that is ran frequently)

I'd suggest airdropIfRequired from the @solana-developers/helpers repository. This allows you to continue to get airdrops if you need them (say when running unit tests) but not actually contact the faucet (and hence not affect your rate limit) if you already have enough SOL:

const newBalance = await airdropIfRequired(
  connection,
  keypair.publicKey,
  0.5 * LAMPORTS_PER_SOL,
  1 * LAMPORTS_PER_SOL,
);

If you don't actually need devnet

Remember you only need Airdrops on devnet! If you don't want to test in Devnet just fire up a local validator where there are no airdrop limits!

solana-test-validator

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.