Get liquidity pool balance
Line 1: | Line 1: | ||
− | '''$lp | + | '''$lp balance''' is a function that shows how many Liquidity Provider (LP) tokens you have. LP tokens are given when you invest into a liquidity pool, and they represent your stake in the pool. |
+ | |||
+ | This command is helpful for liquidity providers who want to check the number of LP tokens they possess in a particular pool on a decentralized exchange. | ||
== Parameters == | == Parameters == | ||
− | '''Exchange:''' The decentralized exchange | + | '''Exchange:''' The decentralized exchange where the liquidity pool resides. The available exchanges will depend on the "SwapNames" list set in your environment. |
− | '''Token A ID | + | '''Token A ID''' and '''Token B ID:''' The pair of tokens involved in the liquidity pool for which you want to check your LP tokens. The available tokens will be dependent on the "CoinNames" list set in your environment. |
− | + | ||
− | '''Token B ID:''' The | + | |
== Return Value == | == Return Value == | ||
− | + | This function returns a string of your balance of LP tokens in the specified liquidity pool. | |
− | This function returns a string | + | |
== Example == | == Example == | ||
− | |||
<pre> | <pre> | ||
− | + | log("LP tokens in DAI-USDC SushiSwap pool: {$lp balance("SushiSwap", "DAI", "USDC")}") | |
− | + | ||
− | log("LP | + | |
</pre> | </pre> | ||
− | + | The output will display the number of LP tokens you hold in the specified liquidity pool. | |
− | + | Example Output: | |
+ | <blockquote> | ||
+ | <p>LP tokens in DAI-USDC SushiSwap pool: 10</p> | ||
+ | </blockquote> | ||
− | + | The actual balance of LP tokens will depend on the amount of liquidity you have provided to the pool. | |
− | LP | + |
Revision as of 19:08, 4 July 2023
$lp balance is a function that shows how many Liquidity Provider (LP) tokens you have. LP tokens are given when you invest into a liquidity pool, and they represent your stake in the pool.
This command is helpful for liquidity providers who want to check the number of LP tokens they possess in a particular pool on a decentralized exchange.
Parameters
Exchange: The decentralized exchange where the liquidity pool resides. The available exchanges will depend on the "SwapNames" list set in your environment.
Token A ID and Token B ID: The pair of tokens involved in the liquidity pool for which you want to check your LP tokens. The available tokens will be dependent on the "CoinNames" list set in your environment.
Return Value
This function returns a string of your balance of LP tokens in the specified liquidity pool.
Example
log("LP tokens in DAI-USDC SushiSwap pool: {$lp balance("SushiSwap", "DAI", "USDC")}")
The output will display the number of LP tokens you hold in the specified liquidity pool.
Example Output:
LP tokens in DAI-USDC SushiSwap pool: 10
The actual balance of LP tokens will depend on the amount of liquidity you have provided to the pool.