VimenDocs
Guides

Minting in-kind

Deposit the constituents yourself and mint the basket directly.

In-kind minting is the protocol's native path: you deposit the exact constituent amounts and the contract mints basket tokens against them. No DEX, no price, no slippage: it works identically whether pools are deep, thin, or nonexistent.

In the app

Enter an amount

On a basket page, switch the mint widget to in-kind and enter how many basket tokens you want. The app calls getRequiredUnits(amount) and shows the exact deposit per constituent next to your balances, with shortfalls highlighted (and a link to acquire the missing tokens).

Approve each constituent

Each constituent needs an ERC-20 approval to the basket contract. The app walks a progress stepper through them, skipping any with sufficient existing allowance, and resumes cleanly if you stop halfway.

Mint

One mint(amount, to) transaction pulls all constituents and mints the basket. The fee (0.30%) is taken in basket tokens: you receive amount − fee, the fee recipient receives fee, and every token in existence stays fully backed.

From a contract or script

IBasketToken basket = IBasketToken(0xe1c1ADAD813736427B334e798fd2EbC7d2C7A9DF); // MAG7

(address[] memory tokens, uint256[] memory amounts) =
    basket.getRequiredUnits(1e18); // deposits for 1.0 MAG7

for (uint256 i; i < tokens.length; i++) {
    IERC20(tokens[i]).approve(address(basket), amounts[i]);
}
basket.mint(1e18, msg.sender);

Notes for integrators:

  • getRequiredUnits rounds up (protocol-favoring) and mint pulls exactly those amounts, so approvals return to zero by construction.
  • The contract verifies actual balance deltas: fee-on-transfer or otherwise non-standard tokens make the mint revert rather than under-collateralize.
  • Mint reverts if minting is paused or the supply cap would be exceeded (MintingPaused, SupplyCapExceeded). Redeem is never gated.
  • Rounding cost is bounded: at most 1 wei per constituent per operation, and the dust favors the vault. A full mint→redeem roundtrip costs you at most nConstituents wei, economically nil at 18 decimals.

Full API: BasketToken reference.

On this page