Stop Losses & Take Profits on Serum

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 because 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 instance, for a take profit, it would be a sell order transaction if BTC price gets above a certain threshold.

Sounds like automating a trading strategy? Well it actually is, and this is where Bonfida Bots and Trading View kick in! 🤖

Let’s say you have 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

If your pool address is GwEMLqoRVRz2h2D3GCy2tkwTEyqJ8xouFgVip3W1BkKp , and your TradingView auth token received when creating the pool is 3evM6HU1GEKd5wfR47N1zwGJ9V5gqcHgfecH58nhJRtMVMHnVKaZQ1zGswVZYiQsna1JG9gecj7M

Then your Alert message will be:


“auth”:”3evM6HU1GEKd5wfR47N1zwGJ9V5gqcHgfecH58nhJRtMVMHnVKaZQ1zGswVZYiQsna1JG9gecj7M”, “poolSeed”:”GwEMLqoRVRz2h2D3GCy2tkwTEyqJ8xouFgVip3W1BkKp”,

“marketName: “BTC/USDC”,




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.

Create a bot here:

Learn how to create a bot with this video:

Generate TradingView messages:

TradingView Cranker:

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —-

None of the above is financial advice.

Bonfida does not provide services to personal accounts of current residents of the United States of America, Cuba, Crimea and Sevastopol, Iran, Syria, North Korea, or Antigua and Barbuda.

FIDA is not offered within the United States or prohibited jurisdiction.

Data, Analytics, and GUIs for Serum