LogoLogo
Website
  • πŸ‘‹Welcome to Velar
  • Overview
    • πŸ’‘Introduction
    • πŸ›£οΈRoadmap
    • ✨Architecture
  • Getting Started
    • πŸ’»How to Use Velar Products
    • 🌊Providing Liquidity
    • 🚜Yield Farming
    • πŸ”Staking $VELAR Tokens
    • 🧩Building Integrations
    • 🀹Giving Feedback
    • πŸ‘‹Joining Community Channels
  • Velar PerpDex
    • πŸŽ›οΈCore Concepts
    • 🟧Stacks
    • πŸŸ₯Mezo (Coming Soon)
  • Velar Versions
    • ☸️Velar Dharma
      • Automated Market Maker (AMM)
      • Liquidity Pools & Yield Farming
      • IDO Launchpad
      • Bridge
      • MemeStacker
    • πŸ’‘Velar Artha
      • πŸ“ŠPerpetual Swaps
      • 🚿Concentrated Liquidity
      • πŸŒ‰Cross-Chain Bridge
    • πŸ›£οΈVelar Kama
    • ✨Velar Moksha
  • Audits
    • πŸ’‘Introduction
    • πŸ›£οΈAMM Audit on Clarity
    • 🚊PerpDex Audit on Clarity
    • πŸš‰PerpDex Audit on EVM
  • Token
    • πŸ’‘Introduction
    • πŸŽ›οΈTokenomics
    • πŸ“’Vesting Contracts
    • πŸͺœEmission
  • Developers
    • πŸ”¨Contract Addresses
    • πŸ”©Velar SDK
      • Velar SDK 0.7.0-beta [Latest]
      • Velar SDK 0.6.9
    • πŸ”¬Velar API
    • πŸ”₯Velar Verified Burner Contract
    • Velar Assets
  • Velar Executive Leadership
    • ♣️CEO - Mithil Thakore
    • ♠️CMO - Peter Watson
Powered by GitBook
On this page
  • Connecting Your Wallet
  • Providing Liquidity
  • Collateral Structure
  • Leverage Limitations
  • Opening a Position
  • Managing Positions
  • Borrowing Fees
  • Closing a Position
  • Liquidation Process
  • Security and Technical Details

Was this helpful?

  1. Velar PerpDex

Stacks

PreviousCore ConceptsNextMezo (Coming Soon)

Last updated 1 day ago

Was this helpful?

Velar PerpDex on Stacks enables decentralized perpetual trading without requiring account creation. The platform uses Pyth Network oracles to provide reliable price feeds that reduce the risk of unfair liquidations from temporary price wicks.

Connecting Your Wallet

To start trading on Velar PerpDex, you'll need a Stacks-compatible wallet.

Head to and after you have a wallet set up, connect it by clicking the "Connect Wallet" button on the trading interface. Ensure your wallet is configured for the Stacks network.

Providing Liquidity

Velar PerpDex allows users to provide liquidity to the sBTC/USDh trading pool and earn rewards.

How to Provide Liquidity

  1. Navigate to the "" tab on the Velar PerpDex interface

  2. Select the "Add Liquidity" option

  3. Choose your liquidity contribution method:

    • Single-sided liquidity: Provide either sBTC or USDh only

    • Two-sided liquidity: Provide both sBTC and USDh in a balanced ratio

  4. Enter the amount you wish to contribute

  5. Review the transaction details and confirm

When you provide liquidity, you'll receive LP tokens representing your share of the pool. These tokens track your portion of the total liquidity and can be staked for additional rewards.

Managing Your Liquidity

You can monitor your provided liquidity in the "Pool" section, which displays:

  • Your current liquidity position

  • The market price of sBTC/USDh

  • Pool details including reserves and collateral

Removing Liquidity

To withdraw your liquidity:

  1. Navigate to the "Liquidity" tab

  2. Select "Remove Liquidity"

  3. Specify the amount of LP tokens to redeem

  4. Confirm the transaction

