Skip to main content

Questions tagged [balance]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
35 views

Script to find top traders for a specific token?

How to build functionality like DexScreener top traders API? My goal is to return top traders for a certain token with their PnL and un-realized PnL.
0xkali's user avatar
  • 23
2 votes
1 answer
88 views

What is the best way to get all token holders and their balances by mint address?

There is a way to get token accounts by mint address using https://spl.solana.com/token#finding-all-token-accounts-for-a-specific-mint But unfortunately it only returns token accounts without balances,...
NoodleX's user avatar
  • 53
0 votes
1 answer
35 views

Fetch failed - following Solana Bootcamp lesson 2

I’m following bootcamp lesson 2 to fetch the balance of a wallet. The code is as per their example import { Connection, LAMPORTS_PER_SOL, PublicKey } from "@solana/web3.js"; const ...
Tim's user avatar
  • 1
0 votes
1 answer
54 views

How to get the pool balance and pool token balance in past epoch

Is there a way to read pool balance and pool token balance in past epoch?(for given pool public key)
Kaveen Laksitha's user avatar
0 votes
0 answers
10 views

Looking to replicate Step.Finance DeFi aggregation, but can't find the right commands

I'm writing a little Node.js tool to see my balances across the Solana universe, but have only found ways to see the balances in my actual wallet (getParsedAccountInfo, getParsedTokenAccountsByOwner, ...
Ben's user avatar
  • 1
3 votes
1 answer
52 views

Get Fraction of SOL Balance

I have a u128 total and a u128 user_total. I also have a balance and want the user to be able to withdraw (balance * user_total) / (total * multiplier) What is the best way to do this to avoid ...
Varun Siva's user avatar
1 vote
0 answers
149 views

How to get wallet balance From SOLANA?

