Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Moonwell redeem fails on Base Sepolia and uses 18 decimals for cbBTC

Open Beginner friendly
#1,578 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@sebxt is already working on this.

Since Oct 20, 2026.

  • #1579 by @sebxt — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

Start in typescript/agentkit/src/action-providers/moonwell/moonwellActionProvider.ts and trace how redeem selects the network-specific address map and resolves underlying token decimals. Then read typescript/agentkit/src/action-providers/moonwell/constants.ts for the cbBTC and USDBC decimal entries. Update the mappings so redeem works on both networks and cbBTC mint and redeem use 8 decimals; verify the repro amounts encode correctly.

Written by the indexing model from the issue text.

Description

What happens

  1. On Base Sepolia, MoonwellActionProvider.redeem always returns Error: Unsupported token address <mToken>. The redeem path picks the right address map for the network when validating the mToken, but then looks up the underlying decimals with the mainnet map:

    const decimals = MTOKENS_UNDERLYING_DECIMALS[MOONWELL_BASE_ADDRESSES[args.mTokenAddress]];
    

    Sepolia mToken addresses are not in MOONWELL_BASE_ADDRESSES, so decimals is undefined. MOONWELL_USDBC is also missing from MTOKENS_UNDERLYING_DECIMALS.

  2. MTOKENS_UNDERLYING_DECIMALS.MOONWELL_cbBTC is 18, but cbBTC (0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf) has 8 decimals. Redeeming 0.5 cbBTC encodes redeemUnderlying(500000000000000000), which is 5,000,000,000 cbBTC, instead of redeemUnderlying(50000000). The transaction reverts.

  3. TOKEN_DECIMALS has no entry for cbBTC, so mint into the Moonwell cbBTC market returns Error: Unsupported token address 0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf.

What should happen

Redeem works on both supported networks and uses the underlying token's real decimals. cbBTC can be supplied and redeemed with 8 decimals.

Minimal repro

// wallet on base-sepolia
await moonwell.redeem(wallet, {
  mTokenAddress: "0x876852425331a113d8E432eFFB3aC5BEf38f033a", // Sepolia mUSDBC
  assets: "1.5",
});
// => "Error: Unsupported token address 0x876852425331a113d8E432eFFB3aC5BEf38f033a. ..."

// wallet on base-mainnet
await moonwell.redeem(wallet, {
  mTokenAddress: "0xF877ACaFA28c19b96727966690b2f44d35aD5976", // Moonwell cbBTC
  assets: "0.5",
});
// sends redeemUnderlying(500000000000000000) instead of redeemUnderlying(50000000)

Onchain check of the underlying tokens (underlying() then decimals()):

Base Sepolia 0x876852425331a113d8E432eFFB3aC5BEf38f033a -> USDBC 6
Base         0xF877ACaFA28c19b96727966690b2f44d35aD5976 -> cbBTC 8

Root cause

typescript/agentkit/src/action-providers/moonwell/moonwellActionProvider.ts uses MOONWELL_BASE_ADDRESSES instead of the network specific networkObject when resolving decimals in redeem, and typescript/agentkit/src/action-providers/moonwell/constants.ts has the wrong decimals for cbBTC, no entry for MOONWELL_USDBC, and no cbBTC entry in TOKEN_DECIMALS.

Dominant language
TypeScript
Stars
1.3k
Forks
871
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from coinbase/agentkit

All issues in coinbase/agentkit

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.