I’m trying to verify the burn SOL amount in an LP token, but my current code is set up to check the token amount. Can someone help me modify it to check the burn amount based on SOL amount instead?
Here is my current code:
try {
const amount = await this.connection.getTokenSupply(poolKeys.lpMint, this.connection.commitment);
// const burned = amount.value.uiAmount === 0;
const tokenAmount =
amount.value.uiAmount || amount.value.uiAmount == 0
? new BN(amount.value.uiAmount).muln(10 ** amount.value.decimals)
: new BN(amount.value.amount);
const burned = this.oldAmount.sub(tokenAmount).gtn(BURN_AMOUNT);
this.oldAmount = tokenAmount;
const result = { ok: burned, message: burned ? undefined : "Burned -> Creator didn't burn LP" };
}
I’m trying to verify if the SOL amount burned is greater than a certain threshold (BURN_AMOUNT
). However, my code is currently checking the token amount instead of the SOL amount. Can someone please help me modify this code to achieve my goal?
user25986409 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.