VLIQUID Specifications
Overview
The Valis Liquidity (VLIQUID) Smart Contract allows for the creation of liquidity pools with up to 5 different tokens. Each token is assigned a different weight, representing its proportion of the total pool value. These are public pools that anyone can add liquidity to.
The creator of the VLIQUID pool should decide the pool parameters (like token weights and fees) when creating the pool. Once the pool is created, the pool parameters remain fixed.
Liquidity providers can either join an existing shared pool that matches their desired configuration or create a new pool with their desired configuration.
Bonding Curve
Bonding Curve Description
A bonding curve is a mathematical concept used to determine the price of an asset based on its supply and demand. The curve itself is typically represented as a continuous, monotonic function where the price increases as the supply of the token increases.
Bonding Curve Benefits
Bonding curves play a crucial role in decentralized finance (DeFi) by providing:
- Predictability: The price changes in a predictable manner based on the formula, providing transparency for investors and users.
- Incentivization: Early participants are rewarded with lower prices, encouraging initial adoption and investment.
- Decentralization: Bonding curves enable decentralized pricing mechanisms without the need for intermediaries.
VLIQUID Bonding Curve
VLIQUID bonding curve formula is defined as follows:
$P(A/B) = \frac{R(A)/W(A)}{R(B)/W(B)}$
- $P(A/B)$ is the price of token A in terms of token B.
- $R(A)$ and $R(B)$ are the reserves of tokens A and B in the pool.
- $W(A)$ and $W(B)$ are the weights of tokens A and B.
Contributing Tokens to a Valis Liquidity Pool
This section refers to the process by which users add their tokens to a liquidity pool. By contributing tokens, users become liquidity providers and earn a share of the fees generated by trades within that pool. There are two main ways to contribute tokens: Single-Asset Deposit and Multi-Asset Deposit.
Single-Asset Deposit
- Description: This option allows users to deposit just one type of token into the liquidity pool.
- Mechanism: When a user deposits a single token, VLIQUID will automatically trade that token for the other types of tokens needed to balance the pool according to its predefined weights.
- Example: Suppose a liquidity pool requires 50% Token A and 50% Token B. If a user deposits only Token A, VLIQUID will automatically trade a portion of Token A for Token B to maintain the 50/50 balance.
- Fees: This process incurs a swap fee because the platform needs to execute trades to rebalance the pool.
Multi-Asset Deposit
- Description: This option allows users to deposit all types of tokens required by the pool in the correct proportions.
- Mechanism: The user must deposit each token according to the pool's weight requirements.
- Example: If a pool requires 50% Token A and 50% Token B, the user must deposit both tokens in that exact ratio.
- Benefits: By depositing the tokens in the required proportions, users avoid swap fees since no additional trades are necessary to balance the pool.
Objectives
This section break down the smart contract objectives into clear concepts and provides examples for each objective. This way, the VLIQUID platform's goals become more accessible and understandable to a broader audience, both technical and non-technical, ensuring everyone can participate and benefit from Valis Liquidity Pools.
The VLIQUID smart contract aims to achieve several key objectives to enhance the user experience and functionality of liquidity pools.
1. Create Liquidity Pools
Goal
- Allow users to earn fees by participating in Valis Liquidity Pools.
Key Concepts
- Liquidity Pools: These are collections of tokens provided by users, which facilitate trading on the platform. By contributing tokens, users provide the liquidity needed for trades to occur.
- Earning Fees: When trades happen within the pool, a small fee is collected. This fee is distributed among all the liquidity providers based on their contribution to the pool.
Example
- If you add tokens to a Valis Liquidity Pool, you will earn a portion of the fees collected from every trade that happens in that pool, proportional to your contribution.
2. Distribute Pool Tokens (VPTs)
Goal
- Distribute VPTs (Valis Pool Tokens) to liquidity providers based on their contributions.
Key Concepts
- Valis Pool Tokens: VPTs represents the ownership share of a pool. VPTs are just an internal number in the SC state, not a normal Qubic-based token.
- First Liquidity Provider: The initial provider to a new pool receives VPTs equal to the total value of their initial deposit, set at 1000 VPTs. A new liquidity pool will be created with at least 10% (Weight) of the QWALLET Token. If there is no 10% (Weight) of the QWALLET Token, the new pools will not be created.
- Additional Providers: As more users (liquidity providers) add tokens, they receive VPTs based on the current value of the pool and the number of VPTs already issued. This ensures everyone's share remains proportional to their contribution.
Example
- If you are the first to add tokens to a new pool, you receive a set number of QPTs. When others add tokens later, they receive QPTs calculated based on the pool’s total value and the existing QPTs.
Formula
$$
ProviderVPTs = \frac{Total\_VPT\_supply \times Value\_of\_deposited\_tokens}{Total\_value\_of\_pool}
$$
3. Earn a Share of Trading Fees
Goal
- Enable users to automatically earn a share of the trading fees generated by the pool.
Key Concepts
- Provider's Share: Calculate how much of the total pool each provider owns.
- Total Fees Earned: The pool charges a fee for every trade, which is then immediately distributed among all liquidity providers.
- Provider's Share of Fees: Providers earn a portion of the fees based on their share of the pool.
- Automatic earnings: The fees are earned without any claim process as the balances backing the liquidity pool (LP) are increased after each swap. If the pool fee is set to 0.5%, then a swap will convert 99.5% and keep the remaining 0.5% in the pool. This way, without any additional transaction, all pool owners gain their proportional share of the 0.5%.
Example
- After adding tokens to a pool, you earn a part of the fees collected from every trade. The amount you earn depends on the proportion of the pool’s QPTs you hold.
Formula
$$
ProviderShare = \frac{ProviderVPTs}{Total\_VPT\_Supply\_of\_Pool}
$$
$$
ProviderReward = swapFee[poolAddress] \times ProviderShare[poolAddress]
$$
4. Ensure Efficient and Cost-Effective Transfers
Goal
- Facilitate efficient token transfers within the pool.
Key concepts
- Cost Efficiency: The platform ensures that tokens are transferred and traded in a way that minimizes costs for users.
- Transfer Efficiency: Transfers are handled swiftly to maintain smooth operation of the liquidity pool.
Example
- The Valis Liquidity smart contract ensures that when tokens are exchanged in the pool, it happens quickly and with minimal transaction costs.
5. Support Fractional Share Ownership
Goal
- Enable fractional ownership of high-value tokens.
Key Concepts
- High-Value Tokens: Tokens that are very valuable can be split into smaller, more manageable units.
- Fractional Ownership: Users can own small fractions of these high-value tokens, making it easier to participate in the pool.
Example
- A high-value token can be divided into one million smaller tokens. This allows users to own and trade fractions of high-value tokens within the pool.
Mechanism
- One high-value token is equivalent to 1 million smaller tokens. The pool deals with these smaller tokens instead of the high-value token.
6. Promote Staking with Incentives
Goal
- Encourage users to stake tokens by offering additional rewards.
Key Concepts
- Staking Pool: Users can lock their tokens in a staking pool to earn bonus tokens as rewards.
- Incentives: The reward provider sets up the pool with specific parameters, including the bonus tokens and duration for staking. If twice the amount is staked, the rewards are halved for each staker.
- Rewards Calculation: Rewards are distributed based on the total amount staked by all participants.
Example
- By staking your tokens in a staking pool, you earn additional rewards, such as bonus tokens, based on the amount of tokens you staked and the total staked by all participants.
Formula
$$
Reward = \frac{TotalBonusToken \times AmountOfStaked[providerAddress]}{TotalAmountOfStaked}
$$
Internal Commands and Functions
Private Variables
Procedures
Functions
← Previous
Specifications
Next →
Tokens
On this Page