> For the complete documentation index, see [llms.txt](https://liqui.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://liqui.gitbook.io/docs/hedgehog-strategy/procedures/deposit.md).

# Deposit

The `deposit` function takes tokens and returns ownership claims for a certain fraction of the assets held in the strategy.

The flow is next:

1. Pull in tokens (ETH, USDC, and oSQTH) from the sender in a proportion same as the current strategy holdings
2. Poke positions so the vault's current holdings are up to date
3. Calculate shares to mint

$$
shares = \frac{depositorValue}{sharePrice}
$$

where share price calculated as:

$$
sharePrice = \frac{totalValue}{totalSupply}
$$

and Value calculated in ETH terms as:

$$
value = ethAmount + \frac{usdcAmount}{EthUsdcPrice} + osqthAmount\cdot OsqthEthPrice
$$

​4. Check deposit cap

5\. Mint shares to user

#### *Example*

Suppose that Alice would like to deposit 10 ETH and match it with the necesasary amount of USDC and oSQTH.&#x20;

The current strategy holdings are 53.4 ETH, 45681 USDC, and 216.3 oSQTH.

After the Alice's deposit there will be 63.4 ETH, that need to be matched with:

$$
ratio = \frac{EthToDeposit}{EthBalance}=\frac{10}{53.4}=0.1872
$$

$$
UsdcToDeposit=UsdcBalance*ratio=45681*0.1872=8551.5
$$

$$
OsqthToDeposit = OsqthBalance*ratio=216.3*0.1872=40.49
$$

​At the current prices of ETH/USDC 1500 and oSQTH/ETH 0.085, with the total supply of shares = 100, there will be minted:​

$$
depositorValue = 10+8551.5/1500+40.49\cdot 0.085=19.14
\\
totalValue = 63.4 + 45681/1500+216.3\cdot 0.085=112.24
\\
\
\\
shares = totalSupply \cdot \frac{depositorValue}{TotalValue} =100\cdot \frac{19.14}{112.24}=17.053
$$

​To simplify the deposit we introduce a deposit helper, that takes the user's wETH and automatically swaps it to a set of wETH, USDC, and oSQTH targeting the required strategy proportion.
