properly format the comments
This commit is contained in:
parent
eea51ea40d
commit
45ccefe1fe
@ -160,7 +160,7 @@ func (h *MenuHandlers) CalculateCreditAndDebt(ctx context.Context, sym string, i
|
|||||||
|
|
||||||
scaledCredit := "0"
|
scaledCredit := "0"
|
||||||
|
|
||||||
// 1️. Find first stable voucher in POOL (for swap target)
|
// 1. Find first stable voucher in POOL (for swap target)
|
||||||
var firstPoolStable *dataserviceapi.TokenHoldings
|
var firstPoolStable *dataserviceapi.TokenHoldings
|
||||||
for i := range swappableVouchers {
|
for i := range swappableVouchers {
|
||||||
if isStableVoucher(swappableVouchers[i].TokenAddress) {
|
if isStableVoucher(swappableVouchers[i].TokenAddress) {
|
||||||
@ -169,7 +169,7 @@ func (h *MenuHandlers) CalculateCreditAndDebt(ctx context.Context, sym string, i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2️. If pool has a stable, get swap quote
|
// 2. If pool has a stable, get swap quote
|
||||||
if firstPoolStable != nil {
|
if firstPoolStable != nil {
|
||||||
finalAmountStr, err := store.ParseAndScaleAmount(
|
finalAmountStr, err := store.ParseAndScaleAmount(
|
||||||
string(activeBal),
|
string(activeBal),
|
||||||
@ -194,7 +194,7 @@ func (h *MenuHandlers) CalculateCreditAndDebt(ctx context.Context, sym string, i
|
|||||||
scaledCredit = store.AddDecimalStrings(scaledCredit, finalQuote)
|
scaledCredit = store.AddDecimalStrings(scaledCredit, finalQuote)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3️. Add ALL wallet stable balances (from FetchVouchers)
|
// 3. Add ALL wallet stable balances (from FetchVouchers)
|
||||||
for _, v := range allVouchers {
|
for _, v := range allVouchers {
|
||||||
if isStableVoucher(v.TokenAddress) {
|
if isStableVoucher(v.TokenAddress) {
|
||||||
scaled := store.ScaleDownBalance(v.Balance, v.TokenDecimals)
|
scaled := store.ScaleDownBalance(v.Balance, v.TokenDecimals)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user