Coinswap Exchange: A Comprehensive Guide to Token Swaps on IRISHub

ยท

Introduction

Coinswap is an innovative token exchange protocol implemented on IRISHub, enabling seamless token-to-IRIS and token-to-token conversions through automated on-chain processes. Built upon the Constant Product Market Maker Model, this decentralized exchange mechanism revolutionizes asset management within the IRISHub ecosystem.

Key Concepts Explained

Liquidity Pool Mechanics

The liquidity pool operates as a self-governing system account containing three core components:

Each token (excluding IRIS) maintains its own dedicated pool to facilitate accurate price calculations.

Understanding Market Dynamics

The protocol employs the constant product formula: x * y = k, where:

๐Ÿ‘‰ Discover how liquidity pools create trading opportunities

Core Operations Breakdown

1. Adding Liquidity

Market makers contribute to pool stability while earning transaction fees:

Creating New Liquidity Pools

Expanding Existing Pools

2. Executing Token Swaps

Users can exchange tokens through two primary methods:

Transaction TypeCalculation MethodSuccess Conditions
Buy OrderOutput-based input calculationPayment โ‰ฅ computed value
Sell OrderInput-based output calculationRequest โ‰ค computed value

All transactions incur a 0.3% fee (configurable via governance proposals), including cross-token conversions that route through IRIS intermediary steps.

3. Removing Liquidity

Market makers can:

Implementation Details

The module exclusively offers REST API endpoints for transactions. Developers can explore the Coinswap Exchange reference implementation for practical integration examples.

๐Ÿ‘‰ Learn advanced DeFi strategies for liquidity providers

FAQ Section

How does Coinswap ensure price stability?

The constant product formula and arbitrage mechanisms naturally maintain prices aligned with broader market values without centralized intervention.

What benefits do market makers receive?

Providers earn 0.3% fees from all transactions proportional to their pool share, with flexible withdrawal options and transferable liquidity certificates.

Can I swap between any two tokens directly?

Yes, the protocol supports both direct token-to-IRIS and indirect token-to-token exchanges (with two-step IRIS conversion).

How is the 0.3% fee distributed?

The entire fee gets reinvested into liquidity pools, directly benefiting active market makers.

What happens during high volatility?

The flexible withdrawal system allows market makers to quickly adjust positions, while the mathematical model automatically adjusts exchange rates to reflect current market conditions.