Skip to content

kamino-lend deposit fails for assets not in hardcoded registry #1

@yurushao

Description

@yurushao

Bug

glam-cli kamino-lend deposit calls getAssetMeta(asset) (main.js:19936) to look up token decimals before passing the amount to the SDK. If the asset mint is not in the CLI's hardcoded asset registry, the command fails with:

Error: Asset not supported: CASHx9KJUStyftLFWGvEVf59SGeG9sh5FfcnZMVPCASH

This also affects withdraw, borrow, and repay (lines 19950, 19964, 19978).

Repro

glam-cli kamino-lend deposit \
  7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF \
  CASHx9KJUStyftLFWGvEVf59SGeG9sh5FfcnZMVPCASH \
  2.28 --yes

CASH has a valid reserve (ApQkX32ULJUzszZDe986aobLDLMNDoGQK8tRm6oD6SsA) on the Kamino main market, but the CLI rejects it before reaching the SDK.

Suggested fix

When getAssetMeta doesn't find the mint in its registry, fetch decimals on-chain via getMint() instead of throwing. The SDK layer (kaminoLending.deposit) has no such restriction — the issue is purely in the CLI's amount conversion.

Version

glam-cli 1.0.13

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