Essential Concepts
WETH vs Native ETH
Important Protocol Limitation: UNIKRON does not support native ETH as a sellToken parameter. All ETH positions must be converted to WETH (Wrapped Ether) prior to execution.
| Asset Type | Contract Address | Swap Eligibility | Required Action |
|---|---|---|---|
| Native ETH | 0x0000000000000000000000000000000000000000 | Not Supported | Convert to WETH |
| WETH (ERC-20) | 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 | Supported | Direct usage |
Technical Rationale:
Native ETH operates outside the ERC-20 token standard and requires special handling for smart contract interactions. WETH provides ERC-20 compliance while maintaining a 1:1 peg with ETH through a deposit/withdrawal mechanism, enabling standardized DEX integration.
How to Wrap ETH to WETH
Use UNIKRON’s wrap endpoint to convert ETH to WETH before trading:
// Use our wrap endpoint
const wrapQuote = await fetch(`${API_URL}/api/v1/mev/wrap/quote`, {
method: "POST",
headers: { "X-API-Key": API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({
direction: "wrap",
amount: "1000000000000000000", // 1 ETH
userAddress: yourAddress,
}),
});
// Sign and submit (same as regular swap)
const signedTx = await signer.signTransaction(wrapQuote.data.transactionParams);
await fetch(`${API_URL}/api/v1/mev/wrap/order`, {
method: "POST",
body: JSON.stringify({ signedTransaction: signedTx }),
});ERC-20 Token Approvals
Definition: Token approvals grant smart contracts permission to transfer ERC-20 tokens on behalf of the token holder, as specified in the EIP-20 standard.
Approval Requirements: Approvals are required when:
- Trading a token for the first time
- Interacting with a new router contract
- Existing allowance is insufficient for transaction amount
Detailed Implementation: See Step 3: Token Approval for complete integration guide.
Reference Implementation:
// Allowance verification
const currentAllowance = await tokenContract.allowance(
userAddress,
routerAddress
);
if (currentAllowance.lt(transactionAmount)) {
// Execute approval transaction
const approveTx = await tokenContract.approve(
routerAddress,
ethers.MaxUint256 // Or specific amount per security policy
);
await approveTx.wait(); // Mandatory: Wait for confirmation
}Important: All token movements must be properly authorized through on-chain approval mechanisms as per standard operating procedures.
Slippage Tolerance
Definition: Slippage represents the differential between expected execution price at quote time and actual execution price at settlement time, caused by market volatility and liquidity depth changes.
Example Scenario:
| Metric | Value |
|---|---|
| Expected output | 3,700 USDC |
| Actual output | 3,681 USDC |
| Slippage | 19 USDC (0.51%) |
Built-in Protection Mechanism
UNIKRON implements automatic slippage protection via the minBuyAmount parameter:
- Default tolerance: 0.6% (60 basis points)
- Transactions revert if output <
minBuyAmount - No user funds at risk on excessive slippage
- Adheres to institutional best execution standards
Implementation: Slippage protection is automatically applied to all quotes. No additional configuration required.
Price Impact
Definition: Price impact quantifies how a trade size affects the market exchange rate due to available liquidity constraints. Larger trades relative to pool depth result in higher price impact.
Impact Assessment Guidelines:
| Impact Level | Basis Points | Risk Assessment | Recommended Action |
|---|---|---|---|
| Low | < 100 bps (1%) | Acceptable | Execute as planned |
| Medium | 100-300 bps (1-3%) | Elevated | Consider trade splitting |
| High | > 300 bps (3%) | Significant | Reassess trade size |
Quote Response Field: Price impact is returned as priceImpact (decimal format, e.g., 0.12 = 0.12%)
Mitigation Strategies
How to Minimize Price Impact:
- Trade Splitting: Divide large orders into smaller tranches executed over time
- Route Optimization: UNIKRON automatically routes to minimize price impact
- Alternative Pairs: Consider trading through intermediate tokens with deeper liquidity
- Time Distribution: Execute during periods of higher market liquidity