Native Documentation
  • introduction
    • What is Native
    • About Native V2
    • Benefits for Key Players
  • SOLUTION
    • Native Credit Pool
    • Native Swap Engine
  • CONCEPTS
    • Orderbook
    • Firm Quote Orders
    • Auto Sign Orders
    • Swap Fees
    • Slippage
    • Base and Listed Assets
    • Single-Sided Liquidity Pools
    • Total Available Liquidity
    • Liquidity Pairing
    • Liquidity Bootstrapping
    • Health Ratio
    • Earning Fees and Incentives
    • Credit-Based Swap
      • Collateral Factor
      • PMM Credit
      • Settlement and Liquidation
    • Market-Responsive Pricing
    • Risks
  • USER GUIDE
    • Add Liquidity
    • Pair Liquidity
    • Claim Rewards
    • Swap with Native
  • Build with Native
    • Swap Aggregators
      • Guide
      • FirmQuote Swap APIs
        • GET Orderbook
        • GET Indicative quote
        • GET Firm quote
    • Asset Issuers
      • For Pegged Assets
      • For General Assets
  • Resources
    • Addresses
    • Audits
    • Github
    • System Status
    • Business Source License
    • Media Kit
Powered by GitBook
On this page
  • Onchain Executable Orderbook
  • Credit-Based Swap
  1. SOLUTION

Native Swap Engine

Enabling PMM Pricing and Atomic Swaps with On-Chain Credit Management

PreviousNative Credit PoolNextOrderbook

Last updated 4 months ago

Onchain Executable Orderbook

Native introduces a high-frequency, auto-sign orderbook that seamlessly aligns with prevailing market prices, offering reliable quotes to ensure low latency and a high success rate by utilizing real-time on-chain inventory.

Credit-Based Swap

Example: Credit-Based Swap in User Action

Scenario: Josh, a retail trader, wants to swap 1 ETH for USDC using a Native-powered aggregator/solver. PMM1, a trading house, has pledged 100 USDC as collateral, securing a $100 credit from Native.

Step-by-Step Process:

  • (T-1: Josh entered a swap intent to the aggregator. The aggregator checks the latest price and depth from Native orderbook endpoint)

  • T0: Josh submits a swap intent through the aggregator.

  • T1: Native Swap Engine receives the intent. PMM1 offers a quote of 3600 USDC using the Native Credit Pool as inventory, by leveraging its $100 credit. Even though it doesn’t hold USDC in its wallet.

  • T2: Josh signs and approves the transaction to swap 1 WETH for 3600 USDC.

  • T3:

    • Native Credit Pool pays Josh 3600 USDC and receives 1 WETH.

    • Native records a long 1 WETH and a short 3600 USDC position on PMM1’s credit record.

    • This entire process occurs atomically in a single transaction.

Post-trade: Credit Risk Management

What if Price Moves?

  • If the price of WETH drops to $3598, $2 being cut from PMM credit

  • If the price of WETH stays above $3500, PMM1’s credit covers its position. The 100 USD collateral is used to cover the gap.

  • If the price drops below $3500, the 100 USDC collateral and the 1 WETH would be subject to liquidation.

The above example assumes the for all the assets are set to 100%.

collateral factors
Learn more