import { useWallet } from '@solana/wallet-adapter-react'; import React, { useEffect, useState } from 'react'; import { Connection, PublicKey } from '@solana/web3.js'; const Hero = () => { const ...
Kamil Barwiński's user avatar
1 vote
0 answers
145 views

Solana getBalance() fetch failed on AWS Lambda

As the title suggests, I need to make an AWS Lambda function which retrieves an account balance. Tha problem is that it often throws the error: INFO Error: failed to get balance of account ...
Francesco's user avatar
1 vote
2 answers
1k views

Token balances on liquidity pools

How can I get to the price in a liquidity pool? I assumed it would be as simple as getting the balances of both tokens and doing quoteBalance / baseBalance, but that doesn't seem to be the case. Below ...
lsrth's user avatar
  • 21
0 votes
0 answers
47 views

My sol balance can't be sent

I am trying to send sol from wallet to another. I have sol, but it says I don't have any available for swap
Erioluwa Benjamin's user avatar
1 vote
1 answer
364 views

How to make make solana web.js bot fast

const { Keypair } = require("@solana/web3.js"); const { getOrCreateAssociatedTokenAccount, createTransferInstruction } = require("@solana/spl-token"); const { Connection, ...
RAJUReDDY's user avatar
0 votes
1 answer
257 views

Sol Balance oddity after buy transaction

I am trying to understand the SOL balance changes in transactions. Solscan shows on the main overview page that 0.001 SOL was used to buy a token and that is the amount that i passed to the Liquidity....
Peter Folsom's user avatar
2 votes
1 answer
148 views

Why does the active stake plus the rent reserve not equal to the total balance? How to correctly calculate the total balance?

So I am trying to report the difference balances on an staking account. My assumption was: total balance = active stake + rent reserve However, this equation is not true when looking at the numbers in ...
sibabtcs's user avatar
1 vote
1 answer
756 views

Error checking balance: argument 'pubkey': 'str' object cannot be converted to 'Pubkey'

I'm currently trying to use python's solana library to check my wallet's balance but for some reason I'm encountering this error. Importing PublicKey doesn't help out either, that gave me an error of &...
Yako's user avatar
  • 11
0 votes
0 answers
28 views

Token balances not showing

My token balances are longer displayed, next to the token there are just some dots where the token balances use to appear, can you please help rectify this issue. Regards
Michael's user avatar
2 votes
1 answer
498 views

What does it mean Lamport?

What does it mean Lamport?. How many Lamports is one Solana?. Is it important?. What is Lamport balance?. How to calculate it?. How many Lamports should I have in my account to be estimated rent ...
Gus's user avatar
  • 21
0 votes
1 answer
70 views

What's rent?. What's estimated become exempt?

I,d like to know what’s rent?. How to calculate it?. Does it work now?. Does it exist now?. When to become rent exempt?. I use Solflare and I’ve an account with more or less 200 Solana and I do ...
Gus's user avatar
  • 21
0 votes
1 answer
191 views

Need Help Displaying Token and NFT Holdings in Solana Dapp Portfolio

I'm currently working on a Solana Dapp portfolio project where users can connect their wallets and view their token and NFT holdings. I am done making the wallet connection buttons and installing ...
M.amanullah behlim's user avatar
0 votes
2 answers
212 views

Display Updated Wallet Balance After Transaction Confirmed

i'm learning solana development from Buildspace and this is the tutorial source code for the next.js app https://github.com/buildspace/solana-send-sol-frontend.git the component to display the solana ...
bwnnwtt's user avatar
  • 21
3 votes
1 answer
279 views

Is there an API to get the balance per day for an account?

I'm looking a way to get the account tranfers for an specific day. Is this possible?
Pablo Lopez's user avatar
3 votes
1 answer
556 views

Get Balance of Sol account more then one account

Can be any API or method to get the balance of a Sol account (more than one account in one time ) not use loop like getBalance() not that function,
Sikandar Hayat's user avatar
0 votes
1 answer
104 views

How can a system transfer instruction not result in a corresponding balance change?

I found a mainnet transaction with an inner system transfer instruction which does not seem to create a corresponding SOL balance change. The inner system transafer is transfering 0.001 SOL from ...
Alon's user avatar
  • 103
1 vote
1 answer
193 views

Empty pre/postTokenBalances when there is an actual token transfer

The RPC returns empty arrays for pre/postTokenBalances for the transaction below, when there is actually a token transfer. https://explorer.solana.com/tx/...
Aris's user avatar
  • 11
2 votes
1 answer
33 views

What does double dererefence ** do in anchor project?

This is how we write code to add fund to a user in anchor solana project: **user.to_account_info().try_borrow_mut_lamports()?+=amount; Why is the "**" operator used here?
Yilmaz's user avatar
  • 1,164
5 votes
1 answer
407 views

How to use Solana rust client to request SOL balance?

I am trying to use Rust (not Typescript) to query Solana and retrieve the SOL balance of a given account. But I can't seem to be able to do this. What I have thus far. As dependencies I have the ...
Finlay Weber's user avatar
0 votes
1 answer
700 views

Find amount of tokens swapped in a transaction?

I have a transaction signature for which I want to know the amount of tokens swapped. I have seen various discussions on the topic. Most of them suggest to make the JSON RPC call using the ...
Mrigank C's user avatar
1 vote
3 answers
775 views

Multiple Solana private keys, how do I check each one for a balance?

I have 100s of solana private keys for a service I'm building. How do I check each one for a balance without having to import them to the solana-cli each time? Is there a simple command to check a ...
Patoshi パトシ's user avatar
1 vote
0 answers
99 views

How to check if a wallet owns at least one NFT within a collection

Is it possible to call something like wallet.BalanceOf(NFTCollectionId)? I see how you can check to see if a specific account owns a specific NFT, but don’t see a way to check if the account owns at ...
zxed's user avatar
  • 111
1 vote
1 answer
148 views

Getting solana balance after transaction (transfered amount)

Hello all, Pretty new to Solana I have a question how can I get the transaction amount, I was told to use the PostBalances and preBalances, but not really sure how to go about it. any help would be ...
Enyel Sequeira's user avatar
4 votes
2 answers
3k views

Getting SOL balance via api for an address

I'm trying to just get the SOL balance, but I get returned a full list of tokens. https://public-api.solscan.io/account/tokens?account=34qHtfUqxgsnTDewwoXEXuhknymJ1sqoXD7H38aKADEw I'm using solscan ...
Patoshi パトシ's user avatar
2 votes
1 answer
279 views

get tokens balance [closed]

Looking for a way to fetch owner tokens and balance. i have tried the following code: const tokenAccounts = await this.solanaUtilService.connection.getTokenAccountsByOwner( this.wallet.publicKey, ...
Avaulto's user avatar
  • 102
3 votes
2 answers
2k views

How do I track historical sol balance?

I want to implement a feature that given by a wallet address and timestamp, it'll return the historical sol balance at that time. By using rpc method getSignaturesForAddress, getTransaction and ...
Xkimnt's user avatar
  • 31
3 votes
2 answers
592 views

How to get multiple accounts info with jsonParsed encoding using @solana/web3.js?

Currently, I can do this using a cURL request: curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d ' { "jsonrpc": "2.0", "id": ...
Peroxy's user avatar
  • 161
9 votes
1 answer
477 views

unable to fetch balance changes Solana Wallet Adaptor

On minting single or two NFTs phantom wallet shows the balance that will be detected before signing Tx but on multiple mint more than 2, it will show msg "unable to fetch balance changes" ...
Abdullah Qureshi's user avatar
6 votes
1 answer
139 views

Solana rent exempt account, period of exemption

Hey so we are all said to make rent-exempt accounts at creation time but is the rent exemption permanent? If not, how is the top-up handled after the exemption period? Like as soon as it ends you add ...
Nabeel Naveed's user avatar