Lux Docs
Exchange

API Reference

Exchange SDK and hooks

React Hooks

import { useSwap } from '@luxfi/exchange';

const { quote, execute } = useSwap({
  tokenIn: '0x...',
  tokenOut: '0x...',
  amountIn: '1000000',
});

Core Functions

FunctionDescription
getQuote()Get swap quote with routing
executeSwap()Execute a swap transaction
addLiquidity()Add liquidity to a pool
removeLiquidity()Remove liquidity
getPositions()List active positions

On this page