bilix-software / solana-pump-fun

Facilitates the execution and simulation of buy and sell transactions for pump.fun on the Solana blockchain.
https://viper.bot
MIT License
103 stars 47 forks source link

Sell Doesnt Work #8

Closed 0xHouss closed 4 months ago

0xHouss commented 4 months ago

Hello, I bought with the pumpFunBuy function 18803 dotfun for 0.0006 sol, and now i'm trying to sell them using the pumpFunSell function, the transaction is confirmed but it doesnt change my dotfun balance

import CONFIG from "./config";
import { pumpFunBuy, pumpFunSell } from "./lib/pump-fun/swap";
import { TransactionMode } from "./types";

async function main() {
    const transactionMode = TransactionMode.Execution; // Example mode, adjust as needed
    const payerPrivateKey = CONFIG.WALLET_PRIVATE_KEY; // Example key, adjust as needed
    const mintAddress = "7gyaJeFEwLhwvSsGiPjBUDAAyEPypLKeXYyECZSoaT4a"; // Example address, adjust as needed
    const solIn = 0.0006; // Example value, adjust as needed
    const slippageDecimal = 0.15; // Example value, adjust as needed
    const tokenBalance = 18803; // Example value, adjust as needed
    const priorityFeeInSol = 0.00003; // Example value for tip to get faster inclusion, adjust as needed

    try {
        // Call the buy function
        // await pumpFunBuy(transactionMode, payerPrivateKey, mintAddress, solIn, priorityFeeInSol, slippageDecimal);

        // Call the sell function
        await pumpFunSell(transactionMode, payerPrivateKey, mintAddress, tokenBalance, priorityFeeInSol, slippageDecimal);
    } catch (error) {
        console.error('Error in main function:', error);
    }
}

main()

` Transaction confirmed with signature: 4c8r6tPSpB7AAo7NMiG2vDcfmTo36xLtdVAYF98uwE2Zipk4GoKkTJWNsRWaYFkCELheLj8MkGUfdBqw4r17wv5Q

Sell transaction confirmed: 4c8r6tPSpB7AAo7NMiG2vDcfmTo36xLtdVAYF98uwE2Zipk4GoKkTJWNsRWaYFkCELheLj8MkGUfdBqw4r17wv5Q `

image image

bilix-software commented 4 months ago

Hi, you need to add 6 0's behind the amount you're trying to sell to account for the token decimal offset. It did sell but it sold a tiny amount thats why you don't see your balance change. See your tx here: https://solscan.io/tx/4c8r6tPSpB7AAo7NMiG2vDcfmTo36xLtdVAYF98uwE2Zipk4GoKkTJWNsRWaYFkCELheLj8MkGUfdBqw4r17wv5Q

0xHouss commented 4 months ago

Oh right, i didnt notice, thanks for your help !

Side question, i'm new with all the solana dev stuff, and i'm missing resources for learning, can you help me with some questions? and if yes, how can i contact you?

bilix-software commented 4 months ago

You can contact me at info@bilix.io