> For the complete documentation index, see [llms.txt](https://docs.piku.co/piku/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.piku.co/piku/piku-finance/vaults/morini-stockmarkettrbasistrade-vault/mint-and-redeem-stockmarkettrbasistrade-at-the-contract-level.md).

# Mint and Redeem StockMarketTRBasisTrade at the Contract Level

The vault uses USDC as its base asset. Minting is handled through the vault token contract by a permissioned actor, while redemptions are executed through the dedicated Redemption Vault contract.

When interacting directly with the contracts, make sure to use the correct proxy interface where applicable. Minting should be executed through the vault token contract by a permissioned actor, while redemptions should be executed through the Redemption Vault contract.

#### Pricing

For the Morini StockMarketTRBasisTrade Vault, pricing is provided through a custom oracle feed.

Oracle Contract: <mark style="color:$primary;">`0x1c7bEc0281080C0A4f85e55151191aF27EC69940`</mark>

Function: <mark style="color:$danger;">`latestRoundData`</mark>

The vault price is read from the <mark style="color:$danger;">`answer`</mark> value returned by <mark style="color:$danger;">`latestRoundData`</mark>.

Decimals: <mark style="color:$danger;">`8`</mark>

To interpret the price correctly, divide the <mark style="color:$danger;">`answer`</mark> value by <mark style="color:$danger;">`1e8`</mark>.

Example:

<mark style="color:$danger;">`price = answer / 1e8`</mark>

This oracle price is used as the reference vault share price for minting, redemption, and reporting flows.

#### Minting / Subscription

For the Morini StockMarketTRBasisTrade Vault, minting is executed through the vault token contract using the <mark style="color:$danger;">`mint`</mark> function under **Write as Proxy**.

Vault Token Contract: <mark style="color:$primary;">`0x827Ce7E8e35861D9Ac7fE002755767b695A5594a`</mark>

Function: <mark style="color:$danger;">`mint (0x40c10f19)`</mark>

The <mark style="color:$danger;">`mint`</mark> function mints the specified amount of mToken shares to a given address. This function should only be called by a permissioned actor.

Parameters:

<mark style="color:$danger;">`to (address)`</mark> – Address that will receive the minted vault tokens

<mark style="color:$danger;">`amount (uint256)`</mark> – Amount of vault tokens to mint

Before minting, the permissioned actor should verify:

* The receiver address is correct.
* The mint amount is correct.
* The corresponding subscription or deposit has been properly processed.
* The transaction is being executed through the correct proxy contract.
* The caller has the required permission to mint.

This function may revert if the caller is not permissioned or if the minting transaction does not satisfy the contract’s requirements.

#### Redemption Request

For the Morini StockMarketTRBasisTrade Vault, delayed redemptions are executed through the Redemption Vault contract using the <mark style="color:$danger;">`redeemRequest`</mark> function under **Write as Proxy**.

Redemption Vault Contract: <mark style="color:$primary;">`0x85A7A5FFf71EaEF79e76730F2E717A04aADea27B`</mark>

Function: <mark style="color:$danger;">`redeemRequest (0x15571a04)`</mark>

The <mark style="color:$danger;">`redeemRequest`</mark> function creates a redemption request and allows specifying a custom recipient address for the redeemed tokens.

Parameters:

<mark style="color:$danger;">`tokenOut (address)`</mark> – Stablecoin token address to redeem to

<mark style="color:$danger;">`amountMTokenIn (uint256)`</mark> – Amount of mToken to redeem, using 18 decimals

<mark style="color:$danger;">`recipient (address)`</mark> – Address that will receive the redeemed tokens

Redemption requests are processed according to the vault’s settlement rules. For StockMarketTRBasisTrade, redemptions are processed every 2 days on Turkish business days with T+2 settlement at the fund level, subject to local public holidays.

Before creating a redemption request, users should verify:

* The `tokenOut` address is correct.
* The amount of mToken being redeemed is correct.
* The recipient address is correct.
* The applicable settlement timing has been reviewed.
* The transaction is being executed through the correct Redemption Vault contract.

#### Instant Redemption

If available and within the applicable limits, users may also redeem through the <mark style="color:$danger;">`redeemInstant`</mark> function under **Write as Proxy**.

Redemption Vault Contract: <mark style="color:$primary;">`0x85A7A5FFf71EaEF79e76730F2E717A04aADea27B`</mark>

Function: <mark style="color:$danger;">`redeemInstant (0x8b53f75e)`</mark>

The <mark style="color:$danger;">`redeemInstant`</mark> function redeems mToken into the selected <mark style="color:$danger;">`tokenOut`</mark> if the daily limit and allowance are not exceeded. It burns mToken from the user, transfers the applicable fee in mToken to the fee receiver, and transfers the selected output token to the user.

Parameters:

<mark style="color:$danger;">`tokenOut (address)`</mark> – Stablecoin token address to redeem to

<mark style="color:$danger;">`amountMTokenIn (uint256)`</mark> – Amount of mToken to redeem, using 18 decimals

<mark style="color:$danger;">`minReceiveAmount (uint256)`</mark> – Minimum expected amount of <mark style="color:$danger;">`tokenOut`</mark> to receive, using 18 decimals

Before using instant redemption, users should verify:

* The <mark style="color:$danger;">`tokenOut`</mark> address is correct.
* The mToken amount is correct.
* The minimum receive amount is set correctly for slippage protection.
* The transaction is within the daily instant redemption limit.
* The user has sufficient mToken balance and allowance.
