ShibaSwap v1 is an automated market maker (AMM) protocol built on Ethereum that enables decentralized token trading without intermediaries. It uses a constant product formula to provide liquidity and facilitate peer-to-peer swaps.
ShibaSwap v1 is the original version of the protocol, offering classic AMM functionality with simple liquidity provision and fixed 0.3% trading fees.

How ShibaSwap v1 Works

ShibaSwap v1 is an automated liquidity protocol powered by a constant product formula and implemented in non-upgradeable smart contracts on the Ethereum blockchain. It prioritizes decentralization, censorship resistance, and security by removing the need for trusted intermediaries.

Core Components

Liquidity Pools

Pools containing pairs of ERC-20 tokens that enable trading.

Automated Market Maker

Smart contracts that automatically execute trades using mathematical formulas.

Liquidity Providers

Users who provide tokens to pools and earn trading fees.

Constant Product Formula

The protocol uses the constant product formula: x * y = k Where:
  • x = Reserve of token A
  • y = Reserve of token B
  • k = Constant product (invariant)
This formula ensures that the pool always has liquidity, but larger trades will experience more price impact.
The constant product formula means that as you trade more of one token, you get exponentially less of the other token due to price impact.

Protocol Architecture

Smart Contract Structure

ShibaSwap v1 consists of several key smart contracts:

Liquidity Pool Mechanics

When you provide liquidity to a ShibaSwap v1 pool:
  1. Equal Value Deposit: You deposit equal dollar values of both tokens
  2. LP Tokens: You receive LP (Liquidity Provider) tokens representing your share
  3. Fee Earnings: You earn a portion of all trading fees (0.3% per trade)
  4. Impermanent Loss: Token price changes can affect your position value
LP tokens can be staked for additional BONE rewards on the Woof page (Ethereum only).

Trading Process

How Swaps Work

1

User Initiates Swap

A user wants to trade Token A for Token B.
2

Price Calculation

The smart contract calculates the output amount using the constant product formula.
3

Fee Deduction

A 0.3% fee is deducted from the input amount and distributed to liquidity providers.
4

Token Transfer

Tokens are transferred between the user and the liquidity pool.
5

Reserve Update

The pool reserves are updated to maintain the constant product formula.

Price Impact

Price impact increases with trade size relative to pool liquidity:
  • Small trades: Minimal price impact
  • Large trades: Significant price impact
  • Very large trades: May fail due to slippage protection
Always check the price impact before executing large trades. Consider splitting large trades into smaller ones to minimize impact.

Key Features

Decentralized Trading

  • No intermediaries or centralized exchanges
  • Direct peer-to-peer token swaps
  • Censorship-resistant trading

Automated Liquidity

  • Smart contracts manage all trading logic
  • No need for order books or market makers
  • Continuous liquidity provision

Fixed Fee Structure

  • 0.3% fee on all trades
  • Fees distributed to liquidity providers
  • Predictable cost structure

LP Token Rewards

  • Earn trading fees proportional to your share
  • Additional BONE rewards through staking
  • Compound earnings over time

Token Standards

ERC-20 Tokens

ShibaSwap v1 supports all standard ERC-20 tokens on Ethereum:

Standard Compliance

All tokens must follow the ERC-20 standard for compatibility.

Wrapped Tokens

Native ETH is automatically wrapped to WETH for trading.

LP Tokens

When you provide liquidity, you receive LP tokens:
  • Representation: LP tokens represent your share of the pool
  • Transferable: Can be transferred or traded
  • Redeemable: Can be burned to withdraw underlying tokens
  • Stakable: Can be staked for additional rewards

Security Features

Non-Upgradeable Contracts

  • Smart contracts cannot be modified after deployment
  • Immutable protocol logic
  • Reduced risk of malicious updates

Audited Code

  • Multiple security audits
  • Open-source codebase
  • Community-reviewed contracts

Slippage Protection

  • Users can set maximum slippage tolerance
  • Failed trades if price moves too much
  • Protection against front-running

Comparison: v1 vs v2

FeatureShibaSwap v1ShibaSwap v2
AMM TypeClassic AMMConcentrated Liquidity
Fee StructureFixed 0.3%Multiple tiers (0.05%, 0.3%, 1%)
LiquidityFull price rangeCustom price ranges
Position TypeLP tokensNFT positions
Capital EfficiencyStandardHigher with concentration
ComplexitySimpleAdvanced
Gas CostsLowerHigher for complex operations

Developer Resources

Smart Contract Repositories

  • shibaswap-v1-core: Core protocol contracts
  • shibaswap-v1-periphery: Router and helper contracts

SDK and Tools

  • shibaswap-sdk: JavaScript SDK for integration
  • Documentation: Complete API reference
  • Examples: Code samples and tutorials

Contract Addresses

  • Factory: 0x115934131916C8b277DD010Ee302de153C0f07DE
  • Router: 0x03f7724180AA6b939894B5Ca4314783B0b36b329
  • WETH: 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2

Best Practices

1

Start Small

Begin with small trades to understand how the protocol works.
2

Check Liquidity

Ensure sufficient liquidity exists for your desired trade.
3

Monitor Slippage

Set appropriate slippage tolerance based on market conditions.
4

Understand Impermanent Loss

Learn about impermanent loss before providing significant liquidity.
5

Diversify Positions

Consider providing liquidity to multiple pools to spread risk.

Common Use Cases

Token Swapping

  • Trade between any supported ERC-20 tokens
  • No registration or KYC required
  • Instant settlement on Ethereum

Liquidity Provision

  • Earn trading fees by providing liquidity
  • Support the ecosystem while earning rewards
  • Compound earnings over time

Yield Farming

  • Stake LP tokens for additional BONE rewards
  • Maximize returns through multiple reward streams
  • Participate in ecosystem governance

Troubleshooting

Transaction Failed

  • Check gas fees
  • Verify slippage settings
  • Ensure sufficient token balance
  • Check for sufficient liquidity

High Price Impact

  • Try smaller trade amounts
  • Check pool liquidity
  • Consider different token pairs
  • Split large trades

LP Token Issues

  • Verify LP token balance
  • Check pool contract address
  • Ensure correct token pair
  • Contact support if needed

Reward Claims

  • Check Woof page for available rewards
  • Ensure wallet is connected
  • Verify staking position
  • Check network connection
ShibaSwap v1 provides a solid foundation for decentralized trading with its proven AMM model. While v2 offers advanced features, v1 remains a reliable choice for simple trading and liquidity provision.