# Value Locks

Value Locks are locks that unlock when the value of one asset (primary asset) relative to another asset (comparative asset) either rises above or falls below a price chosen during minting. Both assets are selected by the creator during the minting process, and the creator does not need to own either one of them.

![A Value-Locked FNFT](/files/-MjpFCR6pAaEHGrsOaio)

## Oracles

To prevent "price-hacking" (the manipulation of on-chain pricing information, often through the use of [flash-loans](https://www.youtube.com/watch?v=mCJUhnXQ76s\&feature=emb_title)) Revest utilizes on-chain price-oracles (Oracles) to measure the value of one asset relative to another. Revest currently offers oracles based on [Chainlink Price Feeds](https://data.chain.link/) and a [Uniswap V2 TWAP](https://docs.uniswap.org/protocol/V2/concepts/core-concepts/oracles) (Time-Weighted Average Price). Planning is currently underway to establish a VWAP (Volume-Weighted Average Price) oracle for arbitrary time periods with one of Revest's launch partners. Support for Uniswap v3 is also likely post-launch. \
\
In many cases, oracles will not exist for unusual choices of comparative assets – for this reason, the following are suggested as typical choices for  comparative assets:

* Wrapped Ethereum (WETH) – the ERC-20 variant of Ethereum
* USD – Pegged to the United States Dollar
* USDC – US Dollar Coin, an ERC-20 pegged to the value of USD
* DAI – Another ERC-20 token pegged to the value of USD

### Oracle Updates

Some oracles (namely, the Uniswap v2 TWAP) will require updates on occasion to allow for proper price measurements. These updates will require the user to submit an update request via the **Info** panel, wait for it to process, then submit their withdrawal or unlock request. Should this be the case, the UI will change accordingly.&#x20;

## Unlocking

Value locks, when they become mature, are eligible for either **unlocking** or **withdrawal**. As all transactions on-chain require direct initiation by an individual willing to pay gas for the transaction, **value-locked FNFTs cannot automatically unlock**. Once a value-locked FNFT has become *unlockable,* it is possible for it to once again become fully locked, should its unlock price fall out of the zone in which the FNFT can become *unlocked*.&#x20;

To allow for Value Locked FNFTs (VL-FNFTs) to be unlocked without being withdrawn from, once a VL-FNFT becomes *unlockable*, it can be unlocked from within it's **Info** panel. Unlocking the FNFT will allow it to be withdrawn from at any point in the future, and all other FNFTs that share the lock will also become *unlocked*.&#x20;

## Details on Value Lock Configuration

* Primary Asset: the token to check the price of; can choose common assets from a list, or paste lesser-known ERC-20 assets to import them
* Comparative Asset: the token to check the price of the primary asset in. Often USD or ETH, though more esoteric units are possible, depending on the oracle chosen
* Oracle: The on-chain price oracle to measure the value of the primary asset relative to the comparative asset with. Two options are currently available (though more are planned and the IOracleDispatch module is fully open-source):
  * [Chainlink Price Feeds](https://docs.chain.link/docs/using-chainlink-reference-contracts/): Chainlink is one of the most well-known and well-established oracle providers in DeFi, and offers a wide variety of oracles that are entirely free-to-use.
    * Will only ever require one transaction to withdraw from, recommended when feeds are available (only available for certain pairs)
  * Uniswap v2 TWAP: A time-weighted average price (TWAP) oracle based on trading pairs availabel on the Uniswap v2 DEX. This oracle takes the average of the last two prices it has measured, across whatever window of time that may be.&#x20;
    * Will require at most two transactions to unlock. Recommended for new or esoteric cryptos&#x20;

## Applications for Value Locks

* Vesting with team-incentives (Key Performance Indicators or KPIs)
  * Unlocking of team tokens can be tied to increases in market cap to incentivize performance based on project success rather than passage of time
* Vesting for individual investors
* Price stabilization: value can be automatically locked and unlocked at certain thresholds to apply buy and sell pressure selectively
* Limit-like structures: FNFTs may have their funds routed to an AMM upon withdrawal and converted into units of another currency automatically (see [Directed Output](/advanced-features/directed-output.md) for more info)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.revest.finance/fnft-token-locking/value-locks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
