Getting Started
Basic Setup
2
Getting a Quote
Simple Quote Example
// Token addresses
const HYPE = '0x5555555555555555555555555555555555555555' // Native token
const USDT = '0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb' // USDT0
// Swap parameters
const amountIn = ethers.utils.parseUnits('10', 18) // 10 HYPE
const gasFee = ethers.BigNumber.from('5000000000') // 5 gwei
// Get best rate quote
const quote = await moroClient.getQuote(
HYPE, // source token
USDT, // destination token
amountIn, // amount to swap
gasFee, // gas price for calculation
{ enableSplit: false } // options
)
console.log('Quote:', quote)
console.log('Amount Out:', ethers.utils.formatUnits(quote.amountOut, 6))