# Akash Take Module: How It Calculates Provider Earnings

> Discover how Akash Network's take module calculates provider earnings. Learn about the commission system and fee distribution for enhanced understanding.

- Repository: [Akash Network/node](https://github.com/akash-network/node)
- Tags: deep-dive
- Published: 2026-02-24

---

**The take module is Akash Network's commission system that calculates provider earnings by applying a configurable percentage fee to payments, returning the remainder to providers and routing the fee to the distribution module.**

The **take module** in the `akash-network/node` repository centralizes all commission logic for the Akash decentralized cloud marketplace. This minimal module stores global and per-denomination take rates, providing a single source of truth for calculating fees on provider payments. When a lease payment is processed, the module's `SubtractFees` method splits the amount into **provider earnings** and network **fees** without storing any balances itself.

## What Is the Akash Take Module?

The take module serves as Akash's "fee-take" or commission engine. Unlike modules that manage token balances, it operates purely as a calculation layer that other modules invoke to apply commission rates to payments.

### Core Responsibilities

- **Parameter Storage**: Maintains a global default take rate and optional per-denomination overrides in the module's parameter store.
- **Rate Resolution**: Determines the applicable take rate for any given coin denomination through the `findRate` method.
- **Fee Calculation**: Computes the split between provider earnings and network fees via the `SubtractFees` keeper method.
- **Governance Integration**: Supports parameter updates through `MsgUpdateParams` messages authorized by the **gov** module.

## How the Take Module Calculates Provider Earnings

The core calculation logic resides in [`x/take/keeper/keeper.go`](https://github.com/akash-network/node/blob/main/x/take/keeper/keeper.go). When invoked, the module converts payment amounts, applies the appropriate take rate percentage, and returns both the earnings and fee components.

### The SubtractFees Algorithm

The `SubtractFees` method implements the primary earnings calculation by converting the input to a decimal coin, applying the take rate, and truncating the result:

```go
func (k Keeper) SubtractFees(ctx sdk.Context, amt sdk.Coin) (sdk.Coin, sdk.Coin, error) {
    // 1️⃣ Convert the incoming amount to a decimal coin.
    topline := sdk.NewDecCoinFromCoin(amt)

    // 2️⃣ Find the applicable take rate (percentage) for the coin’s denom.
    rate := k.findRate(ctx, topline.GetDenom())

    // 3️⃣ Compute the fee amount: amount × rate.
    //    `rate` is a decimal representing *percent* (e.g. 0.02 for 2%).
    fees := topline.Amount.Mul(rate).TruncateInt()

    // 4️⃣ Subtract the fee from the original amount → provider earnings.
    earnings := amt.SubAmount(fees)

    // 5️⃣ Return (earnings, fee, nil)
    return earnings, sdk.NewCoin(amt.GetDenom(), fees), nil
}

```

The method returns three values: the provider's earnings (after fee deduction), the fee amount itself as a `sdk.Coin`, and an error if the calculation fails.

### Rate Lookup via findRate

The `findRate` method determines which percentage to apply by checking for per-denomination overrides before falling back to the default:

```go
func (k Keeper) findRate(ctx sdk.Context, denom string) sdkmath.LegacyDec {
    params := k.GetParams(ctx)               // default + per-denom rates
    rate := params.DefaultTakeRate           // default (e.g. 2%)

    for _, dr := range params.DenomTakeRates { // check overrides
        if denom == dr.Denom {
            rate = dr.Rate
            break
        }
    }
    // Convert the integer percentage (e.g. 2) to a decimal (0.02)
    return sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(uint64(rate))).Quo(sdkmath.LegacyNewDec(100))
}

```

This design allows the network to charge different commission rates for different tokens (e.g., 1% for `uakt` but 2% for others).

### Integration with the Escrow Module

The **escrow** module demonstrates real-world usage in [`x/escrow/keeper/keeper.go`](https://github.com/akash-network/node/blob/main/x/escrow/keeper/keeper.go) (lines 962-974). When withdrawing lease payments, it delegates the fee calculation to the take keeper rather than reimplementing the logic:

```go
earnings, fee, err := k.tkeeper.SubtractFees(ctx, rawEarnings)
if !earnings.IsZero() {
    // send earnings to the provider’s account
    k.bkeeper.SendCoinsFromModuleToAccount(ctx, module.ModuleName, owner, sdk.NewCoins(earnings))
}

```

After calling `SubtractFees`, the escrow keeper transfers the earnings to the provider and handles the fee separately (typically sending it to the distribution module).

## Configuring Take Rates Through Governance

Network parameters are updatable via governance using `MsgUpdateParams`. Only the governance module account has authority to modify rates:

```go
msg := &taketypes.MsgUpdateParams{
    Authority: govModuleAccount,                     // gov module’s authority
    Params: taketypes.Params{
        DefaultTakeRate: 3,                         // 3%
        DenomTakeRates: []taketypes.DenomRate{{ // 1% for "uakt"
            Denom: "uakt",
            Rate:  1,
        }},
    },
}
handler := taketypes.NewMsgServerImpl(takeKeeper)
_, err := handler.UpdateParams(sdk.WrapSDKContext(ctx), msg)

```

## Key Implementation Files

| File | Role |
|------|------|
| [`x/take/keeper/keeper.go`](https://github.com/akash-network/node/blob/main/x/take/keeper/keeper.go) | Core keeper implementation containing `SubtractFees` and `findRate` methods. |
| [`x/take/module.go`](https://github.com/akash-network/node/blob/main/x/take/module.go) | Module wiring that registers the keeper, MsgServer, and QueryServer. |
| [`x/escrow/keeper/keeper.go`](https://github.com/akash-network/node/blob/main/x/escrow/keeper/keeper.go) | Consumer example showing integration at lines 962-974. |
| [`upgrades/software/v1.0.0/upgrade.go`](https://github.com/akash-network/node/blob/main/upgrades/software/v1.0.0/upgrade.go) | Migration logic for moving take parameters to the self-managed param subspace. |

## Summary

- The **take module** acts as a centralized commission calculator for the Akash Network, not a balance store.
- **Provider earnings** are calculated in `SubtractFees` by multiplying the payment by the take rate and subtracting the result from the original amount.
- Rates are configurable per-denomination via `DenomTakeRates`, with a global default fallback.
- The **escrow** module and other consumers call `tkeeper.SubtractFees()` to ensure consistent fee application across the network.
- All parameter changes require governance authorization through `MsgUpdateParams`.

## Frequently Asked Questions

### What is the purpose of the take module in Akash Network?

The take module serves as Akash's commission system that calculates fees on provider earnings. It stores configurable take rates and provides the `SubtractFees` method that splits payments into provider earnings and network fees, ensuring a single source of truth for commission calculations across the protocol.

### How does the take module determine which fee rate to apply?

The module uses the `findRate` method to check for per-denomination overrides in `DenomTakeRates` before falling back to the `DefaultTakeRate`. The rate is stored as an integer percentage (e.g., 2 for 2%) and converted to a decimal (0.02) for calculations.

### Can take rates be different for different tokens on Akash?

Yes. The module supports per-denomination rates through the `DenomTakeRates` parameter array. For example, the network can charge 1% for `uakt` while maintaining a 3% default rate for all other denominations.

### Which modules use the take module to calculate provider earnings?

The **escrow** module is the primary consumer, calling `SubtractFees` in [`x/escrow/keeper/keeper.go`](https://github.com/akash-network/node/blob/main/x/escrow/keeper/keeper.go) when processing lease payment withdrawals. Any custom module that needs to apply commission fees can integrate with the take keeper's `SubtractFees` method rather than implementing its own calculation logic.