@pwngh/economy-lab
    Preparing search index...

    Function balanceDelta

    The signed amount a leg moves its account's balance by. Leg amounts are stored debit-positive and credit-negative everywhere; this flips the sign for credit-normal accounts (user wallets, liability accounts such as revenue and the payout reserve) and passes debit-normal ones through. A store folding running balances sums this, never the raw leg amount: the credit leg funding a user's spendable account is stored negative but must raise the balance.

    • Returns the signed amount by which a leg moves its account's balance. Leg amounts are debit-positive, so this flips the sign for credit-normal accounts and leaves debit-normal ones unchanged.

      Parameters

      Returns Amount