Strategy ROI

HydroTrade is engineered to enable traders to establish an on-chain recurring trading strategy of buying high and selling low. With this functionality, it becomes feasible to compute the returns (ROI) for each strategy by leveraging data derived from strategy actions, including creation, balance adjustments, and trades interacting with the accessible liquidity.

Disclaimer: Our objective is to calculate an ROI metric that resonates most effectively with users, reflecting their performance utilizing HydroTrade. We employ a methodology that relies solely on the present prices of paired tokens, retrospectively applied to each block, and assesses the returns as a percentage of the liquidity contributed.

Calculating ROI

To determine the strategy ROI, we adhere to the following guidelines:

  • Only trade events influence the calculation. Additions or removals of liquidity do not alter the ROI value.

  • We employ "sub-strategies" to compute the strategy ROI, representing the intervals between each balance-changing action.

  • The strategy ROI is the aggregate of all sub-strategy returns (in USD), divided by the total liquidity amount deposited (evaluated in USD), provided that the liquidity has been traded.

  • Sub-strategy returns are calculated using the current USD price of the tokens, utilizing historical token amounts against the current USD price.

To compute the ROI, we follow this procedure:

  • Determine the token gains for each sub-strategy.

  • Convert the token amounts to USD by multiplying them with the current market price.

  • Total the USD value of gains and divide it by the strategy value.

Example:
Start
1 ETH and 1 WBTC
1 ETH @ $2,000 USD = $2,000         # uses the current price today
1 WBTC @ $40,000 USD = $40,000      # uses the current price today
Total value of portfolio is $42,000

The user's order is partially traded against, converting their ETH for WBTC.

End 
0.5 ETH and 1.05 WBTC
0.5 ETH @ $2,000 USD = $1,000        # uses the current price today
1.05 WBTC @ $40,000 USD = $42,000    # uses the current price today
Total value of portfolio is $43,000

Returns: $43,000 - $42,000 = $1,000
ROI: returns / value deposited = 1,000/42,000 = 2.38%

Last updated