Skip to content

18-decimal ERC-style tokens malfunction in liquidity module poolsΒ #801

@saint-Joy

Description

@saint-Joy

Current Behavior

Tokens with 18 decimals (e.g. gravETH and similar ERC-20 bridged tokens) do not work correctly in x/liquidity module pools. Swaps involving these tokens fail randomly (~80% failure rate, see #663 for related overflow evidence).

Expected Behavior

Pools containing 18-decimal tokens should handle deposits, withdrawals, and swaps correctly, same as 6-decimal native tokens.

Hypothesis

The liquidity module batch matching arithmetic likely truncates or overflows when operating on amounts with 18-decimal precision. The module was designed for 6-decimal Cosmos-native tokens.

Reproduction

  1. Create a pool with a high-decimal IBC token (e.g. gravETH) and a native token
  2. Attempt swaps in both directions
  3. Observe random failures

Fix Path

Requires chain upgrade β€” module-level arithmetic fix in batch execution.

Related: #663 (swap overflow with large amounts)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions