As Airdrop tool uses MerkleTree to drop amounts to thousands of recipient cost effectively, Airdrop creation consists of 2 parts:

  1. Use API to create a MerkleTree from CSV file with list of recipients and amounts to vest;
  2. Pass the data received from the API to Airdrop SDK to populate the Airdrop on the blockchain;

So to properly automate this process you will need to have 2 integrations: with our API and with our SDK - basically you will act the same way as our UI currently processes Airdrops.

Public API integration

We have an endpoint https://api-public.streamflow.finance/v2/docs#/airdrops/create_distributor that allows you to pass a CSV file in the following format (it’s a bit different from what we have in the UI as UI abstracts token amounts).

Example CSV

pubkey,amount_unlocked,amount_locked,category
1111111QLbz7JHiBTspS962RLKV8GndWFwiEaqKM,0,1,Staker
1111111ogCyDbaRMvkdsHB3qfdyFYaG1WtRUAfdh,0,1,Staker
11111112D1oxKts8YPdTJRG5FzxTNpMtWmq8hkVx3,0,1,Staker
11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP,0,1,Staker

Where:

All token amounts are in RAW format meaning that you need to account for decimals that the mint has, i.e. if your mint has 6 decimals and you want to send 1.5 tokens, you need to pass 1500000 as amount.

In the response you will receive a JSON with relevant meta fields about the Airdrop and several fields that should be used when populating the Airdrop on the blockhain.

Vested Fee

As we agreed on a vested fee for the Airdrops meaning that each Airdrop creation fee will be paid from vested amount, you will also need to add our treasury address to the CSV file and set its amount_unlocked and amount_locked equal to 0.04% of total amounts of each number. Example:

Then you will need to add a recipient to the CSV file with these values: