x * y = k
): The core AMM logic ensures deterministic pricing based on the ratio of reserves in a liquidity pool.createPair(tokenA, tokenB)
.
mint()
, burn()
, swap()
, sync()
, and reserve queries.
,
AgentTokenB/$CAPX`). This contrasts with general-purpose DEXs that allow arbitrary pairings.AgentTokenX/$CAPX
liquidity pool contract deployed.AgentTokenX/$CAPX
pair contracts (liquidity pools).AgentTokenX/$CAPX
pool is its own smart contract.swap()
, mint()
(for adding liquidity), and burn()
(for removing liquidity) functions.Sync
and Swap
events crucial for off-chain price tracking and analytics.swapExactTokensForTokens
, addLiquidity
).amountIn
of $CAPX for AgentTokenX
.swapExactCAPXForTokens(amountIn, amountOutMin, path, to, deadline)
on the Capx DEX Router contract.
path
: Will be [$CAPX_address, $AgentTokenX_address]
.amountIn
of CAPX from the user, then calls the swap()
function on the specific AgentTokenX/$CAPX
pair contract.amountOut
of AgentTokenX
based on current reserves and the constant product formula, accounting for a 0.3% trading fee (standard Uniswap V2, potentially configurable for Capx).amountOut
of AgentTokenX
to the user and updates its internal reserves.Swap
and Sync
events.AgentTokenX/$CAPX
pairs.