Deposit Fees

Overview

StakeKit enables partners to monetize Staking and DeFi yields through both performance commissions and Deposit Fees—flat fees applied to user deposits.

For EVM chains, StakeKit leverages FeeWrapper smart contracts. These contracts wrap the deposit process, automatically deducting a configurable fee from the user’s deposit, transferring it to the designated recipient, and depositing the remaining amount into the target DeFi protocol or staking pool. This is executed as a single, bundled transaction for seamless and efficient user interaction.

For non-EVM chains, such as Solana, Cosmos, Ton, and Cardano, StakeKit employs atomic fee transfer mechanisms by appending custom transaction instructions to the staking process. These instructions ensure fees are deducted and transferred to the recipient as part of the same transaction, maintaining consistency and ease of use while supporting smooth fee collection for partners.

Solana

📘

Deposit fee transaction as an additional program instruction

On Solana, staking begins by creating a dedicated Stake Account with the funds that will be allocated to a specific validator. Before the stake is assigned, a percentage of the deposit is transferred to a designated fee address via an instruction included in the same transaction as the Stake Account creation and delegation instructions. This process is atomic, ensuring that the fee deduction and staking occur simultaneously without any risk of inconsistency.

Example:

tx.add(
  SystemProgram.transfer({
    toPubkey: new PublicKey(feeRecipient),
    fromPubkey: walletPubKey,
    lamports: fee.toNumber(),
  })
);

Cosmos

📘

Deposit fee transaction as an additional proto message

On Cosmos, staking begins by delegating tokens to a chosen validator. At the same time the delegation occurs, a portion of the staked amount is sent to a designated fee address. This is achieved by including a MsgSend in the same transaction as the MsgDelegate, ensuring that both the fee transfer and staking happen in one atomic operation. This guarantees that the delegation and fee deduction are processed together, maintaining consistency and reducing the complexity of multiple transactions.

Example:

msgs.push({
    typeUrl: '/cosmos.bank.v1beta1.MsgSend',
    value: {
        fromAddress: address,
        toAddress: feeRecipient,
        amount: [{
            amount: fee.toString(),
            denom: 'uatom',
        }],
    },
} as MsgSendEncodeObject);

Ton

📘

Deposit fee transaction as an additional cell

On TON, staking involves sending tokens to a validator by creating a message with a certain body that initiates the stake. A portion of the staked amount is transferred to a fee address by bundling an additional message within the same transaction. Since TON allows up to four messages in a single transaction, the fee transfer can be included seamlessly alongside the staking message. This ensures that both the staking and fee deduction happen atomically, streamlining the process and avoiding the need for separate transactions.

Cardano

📘

Deposit fee bundled into the delegate transaction

On Cardano, the process of staking involves delegating ADA to a selected stake pool via a Delegation Certificate. To facilitate fee collection, a portion of the ADA can also be allocated to a fee address by adding a Transaction Output in the same transaction. Cardano's capability to include multiple outputs allows both the delegation and the fee transfer to be conducted at once. This design ensures that the fee deduction and staking are processed together, enhancing efficiency and minimizing the need for additional transactions.

Tron

📘

Deposit fee as a separate transaction

On Tron, staking involves freezing TRX and voting for super representatives, but unlike other chains, fee collection here is not atomic. Instead, the fee is deducted through a separate transaction that must be signed and submitted by the user before proceeding with the staking process. This approach introduces a slight deviation in user experience compared to fully atomic operations, as it requires an additional step to complete the fee deduction.

Risks

The non-atomic nature of this setup means there is a slight reduction in user convenience and the potential for incomplete fee collection if the additional transaction is not signed or processed correctly.

EVM

📘

Custom Deposit FeeWrapper Contracts

The FeeWrapper contracts facilitate deposit fee collection for DeFi yield protocols, such as YearnV3, Lido stETH, and Morpho. These contracts act as intermediaries, deducting a configurable percentage as a fee from user deposits and transferring it to a designated recipient. The remaining balance is deposited into the underlying protocol on behalf of the user.

Key Features:

  • Fee Configuration: Partners can define deposit contracts, tokens, fee percentages, and fee recipients.
  • Atomic Execution: Fees are deducted and deposits processed in a single transaction for efficiency.
  • Security: Configurations are managed by an authorized owner, with no custody of user funds.

Audit

The contracts have been audited by Zellic, with the full audit report available at: Zellic Audit Report

Mainnet Deployment

You can find a demo deployment of the fee wrapper contract here: Etherscan