Témata
    P&L Calculations (Spot Grid Bot)
    bybit2025-09-16 11:00:36

    It’s important for traders to understand how to calculate the profit of a grid trading 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 grid trading strategy based on the following parameters:

    • Spot pair: BTC/USDC

    • Market price: 54,000 USDC

    • Upper price: 65,000 USDC

    • Lower price: 45,000 USDC

    • Number of grids: 5

    • Intervals: 4,000

    • Total investment: 23,610 USDC

    • Trading fee rate: 0.1%

     

     

     

     

     

     

    Grid Profit

    Grid profits are profits that are realized from the auto buy and sell from the current grid trading strategy.

     

    Formula

    Grid Profit = Sell quantity * Sell price * (1-Fee rate) - Buy quantity * Buy price

     

     

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

     

    Buy

    Sell

    Quantity (BTC)

    Price (USDC)

    Price (USDC)

    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 may be different from that of the buy orders due to the deduction of different Spot trading fees.

     

     

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

     

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

     

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

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

     

    Notes:

    The trading fees used in the examples are given for illustrative purposes only. To view the trading fee rates applicable to your account, please visit your My Fee Rates page.

    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 grid trading 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 go to the Trading Bot page and click on View My Bot → Details on the right of the active grid bot of your choice to enter the Details page, and then select Holdings.

     

     

     

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

    Position Value (BTC): 0.17574172

    Position Value (USDC): 14,452.26

     

    When the price rises to 57,000 USDC, Trader A's grid trading strategy completes a trade, profiting from the difference between 57,000 USDC and 53,000 USDC. 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 USDC

     

    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.

    Pomohlo ti to?
    yesAnoyesNe