DeFi & DEX
Overview

DeFi & DEX

Superhero embeds a full automated market maker at /defi. Swap any pair that has a pool, provide liquidity and earn fees, wrap AE into its AEX-9 form, and browse every token, pool and transaction on the exchange.

The DEX is a different market from the bonding curve that community tokens trade on. The two prices for the same token are independent, and nothing arbitrages them automatically.

The DEX and the bonding curve

Bonding curve (community tokens)DEX (AMM)
Where/trends/tokens/.../defi/swap
What sets the priceA fixed exponential formula on supplyThe ratio of two pool reserves
BuyingTokens are minted against the curveTokens are bought from a pool; nothing is minted
SellingTokens are burned back to the curveTokens go into the pool
CounterpartyThe curve contract's reserveOther liquidity providers
ContractsAffiliationBondingCurveTokenSale, BondingCurveExponentialAedexV2Router, AedexV2Factory, AedexV2Pair
Fee1% spread, split 0.5% DAO and 0.5% affiliation0.3% per swap, to liquidity providers
Can it run out of liquidityNo: the reserve always covers the full supplyYes: a thin pool gives poor prices or no route
Main riskPrice falls back down the curvePrice impact, no route, and impermanent loss if you provide liquidity

The curve can always buy back its entire supply. A liquidity pool makes no such promise: if the liquidity providers leave, there is no price to sell at.

Routes

RouteWhat it does
/defiRedirects to /defi/swap
/defi/swapThe swap form, a candlestick chart for the selected pair, and recent activity
/defi/poolYour liquidity positions, plus the add and remove forms
/defi/pool/add-tokensAdd-liquidity flow for a pair you pick
/defi/wrapWrap AE into WAE and unwrap it back
/defi/explore/tokensEvery token the DEX indexes
/defi/explore/tokens/<address>One token's detail page
/defi/explore/poolsEvery pair
/defi/explore/pools/<address>One pool's detail page
/defi/explore/transactionsFilterable feed of every DEX transaction
/defi/bridgeDisabled: redirects to /defi/swap
/defi/buy-ae-with-ethDisabled: redirects to /defi/swap

/swap, /pool, /explore and /pool/add-tokens still resolve as legacy paths.

Contract addresses

ContractMainnetTestnet
Routerct_azbNZ1XrPjXfqBqbAh1ffLNTQ1sbnuUDFvJrXjYz7JQA1saQ3ct_MLXQEP12MBn99HL6WDaiTqDbG4bJQ3Q9Bzr57oLfvEkghvpFb
Factoryct_2mfj3FoZxnhkSw5RZMcP8BfPoB1QR4QiYGNCdkAvLZ1zfF6paWct_NhbxN8wg8NLkGuzwRNDQhMDKSKBwDAQgxQawK7tkigi2aC7i9
WAEct_J3zBY8xxjsRr3QojETNw48Eb38fjvEuJKkQ6KzECvubvEcvCact_JDp175ruWd7mQggeHewSLS1PFXt9AzThCDaFedxon8mF8xTRF
aeETHct_ryTY1mxqjCjq1yBn9i6HDaCSdA6thXUFZTA84EMzbWd1SLKdhct_WVqAvLQpvZCgBg4faZLXA1YBj43Fxj91D33Z8K7pFsY8YCofv

At startup the app asks the router for its own factory() address and uses the configured factory only as a fallback.

The app also reads a DEX indexer alongside the chain:

NetworkDEX backend
Mainnethttps://dex-backend-mainnet.prd.service.aepps.com
Testnethttps://dex-backend-testnet.prd.service.aepps.com

In this section

  • Swapping: the swap form, how a route is chosen, the router entrypoints behind each swap shape, and what slippage and deadline do.
  • Liquidity Pools: adding and removing liquidity, LP tokens, the protocol-fee switch, and impermanent loss with a worked example.
  • Wrapped AE: why native AE cannot be a pool reserve, and the wrap and unwrap calls.
  • Bridging from Ethereum: the in-app bridge is currently disabled.
  • Exploring the DEX: the three explore views and the /api/dex/* endpoints behind them.
  • Buying AE: where to earn or buy AE.

Related