Topics
    This article does not currently support your language. We recommend the English version for you.
    P&L Calculations (Spot Grid Bot)
    bybit2024-11-22 04:43:50

     

     

     

    It’s important for traders to understand how to calculate the profit of a Spot Grid Bot strategy before creating their grid bot. The following is a guide to help you better understand the relationship between the different variables and the calculation of grid profit and total profit and loss.

     

    Let's run an example to see how the four values — Grid Profit, Grid APR, Total P&L and Total APR — are calculated.

     

    Suppose Trader A creates a Spot Grid Bot strategy based on the following parameters:

    • Spot pair: BTC/USDT

    • Market price: 54,000 USDT 

    • Upper price: 65,000 USDT

    • Lower price: 45,000 USDT 

    • Number of grids: 5

    • Intervals: 4,000

    • Total investment: 23,610 USDT

     
     

    Read More

    Introduction to Spot Grid Bot on Bybit

     
     

     

    Grid Profit

    Grid profits are profits that are realized from the auto buy and sell from the current Spot Grid Bot strategy.

     

    Formula

    Grid Profit = Interval × Quantity of base token per grid (Buy Order) × completed grid trade − Trading Fee

    Trading Fee = Filled Order Quantity (Buy & Sell) × Trading Fee Rate x Sell Price

     

    When the Spot Grid Bot strategy is successfully activated, the base token required for the Spot Grid Bot strategy will be automatically purchased, and the orders will be placed as follows: 
     

    Buy

    Sell

    Quantity (BTC)

    Price (USDT)

    Price (USDT)

    Quantity (BTC)

    0.08795882

    53,000

    57,000

    -

    0.08795882

    49,000 

    61,000

    0.08787086

    0.08795882

    45,000

    65,000

    0.08787086


    Notes:

     — You can view the quantity of each grid under Positions in the Details page.

     — The quantity of sell orders is different from that of the buy orders due to the deduction of a 0.1% Spot trading fee.

     

    When the BTC price hits 53,000 USDT, the buy order will be executed, and the sell order will be placed above the next grid at 57,000 USDT. When the price rises to 57,000 USDT, the sell order will be executed, and a buy order at 53,000 USDT will be placed. 

     

    That is, a grid trade is completed and earns a profit of 341.81 USDT, based on the following calculation:

     

    Grid Profit = 4,000 × 0.08795882 × 1 − 10.02 = 341.81 USDT

    Trading fee = (0.08795882 + 0.08787086) × 0.1% x 57,000 = 10.02 USDT

     

    Notes:

     — Trading fee rates used here are for non-VIP users only. To learn more about spot trading fees, please refer to Trading Fee Structure.

     — The system will adjust the limit of the maximum number of grids according to the price range you set, in order to ensure that the Spot Grid Bot strategy records positive profits (i.e., grid profits > trading fees) under normal market conditions.

     

     

     

     

     

     

     

     

    Grid APR

    The grid APR has been annualized to derive the annual percentage rate (APR) of the grid profit.

     

    Formula

    Grid APR = [(Grid profit/Total investment)/Days of running × 365 days] × 100%

     

    Assuming that Trader A’s grid bot runs within 24 hours:

     

    Grid APR = [(341.81/23,610)/1 × 365] × 100%

    = 528.42%

     

     

     

     

     



     

    Total P&L

    The total profit is the grid profit plus the profit or loss of the base token.

     

    Formula 

    Total Profit = (Equity of Base Token + Quote Token) − Total investment

     

    Revisiting Trader A’s case:

    To view the value of the base token and quote token after the grid strategy has been successfully executed, please click on More → Details on the right of the active grid bot column to enter the Details page, and then select Positions.

     

    image.png


     

    In this case, the position values ​​you can see under Positions are as follows:

     

    Position Value (BTC): 0.17574172 

    Position Value (USDT): 14,452.26

     

    When the price rises to 57,000 USDT, Trader A's Spot Grid Bot strategy completes a trade, profiting from the difference between 57,000 USDT and 53,000 USDT. As the price of BTC increases, so does the equity of the base token in your account: 

     

    Total Profit = (57,000 × 0.17574172 + 14,452.26) − 23,610

    = 859.54 USDT

     

    Please note that when the base token value falls more than the profit earned by the grid bot, it will cause the total profit to turn negative.

     

     

     

     

     

     

     

     

    Total APR

    The total APR has been annualized to derive the annual percentage rate (APR) of the total profit.

     

    Formula

    Total APR = [(Total profit/Total investment)/Days of running × 365 days] × 100%

     

    Let’s say that Trader A’s grid bot runs within 24 hours:

     

    Total APR = [(859.54/23,610)/1 × 365] × 100%

    = 13.29%

     

    When your grid bot is running, your grid profits will be auto credited to your Trading Bot Account. After the grid strategy is completed, the funds will be automatically transferred to your Funding Account.

    Was it helpful?
    yesYesyesNo