Get liquidity pool value
(Created page with "'''$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 ...") |
|||
Line 1: | Line 1: | ||
− | '''$ | + | '''$defi liquidity pool value''' is a function that calculates the value of your investment in a liquidity pool on a specific decentralized exchange, shown in USD. |
− | This function | + | This function is extremely useful for enterprise users who are providing liquidity on decentralized exchanges and want to know the current value of their investment. |
+ | |||
+ | == User Level == | ||
+ | |||
+ | This function is exclusively available for enterprise users. | ||
== Parameters == | == Parameters == | ||
− | '''Exchange:''' The decentralized exchange where | + | '''Exchange:''' The decentralized exchange where your liquidity pool is located. |
− | '''Token A ID:''' The first token | + | '''Token A ID:''' The ID of the first token in the liquidity pool. |
− | '''Token B ID:''' The second token | + | '''Token B ID:''' The ID of the second token in the liquidity pool. |
− | == Return Value == | + | == Return Value == |
− | This function returns a string | + | This function returns a string value which is the current value of your liquidity pool investment in USD. |
== Example == | == Example == | ||
<pre> | <pre> | ||
− | + | define areacode | |
+ | ui text msg("Your investment value in USDT/ETH on Uniswap is: {$defi liquidity pool value("Uniswap", "USDT", "ETH")}") | ||
</pre> | </pre> | ||
− | In | + | In this example, the function is calculating the current value of your investment in the USDT/ETH liquidity pool on Uniswap in USD, and then displaying that value in the UI. |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + |
Revision as of 18:31, 4 July 2023
$defi liquidity pool value is a function that calculates the value of your investment in a liquidity pool on a specific decentralized exchange, shown in USD.
This function is extremely useful for enterprise users who are providing liquidity on decentralized exchanges and want to know the current value of their investment.
Contents |
User Level
This function is exclusively available for enterprise users.
Parameters
Exchange: The decentralized exchange where your liquidity pool is located.
Token A ID: The ID of the first token in the liquidity pool.
Token B ID: The ID of the second token in the liquidity pool.
Return Value
This function returns a string value which is the current value of your liquidity pool investment in USD.
Example
define areacode ui text msg("Your investment value in USDT/ETH on Uniswap is: {$defi liquidity pool value("Uniswap", "USDT", "ETH")}")
In this example, the function is calculating the current value of your investment in the USDT/ETH liquidity pool on Uniswap in USD, and then displaying that value in the UI.