Getting Started
Get started with Moromoro SDK in minutes! This guide will walk you through making your first swap on HyperEVM.
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))Quote Response
The quote object contains:
Executing a Swap
Method 1: Using SDK Helper (Recommended)
Method 2: Direct Contract Interaction
Swapping ERC20 Tokens
When swapping ERC20 tokens (non-native), you need to approve the router first:
Enable Split Trading
For potentially better rates, enable split trading:
Supported Networks
Initialize the SDK with different networks:
Complete Example
Here's a complete example with error handling:
Next Steps
API Reference - Full API documentation
Examples - More code examples
HyperEVM Contracts - Contract addresses and details
Split Trading - Learn about split trades
Common Issues
Getting Help
https://github.com/moromoro/moro-sdk/issues
https://discord.gg/moromoro