Negative Conversion APY
- DecentralEyes
- Verified Member

- Posts: 25
- Joined: Sun Apr 13, 2025 7:27 am
Negative Conversion APY
I've just logged in after several weeks, and noticed one of my wallets has a negative conversion APY of -4 %.
- mistaPhi
- Site Admin

- Posts: 253
- Joined: Mon Dec 23, 2024 1:22 am
Re: Negative Conversion APY
That sounds interesting... At least for the system. :)DecentralEyes wrote: Sat Aug 30, 2025 10:54 am I've just logged in after several weeks, and noticed one of my wallets has a negative conversion APY of -4 %.
What's your wallet id?
Just checked some of the logic around the APY calculation and it's likely due to your wallet having a negative amount of available credits, where the negative amount is in the sub-satoshi range (ie. 9 or more digits behind the decimal point). This would essentially mean that you have 0 available credits. If this is the case, nothing to be concerned with but confirm and I'll clean up the code for this to avoid potential confusion in the future.
Send me a screenshot when you can as well b/c I'd definitely like to see this.
>> Best Bitcoin Wallet <<
- DecentralEyes
- Verified Member

- Posts: 25
- Joined: Sun Apr 13, 2025 7:27 am
Re: Negative Conversion APY
It’s
120084306.
120084306.
You do not have the required permissions to view the files attached to this post.
- mistaPhi
- Site Admin

- Posts: 253
- Joined: Mon Dec 23, 2024 1:22 am
Re: Negative Conversion APY
Thx DE... The data on the back end looks good and nothing contained therein would suggest your wallet having a negative APY, which is good. The APY calculation is performed in javascript, but with no negative values being sent from the backend, I've gotta say that I'm scratching my head as to how that value is coming out negative. But I did find an error in some of the javascript code where the roi_days variable was declared twice:
var roi_days = 0; if (rslt.CREDIT_ROI_DAYS_PASSED >= 1) { roi_days = rslt.CREDIT_ROI_DAYS_PASSED; } var conv_apy = 0; if (rslt.SAT_CONV_PER_HOUR > 0) { var roi_hours = rslt.CREDITS_AVAILABLE / (rslt.SAT_CONV_PER_HOUR * 0.00000001); var roi_days = roi_days + roi_hours/24; } else { roi_days = 0; }
a bit more noticeable as formatted below:
Code: Select all
var roi_days = 0;
if (rslt.CREDIT_ROI_DAYS_PASSED >= 1) {
roi_days = rslt.CREDIT_ROI_DAYS_PASSED;
}
var conv_apy = 0;
if (rslt.SAT_CONV_PER_HOUR > 0) {
var roi_hours = rslt.CREDITS_AVAILABLE / (rslt.SAT_CONV_PER_HOUR * 0.00000001);
var roi_days = roi_days + roi_hours/24;
} else {
roi_days = 0;
} I can't say that this is what's producing a negative APY calculation for your wallet, but declaring this variable twice could definitely cause some APYs to be inaccurate. So this needs to be corrected regardless since it can produce unpredictable results under certain conditions.
I just updated the code so check the APY again for me... If that fixed it, cool. Otherwise, let me know and I'll keep digging.
>> Best Bitcoin Wallet <<
- DecentralEyes
- Verified Member

- Posts: 25
- Joined: Sun Apr 13, 2025 7:27 am
Re: Negative Conversion APY
I just checked and it was still at minus four!
However, I just bought a credit and it jumped to (positive) 2%.
However, I just bought a credit and it jumped to (positive) 2%.
- mistaPhi
- Site Admin

- Posts: 253
- Joined: Mon Dec 23, 2024 1:22 am
Re: Negative Conversion APY
Ok... I'll keep investigating this as time permits. Not really a big deal but I do want to ensure that appropriate APYs are displayed for all wallets and under all circumstances.DecentralEyes wrote: Sun Aug 31, 2025 4:30 am I just checked and it was still at minus four!
However, I just bought a credit and it jumped to (positive) 2%.
Let me know the next time you see a negative amount and I'll copy your wallet's data to a test environment and try to replicate the issue. Once I'm able to replicate the it, I'll be able to identify the root cause and correct it.
In the meanwhile, keep stackin' sats :)
>> Best Bitcoin Wallet <<
- DecentralEyes
- Verified Member

- Posts: 25
- Joined: Sun Apr 13, 2025 7:27 am
Re: Negative Conversion APY
Many thanks, yeah, no big deal, interesting to see some JavaScript as a fellow web developer though! 
- mistaPhi
- Site Admin

- Posts: 253
- Joined: Mon Dec 23, 2024 1:22 am
Re: Negative Conversion APY
Hey DE,DecentralEyes wrote: Sun Aug 31, 2025 5:11 am Many thanks, yeah, no big deal, interesting to see some JavaScript as a fellow web developer though!![]()
The thought of this negative APY kept recurring in my mind again and again, and I've constantly been thinking of reasons why this may have occurred. Finally, a reasonable explanation crossed my mind and after looking into it, I'm fairly certain that this is the case.
The good thing is that the javascript code is correct (especially since I removed the dual declaration) and the math/logic actually adds up and that -4% is actually correct.
I compiled a list of all your wallet's buy & sell orders in the marketplace and you've sold about $63 in credits at an 18 and 18.8% discount. On the flip side, you've purchased about $50 in credits at discounts ranging from 9 to 12%.
This does not account for the credits purchased through the stimulus program, but it's a clear indication that you've been selling portions of your credits for prices that are less than what you acquired them for... It's like you buying a car from me for $5000 and selling it for $4000.
But it's also worth noting that the stats & APY are strictly in Bitcoin (not in fiat). And considering that quite a few of your purchases were made up to 6 month ago, Bitcoin's price appreciation would allow you to sell credits at a loss in terms of Bitcoin, but you'd still have profits in Pounds. And that's the beauty of this platform... Strictly BTC! :)
Now that I see you've sent me on a wild goose chase, I'm gonna have to charge you!
But I'm glad that you inquired b/c I was able to identify and correct that double declaration AND should someone else inquire about this in the future, it won't take me as long to research it. In the end, it's good to see a negative APY so you can be more aware of your buying & selling strategies in the marketplace.
Many thx bro
>> Best Bitcoin Wallet <<
Who is online
Users browsing this forum: No registered users and 1 guest