TradingView & Bonfida Bots
One thing that might be frustrating with Serum and DEXs, in general, is the lack of complex order types and, in particular, stop losses and take profits.
The main reason why DEXs don’t offer them is that you don’t want your stop losses and take profits to be fully visible on-chain as this could give information about your position to other market participants.
One way to solve this problem is to have a small off-chain program constantly checking the price of the asset and send an on-chain transaction when certain conditions are met. For example, a take profit would be a sell order transaction if BTC price gets above a certain threshold.
This is what we call automating a trading strategy and where Bonfida Bots and Trading View kick in!

TradingView Example

Let’s say you created a Bonfida Bot that trades on BTC/USDC
This bot is holding a certain amount of BTC and you want to take profit when BTC gets above $100,000.
All you have to do is, go to Trading View on the chart page of BTC/USD and click on Alert on the top bar
The condition is when BTC is crossing up the value 100,000
Then check the box Webhook URL and enter the following address https://tradingview-cranker.bonfida.com/alerts
Your Message will be in the form of:
1
{
2
"poolSeed": "poolSeed",
3
"size": "size of your order",
4
"side": "side",
5
"auth": "tradingViewAuthToken",
6
"marketName": "marketName"
7
}
Copied!
For a stop loss everything would be identical except for the condition where it would be: BTC is Crossing Down the value X. Where X is your stop loss price.
Copy link