Get liquidity pool balance
$get lp tokens is a function that returns the quantity of Liquidity Provider (LP) tokens that you have in a liquidity pool on a decentralized exchange (DEX).
LP tokens are issued to liquidity providers when they invest into a liquidity pool. These tokens represent the provider's proportionate share in the pool and can be redeemed for the underlying assets at any time.
Contents |
Parameters
Exchange: The decentralized exchange where you provided liquidity.
Token A ID: The first token of the pair where you've invested.
Token B ID: The second token of the pair where you've invested.
Return Value
This function returns a string representing the number of LP tokens you have for the specified liquidity pool on the given exchange.
Example
log("Number of LP Tokens: {$get lp tokens("SushiSwap", "ETH", "SUSHI")}")
In the example script above, the number of LP tokens the user has in the ETH-SUSHI liquidity pool on SushiSwap is determined and logged.
Post-Run
After running this function, RecordTxData is executed to record transaction data.
- Please note:**
This function only shows the amount of LP tokens you hold in your wallet. It does not reveal the underlying assets or their worth. For that, you might use additional commands like $get liquidity value and others. Also, ensure that you're connected to the correct wallet account before running the function.