FAQ

Common questions about VinuSwap development and integration.

General

What is VinuSwap?

VinuSwap is a decentralized exchange (DEX) built on VinuChain, based on the Uniswap V3 concentrated liquidity AMM. It enables efficient token swaps and liquidity provision with customizable fee management.

How does VinuSwap differ from Uniswap V3?

VinuSwap extends Uniswap V3 with:

Feature
Uniswap V3
VinuSwap

Fee Manager

None

Per-pool fee managers

Fee Discounts

None

Balance-based tiered discounts

Position Locking

None

Lock positions until specified time

Fee Distribution

Single recipient

Multi-account via Controller

Network

Ethereum/L2s

VinuChain

What fee tiers are available?

VinuSwap supports standard fee tiers:

Fee
Tick Spacing
Use Case

500 (0.05%)

10

Stable pairs

3000 (0.30%)

60

Standard pairs

10000 (1.00%)

200

Exotic pairs

Swapping

Why did my swap fail?

Common reasons:

  1. Insufficient allowance - Approve tokens first

  2. Slippage exceeded - Increase amountOutMinimum

  3. Deadline passed - Transaction took too long

  4. Insufficient liquidity - Pool may lack depth

  5. Price moved - Price changed beyond limit

How do I calculate slippage?

What is sqrtPriceLimitX96?

A price limit for swaps in Q64.96 format. Set to 0 for no limit, or calculate:

How do multi-hop swaps work?

The path encodes token addresses and fees:

Liquidity

How do I choose a price range?

Consider:

  1. Tight range - Higher capital efficiency, more active management

  2. Wide range - Lower efficiency, less maintenance

  3. Around current price - Earns fees, both tokens deployed

  4. Above current price - Single-sided (token1), bet on price increase

  5. Below current price - Single-sided (token0), bet on price decrease

Why is my position out of range?

Price moved outside your tick range. You're earning no fees and holding only one token. Options:

  1. Wait for price to return

  2. Close position and open new one at current price

  3. Add adjacent position to cover current price

How do I calculate my position's value?

Can I add liquidity to an existing position?

Yes, use increaseLiquidity:

What happens when I burn a position?

  1. Liquidity is removed from the pool

  2. Tokens become claimable via collect()

  3. Position NFT remains until all tokens collected

  4. NFT is burned when liquidity and owed tokens are zero

Fees

How do fee discounts work?

VinuSwap's TieredDiscount contract reduces fees based on token holdings:

How do I check my fee discount?

Where do protocol fees go?

Fees flow to the Controller contract, which can split to multiple recipients:

Positions

How do I lock a position?

Can I unlock early?

No, locked positions cannot be unlocked before the specified time. This is by design for vesting or commitment purposes.

Can I still collect fees from locked positions?

Yes, fee collection is always available:

Oracle

How do I get a TWAP price?

What is observation cardinality?

The number of price observations stored. Default is 1 (current only). Increase for longer TWAP periods:

Why is my TWAP query reverting?

  • Cardinality may be too low

  • Pool may not have enough history

  • Check with getOldestObservationSecondsAgo()

Development

How do I run a local development environment?

How do I get the pool init code hash?

How do I verify contracts?

Troubleshooting

"LOK" error

The pool is locked (reentrancy guard). This shouldn't happen in normal usage. Check if you're calling pool functions from within a callback.

"SPL" error

sqrtPriceLimitX96 is invalid. Ensure it's within the valid range for your swap direction.

"TLU" / "TLM" errors

Tick out of bounds. Check your tick values are within MIN_TICK and MAX_TICK.

"AS" error

amountSpecified cannot be zero. Provide a non-zero swap amount.

"IIA" error

Insufficient input amount. The calculated input exceeds amountInMaximum.

Transaction stuck pending

  • Check gas price is sufficient

  • Verify nonce is correct

  • Consider speeding up or canceling

Last updated