Creating a Bot
This is a user guide to assist users in launching their own bot on our platform.
Youtube version of the user guide
See the written guide below:

Prerequisites

  1. 1.
    An SPL-compatible wallet
  2. 2.
    Solana (SOL) in your wallet
  3. 3.
    A TradingView premium account
A Sollet wallet is recommended

Creating Your Custom Pool

Go to the Bonfida Bot's page and select Create a strategy
At the My Pools page connect your wallet
No you can Create a new pool
Configure the settings:
1. Select the TradingView option
2. Select the markets on which you want to trade
You can select any Serum market e.g FIDA/USDC. You can select several markets for a single pool
You cannot add a market to the pool after its creation
3. Select the number of assets you want to deposit in the pool initially. The initial amount deposited will determine the initial value of a pool token. For example, if you deposit 100 USDC + 10 FIDA, 1 Pool Token = 100 USDC + 10 FIDA.
You can deposit more tokens at any time
4. Click on Create pool and approve the transactions
Once the transactions have been confirmed you will receive a Pool Seed and a TradingView Auth Token, save the TradingView Auth Token in a safe place

Setting Up TradingView Alerts

1. Go to TradingView and select your preferred indicator from the Indicators tab on the top left
For this example we used MACD
2. Next, click on Alert
3. Our selected strategy is MACD, so the strategy is to go long when the histogram is crossing up above 0
Select Open-ended if you want the strategy to run with no limit in time
5. In the Alert Actions sections tick the box Webhook URL and enter https://tradingview-cranker.bonfida.com/alerts
6. Give a name to the alert next to Alert name e.g Bonfida Bot
7. In the Message section you will need to enter the following parameters: marketName, auth, poolSeed, side, size
The Message needs to be done in the following format:
1
{
2
"poolSeed": "poolSeed",
3
"size": "size of your order",
4
"side": "side",
5
"auth": "tradingViewAuthToken",
6
"marketName": "marketName"
7
}
Copied!
For example, a valid Message is:
1
{
2
"poolSeed": "DhCEYSbw2uHdDBt2D7Xaxdy2LUUSKk11Kvpd1WJFEwGy",
3
"size": "10",
4
"side": "buy",
5
"auth": "3d7NfKp7ddFWXcuPd1BrJFkb2VEmo4EnNa9Yocus3Pf4vRy4ufvtKvuA2bmT595cgiaizMyZA1Ma1zAdQwH68oiT",
6
"marketName": "FIDA/USDC"
7
}
Copied!
Size needs to be a number between 0 and 100. It's the percentage of the pool's funds that will be used to execute the order. If a buy order is sent to a pool containing 1,000 USDC with a size of 10 it will use 10% of 1,000 i.e 100 USDC
Side needs to be either buy or sell. This field is case sensitive, thus "buy" is valid but "BUY" or "Buy" are not
MarketName needs to be a valid Serum market on which your custom pool can trade. This field is case sensitive.
Valid: "BTC/USDC", "BTC/USDT", "ETH/USDC"
Invalid: "btc/usdc", "BTCUSDC", "BTC-USDC"
If you need help with the code above you can use our TradingView Message Generator
Bonfida Bot's documention can be found here https://github.com/Bonfida/bonfida-bot