Important: The maximum removable liquidity is limited by current open positions. You cannot withdraw more than the available reserves (Total Supply - (sBTC reserves + USDh reserves). The interface displays your "Max removable liquidity" to help you understand these constraints. P.S: sBTC reserves & USDh reserves refers to the amount locked for existing positions.

When you remove liquidity, you'll receive both assets (sBTC and USDh) regardless of whether you initially provided single-sided or dual-sided liquidity.

Earning Rewards

As a liquidity provider, you can earn multiple revenue streams:

  • Trading Fees: 75% of platform trading fees are distributed to liquidity providers

  • Funding Payments: Earn when providing liquidity against overbalanced positions

Liquidity Provider Risks

Providing liquidity involves certain risks:

  • Impermanent Loss: Price fluctuations between paired assets can lead to opportunity cost

  • Smart Contract Risk: Always research platform security and audits

  • Market Exposure: LP positions have exposure to both sides of the market

  • Locked Liquidity: During high volatility or heavy directional trading, portions of your liquidity may be temporarily locked

Monitor your liquidity positions regularly and adjust your strategy based on market conditions.

Collateral Structure

Velar PerpDex on Stacks implements a dual-collateral system where liquidity providers (LPs) take the opposite side of trades:

Long positions require USDh as collateral. USDh provides a stable value reference point, minimizes volatility in margin calculations, creates predictable liquidation thresholds, and aligns with the quote currency of most trading pairs.

Short positions require sBTC as collateral. Using sBTC for shorts offers several advantages, including a natural hedge against Bitcoin price movements, reduced protocol exposure to directional risk, more efficient margin utilization, and enhanced protocol solvency protection.

This structure is fundamental to how the DEX operates, allowing liquidity providers to effectively balance market exposure and manage risk.

Leverage Limitations

Velar PerpDex on Stacks currently supports leverage up to 5x. This means traders can amplify their exposure by up to five times their collateral value. Higher leverage increases both potential profits and risks.

To calculate the required initial margin:

  • 5x leverage requires 20% of position size as collateral

  • 4x leverage requires 25% of position size as collateral

  • 3x leverage requires 33.3% of position size as collateral

  • 2x leverage requires 50% of position size as collateral

Opening a Position

To open a position on Velar PerpDex:

  1. Select either "Long" or "Short" based on your market outlook

    • Long positions profit when the asset price increases

    • Short positions profit when the asset price decreases

  2. Enter the amount of collateral you wish to commit

    • For long positions, deposit USDh

    • For short positions, deposit sBTC

  3. Select your desired leverage (up to 5x)

  4. Review the position details, including:

    • Liquidation price

    • Position size

    • Fees

    • Expected funding rate

  5. Confirm the transaction through your connected wallet

The trading fee to open a position is 0.1% of the position size. No fee is applied when closing the position.

Managing Positions

After opening a position, you can monitor and manage it through the Positions tab in the interface.

You can deposit additional collateral to decrease your leverage and improve your liquidation price. This provides a safer buffer against adverse price movements.

Alternatively, you can withdraw excess collateral if your position has moved in your favor, though this will increase your risk of liquidation.

Borrowing Fees

Velar PerpDex charges a borrowing fee of 1.728% per day on open positions. This fee is calculated as:

  • 3000/10^9 borrow fees per block

  • With approx. 4 blocks per minute on Stacks

  • Resulting in fees * 4 * 60 * 24 per day

These fees are automatically deducted from your collateral with every new block. Monitor your position's health to ensure fees don't push you toward liquidation.

Closing a Position

You can close a position partially or completely by clicking the "Close" button in the position management interface.

For long positions, profits are paid in USDh. For short positions, profits are paid in sBTC.

There's no fee for closing a position.

Liquidation Process

Liquidation occurs when a position's margin falls below the maintenance requirement. On Velar PerpDex, a position is liquidated when:

(Collateral - Fees) ≀ Collateral * Leverage * Liquidation Threshold

(Collateral - Fees) + PnL ≀ Collateral * Leverage * Liquidation Threshold

Fees = Borrow fee + Funding fee paid

Liquidation Threshold: Currently set at 1%

When liquidation is triggered:

  1. The position is automatically closed

  2. A liquidation fee of 50% of the remaining collateral is charged

  3. All remaining collateral after deducting fees is returned to your wallet

To avoid liquidation, continue to monitor your position's remaining collateral and net value. Important: Funding fees received are not counted in remaining collateral calculations and won't impact liquidation price or margin requirements.

Security and Technical Details

Oracle Implementation

Velar PerpDex on Stacks uses Pyth Network as its primary oracle provider. The specific Pyth Oracle Feed ID for BTC/USD is:

This oracle integration ensures reliable price data for all trading operations, including position opening/closing, PnL calculation, funding rates, and liquidation triggers.

Security Measures

Velar prioritizes security with several key measures:

  • Smart Contract Audit: Conducted by Thesis Defense in July 2024, addressing critical issues and optimizing gas usage

  • Clarity Contracts: Written specifically for Stacks compatibility, leveraging Bitcoin's security

  • Robust Oracle System: Multiple price feeds reduce the risk of liquidations from temporary price wicks

  • Bitcoin Finality: Trades ultimately settle with Bitcoin's security via Stacks' anchoring mechanism

Architecture

Velar PerpDex uses an Automated Market Maker (AMM) model where:

  • Traders interact with liquidity pools rather than directly with other traders

  • Liquidity providers deposit collateral (sBTC or USDh) to earn fees and funding payments

  • All trades execute against the protocol's liquidity at oracle-derived prices

This design eliminates concerns about slippage and order book depth common to traditional exchanges.

The specific Feed ID for STX/USD is:

🟧
perpdex.velar.com
Pool
0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a315b43
0xec7a775f46379b5e943c3526b1c8d54cd49749176b0b98e02dde68d1bd335c17