> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gains.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# Staker Functions

> https://gains.trade/vault

<Info>
  These functions apply to all gToken vaults. gDAI is used for demonstration.
</Info>

## Deposit

Deposit DAI in exchange for gDAI. See [gToken](/liquidity-farming-pools/gtoken-vaults#gtoken) in overview.

You can deposit at anytime.

<img src="https://mintcdn.com/gains/IoupFIThDEsTzJuI/images/jfjr4Qlq16YKp3Y2mE9j-screen-shot-2022-12-14-at-6.00.24-pm.png?fit=max&auto=format&n=IoupFIThDEsTzJuI&q=85&s=c3c38b9b234f6dc7883aaa7679da0f14" alt="" width="842" height="728" data-path="images/jfjr4Qlq16YKp3Y2mE9j-screen-shot-2022-12-14-at-6.00.24-pm.png" />

## Deposit with discount and lock

Deposit DAI into the vault in exchange for a gNFT, which represents rights to locked gDAI.

Discount percentage is based on the current collateralization ratio of the vault and the duration the staker is willing to lock gDAI for.

You can deposit at anytime.

See [gNFT](/liquidity-farming-pools/gtoken-vaults#gnft) in overview.

Current maximum discount: 5%

Current lock window: \[7d, 365d]

<img src="https://mintcdn.com/gains/IoupFIThDEsTzJuI/images/iGAYl3taDAq1r7PZyXTX-screen-shot-2022-12-14-at-6.01.21-pm.png?fit=max&auto=format&n=IoupFIThDEsTzJuI&q=85&s=f3c2ddf5dd7756045289f5f3742a7d85" alt="" width="842" height="898" data-path="images/iGAYl3taDAq1r7PZyXTX-screen-shot-2022-12-14-at-6.01.21-pm.png" />

## Unlock

gNFT holders are able to claim gDAI anytime after the unlock date by unlocking through the UI. This function burns the NFT and transfers gDAI to owner's wallet.

<img src="https://mintcdn.com/gains/IoupFIThDEsTzJuI/images/2MVVOGEcVev1I40ADDf2-screen-shot-2022-12-14-at-6.10.08-pm.png?fit=max&auto=format&n=IoupFIThDEsTzJuI&q=85&s=71cbac4c7fc17e165d2f885fcbcebf09" alt="" width="1724" height="372" data-path="images/2MVVOGEcVev1I40ADDf2-screen-shot-2022-12-14-at-6.10.08-pm.png" />

## Withdraw Request

Make a withdraw request for any amount of unlocked gDAI.

This can only be done during the withdraw window of an epoch.

See [Withdraw locks](/liquidity-farming-pools/gtoken-vaults#withdraw-locks) in overview.

<img src="https://mintcdn.com/gains/IoupFIThDEsTzJuI/images/AX9fRlFZCeNv1LrXaegY-screen-shot-2022-12-14-at-6.33.01-pm.png?fit=max&auto=format&n=IoupFIThDEsTzJuI&q=85&s=3453a467c41fd91384ecefc4456645a9" alt="" width="852" height="606" data-path="images/AX9fRlFZCeNv1LrXaegY-screen-shot-2022-12-14-at-6.33.01-pm.png" />

## Withdraw

When a withdraw request's epoch is the active epoch, the requested amount may be redeemed. If the epoch window is missed, the request becomes invalid and a new request must be made.

This can only be done during the withdraw window of an epoch.

See [Withdraw locks](/liquidity-farming-pools/gtoken-vaults#withdraw-locks) in overview.

<img src="https://mintcdn.com/gains/IoupFIThDEsTzJuI/images/WPCV0jW7n3nzSVJpsbav-screen-shot-2022-12-14-at-6.34.05-pm.png?fit=max&auto=format&n=IoupFIThDEsTzJuI&q=85&s=2cd138a3b54602d8dbe53eccac178c96" alt="" width="834" height="258" data-path="images/WPCV0jW7n3nzSVJpsbav-screen-shot-2022-12-14-at-6.34.05-pm.png" />
