Skip to main content

Onchain overview

BarkSwap is a decentralized exchange deployed on the DogeOS Chikyū Testnet. It combines two onchain systems:

  • Concentrated liquidity — a concentrated-liquidity AMM. Liquidity providers supply capital within custom price ranges, and pools use a single adaptive (dynamic) fee instead of fixed fee tiers.
  • ve(3,3) emissions — a voting-escrow model. Locking the BARK token mints a veNFT whose holders vote weekly on which pools receive BARK emissions, and earn the trading fees and bribes from the pools they vote for.
BarkSwap pools, not Uniswap v3

BarkSwap's AMM is concentrated-liquidity (Uniswap v3-style) but not identical. The most important difference for integrators: BarkSwap pools have no fixed fee tier. Where a Uniswap v3 call takes a fee (e.g. 3000), the BarkSwap equivalent takes a deployer address (address(0) for the default pool deployer). Keep this in mind when reading the guides below.

How the pieces fit together

┌─────────────────────────────┐
Traders ──▶│ SwapRouter / QuoterV2 │──▶ Pool (dynamic fee)
└─────────────────────────────┘ ▲
│ liquidity
┌─────────────────────────────┐ │
LPs ──────▶│ NonfungiblePositionManager │────────────┘
└─────────────────────────────┘ mints position NFT
│ stake NFT

┌─────────────────────────────┐ ┌──────────────────┐
│ GaugeV2_NFT (per pool) │◀───│ VoterV4 │ weekly votes
└─────────────────────────────┘ └──────────────────┘
▲ emissions ▲
│ │ veNFT voting power
┌─────────────────────────────┐ ┌──────────────────┐
│ MinterUpgradeable │ │ VotingEscrow │ lock BARK → veNFT
└─────────────────────────────┘ └──────────────────┘
  • Core (Factory, pools) holds liquidity and executes swaps.
  • Periphery (SwapRouter, QuoterV2, NonfungiblePositionManager) is what most integrations call — it wraps the low-level pool interface.
  • VotingEscrow locks BARK into a veNFT. VoterV4 tallies votes and routes emissions.
  • MinterUpgradeable mints the weekly BARK emission. GaugeV2_NFT custodies staked CL position NFTs and streams emissions to LPs. Bribes and RewardsDistributor distribute bribes and the rebase to voters.
  1. Network & addresses — chain params and every deployed address.
  2. Swap — quote and execute a trade.
  3. Provide liquidity — mint a concentrated position.
  4. ve(3,3): lock, vote, earn — lock BARK, vote, and claim rewards.
  5. Contract reference — per-contract function and event reference.