Get liquidity pool value

From UBot Studio
Revision as of 16:37, 4 July 2023 by LillyT (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

$get liquidity value is a function that returns the value of your investment in a liquidity pool on a decentralized exchange (DEX) in USD.

This function enables you to track the current value of your investment in a specific liquidity pool.

Contents

Parameters

Exchange: The decentralized exchange where you have invested.

Token A ID: The first token of the liquidity pair in which you have invested.

Token B ID: The second token of the liquidity pair in which you have invested.

Return Value

This function returns a string representing the value of your investment in USD.

Example

log("The value of my liquidity in USD is: {$get liquidity value("SushiSwap", "ETH", "SUSHI")}")

In the example above, the value of the user's investment in the ETH-SUSHI liquidity pool on SushiSwap is fetched and logged.

Post-Run

After running this function, RecordTxData is executed to record transaction data.

    • Please note:**

This function requires access to real-time data and an active, stable internet connection to provide accurate results. Also, the return value is an approximate worth of the funds based on the current market conditions and rates. The actual value may vary while performing transactions like swapping or liquidity removal.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox