ctaShare Your Requirements
Home
Home
CSS Developer

Hire the Best CSS Developer

Great interfaces need precision styling that works across devices and browsers. Hire CSS developers from Oodles. Our developers build responsive layouts, optimize performance, and create visual experiences that enhance usability while writing clean, maintainable CSS that brings your design vision to life with consistency and accessibility across your application.

View More

Akash Bhardwaj Oodles
Associate Consultant L2 - Frontend Development
Akash Bhardwaj
Experience 2+ yrs
CSS Javascript HTML, CSS +15 More
Know More
Akash Bhardwaj Oodles
Associate Consultant L2 - Frontend Development
Akash Bhardwaj
Experience 2+ yrs
CSS Javascript HTML, CSS +15 More
Know More
Om Prakash Oodles
Associate Consultant L2 - Frontend Development
Om Prakash
Experience 1+ yrs
CSS ReactJS Javascript +10 More
Know More
Om Prakash Oodles
Associate Consultant L2 - Frontend Development
Om Prakash
Experience 1+ yrs
CSS ReactJS Javascript +10 More
Know More
Varun Kumar Oodles
Associate Consultant L1 - Development
Varun Kumar
Experience 1+ yrs
CSS HTML5 Java +3 More
Know More
Varun Kumar Oodles
Associate Consultant L1 - Development
Varun Kumar
Experience 1+ yrs
CSS HTML5 Java +3 More
Know More
Arun Singh Oodles
Associate Consultant L1 - Frontend Development
Arun Singh
Experience 1+ yrs
CSS ReactJS Javascript +3 More
Know More
Arun Singh Oodles
Associate Consultant L1 - Frontend Development
Arun Singh
Experience 1+ yrs
CSS ReactJS Javascript +3 More
Know More
Md Aseer Oodles
Associate Consultant L1- Frontend Development
Md Aseer
Experience 1+ yrs
CSS Frontend Redux +5 More
Know More
Md Aseer Oodles
Associate Consultant L1- Frontend Development
Md Aseer
Experience 1+ yrs
CSS Frontend Redux +5 More
Know More
Kuldeep Kant Oodles
Associate Consultant L1- Frontend Development
Kuldeep Kant
Experience 1+ yrs
CSS Tailwind CSS ReactJS +5 More
Know More
Akshay kumar Dubey Oodles
Associate Consultant L1 - Frontend Development
Akshay kumar Dubey
Experience 1+ yrs
CSS Javascript ReactJS +2 More
Know More
Komal Upadhyay Oodles
Associate Consultant L1 - Frontend Development
Komal Upadhyay
Experience Below 1 yr
CSS HTML5 Visual Studio Code +6 More
Know More
Ashutosh Pandey Oodles
Associate Consultant L1 - Development
Ashutosh Pandey
Experience Below 1 yr
CSS Frappe ORM RESTful API +2 More
Know More
Ranjan Kumar Oodles
Associate Consultant L1 - Development
Ranjan Kumar
Experience Below 1 yr
CSS Python GPT +14 More
Know More
Vishwas Saxena Oodles
Associate Consultant L1 - Frontend Development
Vishwas Saxena
Experience Below 1 yr
CSS ReactJS React Native +6 More
Know More
Gyandeep Kumar Oodles
Associate Consultant L1 - Frontend Development
Gyandeep Kumar
Experience Below 1 yr
CSS Redux Tailwind CSS +18 More
Know More
Aarti Kumari Oodles
Associate Consultant L1 - Development
Aarti Kumari
Experience 1+ yrs
CSS ERPNext Frappe ORM +19 More
Know More
Neeraj Shukla Oodles
Assistant Consultant - Frontend Development
Neeraj Shukla
Experience Below 1 yr
CSS Javascript ReactJS +6 More
Know More
Nishant Thakur Oodles
Intern - Frontend Development
Nishant Thakur
Experience Below 1 yr
CSS HTML5 Javascript +11 More
Know More

Additional Search Terms

Mobile App

Related Skills

Skill Blog Posts

A Dev Guide to Placing Orders using Hyperliquid API
IntroductionHyperliquid is a high-performancedecentralized perpetual exchange offering low-latency trading. For developers building algorithmic strategies, bots, or integrations, Hyperliquid exposes both REST and WebSocket APIs. This guide provides a step-by-step walk-through of how to place a basic order using the REST API in Node.js.This script demonstrates how to place a limit sell order for the HYPE token on the Hyperliquid testnet using JavaScript. It utilizes the ethers library for wallet management and the @nktkas/hyperliquid SDK to interact with Hyperliquid's API.Overview of Hyperliquid's Use CasesHyperliquid offers fast, API-based access to decentralized perpetual trading. Developers commonly use it to:Build bots for placing and managing ordersMonitor positions, funding rates, and liquidationsSimulate and test strategies on the testnetIntegrate trading data into dashboards or analytics toolsTrigger trades based on on-chain or external signalsIts design supports both simple scripts and complex trading systems with low latency.Who Should Use This Guide?This guide is for developers who want to:Place limit orders using Hyperliquid's REST APITest trading logic in a controlled testnet environmentIntegrate order placement into existing apps or botsUnderstand how the Hyperliquid SDK interacts with wallets and marketsIf you're familiar with JavaScript and basic API workflows, you'll find this walkthrough easy to follow.Prerequisites for Integrating Hyperliquid API in Your Crypto Trading SystemNode.js and npmethers and @nktkas/hyperliquid npm packagesHyperliquid API Integration: Setting Up Imports and Configuring Your Environmentimport * as hl from '@nktkas/hyperliquid'; import { ethers } from 'ethers'; const privateKey = 'YOUR_PRIVATE_KEY'; // Set up a connection to the Hyperliquid API (using the testnet environment) const transport = new hl.HttpTransport({ isTestnet: true }); // Initialize a wallet instance using the provided private key to sign transactions const wallet = new ethers.Wallet(privateKey); // Set up the ExchangeClient for placing orders and handling trading operations const exchangeClient = new hl.ExchangeClient({ wallet, transport, isTestnet: true, }); // Set up the InfoClient to retrieve market data and other relevant information const infoClient = new hl.InfoClient({ transport }); Component Explanations:HttpTransport : Establishes a connection to the Hyperliquid API. TheisTestnet flag ensures you're working with the testnet environment.ethers.Wallet : Creates a wallet instance using your private key. This wallet is used for signing transactions.ExchangeClient : Manages order placements and various trading operations.InfoClient : Provides access to market metadata and informational endpoints.Also, Explore |Creating a Custom Hyperliquid Dashboard: Track Live Holdings in ReactPreparing for a Smooth IntegrationChecklist Before You BeginClarify Your Requirements:Define the specific functionality you need from the system or API.Review API Documentation:Understand the endpoints, authentication methods, and rate limits.Set Up Your Development Environment:Ensure dependencies are installed and your environment is ready for integration.Prepare Authentication Credentials:Securely store your API keys or tokens.Use Test Environment:Start integration in a test or staging environment to avoid issues in production.As highlighted in the officialHyperliquid API documentation, integrating with their testnet environment is crucial for ensuring stable deployments. We've followed these guidelines extensively when deploying automated strategies for our clients, ensuring a smooth and risk-free integration before moving to production.Tips for Avoiding Common Setup MistakesTest First:Always validate the integration in a controlled environment before going live.Monitor Rate Limits:Ensure you don't exceed API rate limits by optimizing your calls.Map Data Correctly:Double-check the data formats to avoid integration errors.Secure Sensitive Data:Use environment variables to store API keys, not hardcoded values.Handle Errors Efficiently:Implement error handling and logging to quickly identify and fix issues.Plan for Scalability:Make sure your integration can handle increased traffic as your system grows.Main function:async function main() { try { // Retrieve market metadata for available assets and trading pairs const [meta] = await infoClient.metaAndAssetCtxs(); // Find the index of the 'HYPE' asset within the available assets const assetIndex = meta.universe.findIndex( (asset) => asset.name === 'HYPE' ); // Check if the HYPE asset exists if (assetIndex === -1) { throw new Error('HYPE asset not found.'); } // Define order parameters const orderParams = { orders: [ { a: assetIndex, // Asset index for HYPE b: false, // false for sell, true for buy p: '100', // Limit price (string format) s: '0.1', // Order size (string format) r: false, // No reduce-only flag t: { limit: { tif: 'Gtc', // Time-in-force: 'Good 'til canceled' }, }, }, ], grouping: 'na', // No specific grouping for the order }; // Place the order on the Hyperliquid exchange const response = await exchangeClient.order(orderParams); console.log('Order placed successfully:', response); } catch (error) { // Error handling: Log any issues that occur during the order placement process console.error('Error placing order:', error); console.error( 'Error details:', error.response ? error.response.response.data : error.message ); }}Explanation:Retrieve Market Metadata:The functionmetaAndAssetCtxs() fetches metadata about available trading pairs from the Hyperliquid API.Find Asset Index:The code searches for the index of the 'HYPE' asset in the available assets list. This index is needed to specify the asset when placing an order.Order Parameters:a: Specifies the asset index for 'HYPE'.b: A boolean flag indicating the order side (false for sell,true for buy).p: The limit price, set to100 in this case.s: The order size, set to0.1 HYPE.r: A flag indicating whether the order is reduce-only (set tofalse here).t: Time-in-force setting (Gtc means the order is good until canceled).grouping: Set to'na', meaning no specific grouping for this order.Place Order:The functionexchangeClient.order(orderParams) sends the order to the Hyperliquid exchange, where it gets processed.Error Handling:Any errors encountered during the order process are caught, logged, and detailed error messages are provided for debugging.You may also like |How to Fetch Transaction History on Ethereum usingWeb3.pyDeveloper Best PracticesKeeping Your Integration SecureUse Secure Authentication:Always implement OAuth, API keys, or other secure authentication methods, and avoid hardcoding credentials in your codebase.Encrypt Sensitive Data:Ensure that sensitive data such as API keys, user details, and transaction information is encrypted both in transit and at rest.Follow Least Privilege Principle:Grant the minimum required permissions for users or services to access the integration.Regularly Rotate Keys and Tokens:Periodically change API keys and authentication tokens to reduce the risk of unauthorized access.Managing API Reliability Over TimeMonitor API Usage and Performance:Track API calls and error rates to identify potential issues before they impact your application.Handle API Downtime Gracefully:Implement retries with exponential backoff and fallback mechanisms to ensure smooth user experience during downtime.Check for Deprecations and Updates:Regularly review API documentation for breaking changes, new features, or deprecations that could affect your integration.Implement Logging and Alerts:Set up logging for all API interactions and create alerts for failures or unexpected behavior.Testing Your Integration Before Going LiveTest in a Sandbox Environment:Use a sandbox or testnet environment to simulate real-world scenarios and detect issues early.Test for Edge Cases:Ensure your integration handles unexpected inputs, errors, and edge cases such as rate limit breaches or invalid data formats.Verify Data Accuracy:Double-check that the data returned by the API is correct, and ensure your application properly handles it.Perform Load Testing:Simulate high traffic to identify performance bottlenecks and optimize your integration for scalability.Important considerations:Account Initialization:Ensure that the wallet address derived from your private key has been initialized on Hyperliquid.Without proper initialization, you may encounter the following error: User or API Wallet does not exist.Collateral Requirements:Collateral is required, even for spot trades.Hyperliquid mandates a minimum amount of USDC collateral in your perpetuals account.For example, to sell 0.1 HYPE at $100, you'll need at least$10 USDC as collateral.Testnet vs. Mainnet:The script is configured fortestnet (isTestnet: true).Ensure that you're interacting with the correct network based on your environment—testnet for testing and mainnet for live transactions.Error Messages:Pay close attention to error messages returned by the API.These messages offer valuable insights into issues such asinsufficient margin orincorrect asset indices.Also, Discover |Stablecoin Development with CDP (Collateralized Debt Positions)Conclusion.This guide outlines a simple and efficient approach for placing limit sell orders on the Hyperliquid testnet using the REST API in Node.js. By utilizing the @nktkas/hyperliquid SDK and ethers.js for wallet management, you can easily integrate order placement into your algorithmic strategies or trading bots.However, it's important to keep in mind a few key considerations:Wallet Initialization: Ensure that your wallet address is properly initialized on Hyperliquid.Collateral Requirements: Make sure you meet the necessary collateral requirements.Network Selection: Double-check that you're interacting with the correct network (testnet vs. mainnet).With this setup, you'll be able to execute trades efficiently, taking full advantage of Hyperliquid's low-latency and high-performance decentralized exchange.By integratingHyperliquid API, we enabled our clients to benefit from low-latency trading and efficient order management. This has helped them streamline their trading operations, optimize their strategies, and ultimately save time. We continue to recommendHyperliquid API for clients seeking high-performance decentralized trading solutions.If you are planning to launch your own DEX like Hyperliquid, connect with our skilledblockchain developers to get started.Frequently Asked Questions (FAQ)1. What is the best API for crypto trading?Popular options includeBinance API,Coinbase API, andHyperliquid API for decentralized trading.2. Which platform uses AI to automate crypto trading?Platforms like3Commas andHaasOnline use AI for automated trading.3. How to withdraw crypto with API?You can withdraw crypto via thewithdraw endpoint by authenticating and providing wallet details.4. What platform do most crypto traders use?The most commonly used platforms areBinance andCoinbase.5. What is the best automated crypto trading platform for beginners?Commas andCryptohopper are ideal for beginners due to their user-friendly interfaces.6. How do you make money from crypto trading bots?Crypto trading bots make money by executing profitable trades based on predefined strategies.7. How can I test my crypto trading strategy with a testnet?You can test strategies risk-free onHyperliquid orBinance Testnet by simulating real-market conditions.
Technology:TAILWIND CSS, ETHERJS...more
Category:Blockchain Development & Web3 Solutions
Mohd Yasar
08 Jul 2025
Building a Portfolio Tracker Dashboard Using Hyperliquid API
With the rise of decentralized exchange platform development, Hyperliquid is quickly becoming a favorite for real-time perpetual trading. If you're working on a Web3 frontend or a crypto portfolio tracker, integrating live token holdings from Hyperliquid can add serious value to your app.What is Hyperliquid?Hyperliquid is a fast, decentralized exchange built for perpetual contracts. It offers:Instant transaction finalityLow feesDeveloper-friendly APIsAs a trader, you get blazing-fast execution across multiple markets. As a developer, you can build tools like dashboards, bots, or analytics apps with ease.Also, Read | Build a Custom Bonding Curve for Token Sales with SolidityWith Hyperliquid's API, you can:Fetch real-time token balancesBuild portfolio dashboards and chartsCreate wallet-based trading interfacesWhat You'll NeedBefore we dive in, make sure you have:A basic understanding of ReactNode.js and npm (or yarn)A test wallet address on HyperliquidTailwind CSS for stylingYou may also like | Build a Crypto Payment Gateway Using Solana Pay and ReactStep 1: Set Up Your React AppWe'll use Vite for fast setup and development.# 1. Create your Vite + React project npm create vite@latest hyperliquid-dashboard -- --template react # 2. Go into your project folder cd hyperliquid-dashboard # 3. Install dependencies npm install # 4. Start your dev server npm run devStep 2: Install Required PackagesYou'll need some packages for wallet connection and API queries:npm install wagmi viem @tanstack/react-query @rainbow-me/rainbowkit Follow RainbowKit's or Wagmi's quickstart guide to connect a wallet.Step 3: Fetch Portfolio Data from HyperliquidCreate a custom React hook to pull live data from the Hyperliquid testnet API.// useUserPortfolio.js import { useEffect, useState } from "react"; import { useAccount } from "wagmi"; export const useUserPortfolio = () => { const { address } = useAccount(); const [portfolio, setPortfolio] = useState(null); const [loading, setLoading] = useState(false); useEffect(() => { if (!address) return; const fetchData = async () => { setLoading(true); try { const res = await fetch("https://api.hyperliquid-testnet.xyz/info", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ type: "spotClearinghouseState", user: address || "your test address", }), }); const data = await res.json(); setPortfolio(data); } catch (err) { console.error("Error fetching data:", err); } finally { setLoading(false); } }; fetchData(); }, [address]); return { portfolio, loading }; };Also, Discover | Create DeFi Index Fund with Custom ERC-4626 Tokenized VaultsStep 4: Create the Dashboard UIBuild a component that displays key metrics like token balances, account value, and P&L over time. Use libraries like Recharts to create smooth, animated charts.import { useState } from "react"; import { LineChart, Line, XAxis, YAxis, Tooltip, ResponsiveContainer, CartesianGrid, AreaChart, Area } from "recharts"; // Helper: Format timestamp const formatDate = (ts) => { const date = new Date(Number(ts)); return `${date.getMonth() + 1}/${date.getDate()} ${date.getHours()}:${date.getMinutes()}`; }; const timeOptions = ["day", "week", "month", "allTime"]; const PortfolioDashboard = ({ portfolioData }) => { const [selectedTime, setSelectedTime] = useState("day"); const selectedData = portfolioData?.find(([label]) => label === selectedTime); const { accountValueHistory = [], pnlHistory = [], vlm = "0" } = selectedData?.[1] || {}; // Combine both datasets by timestamp const chartData = accountValueHistory.map(([timestamp, value], i) => ({ time: formatDate(timestamp), accountValue: Number(value), pnl: Number(pnlHistory[i]?.[1] || 0), })); const currentPnl = Number(chartData[chartData.length - 1]?.pnl || 0); const startValue = Number(chartData[0]?.accountValue || 0); const endValue = Number(chartData[chartData.length - 1]?.accountValue || 0); const pnlPercentage = startValue !== 0 ? ((currentPnl / startValue) * 100).toFixed(2) : "0.00"; return ( <div className="w-full text-white space-y-4"> {/* Header Section */} <div className="flex flex-col md:flex-row md:items-center justify-between"> <div> <h2 className="text-3xl font-bold bg-gradient-to-r from-teal-400 to-blue-500 bg-clip-text text-transparent"> Portfolio Overview </h2> <p className="text-gray-400 mt-1">Track your Hyperliquid performance</p> </div> <div className="flex gap-2 mt-4 md:mt-0 bg-gray-800 p-2 rounded-lg"> {timeOptions.map((opt) => ( <button key={opt} onClick={() => setSelectedTime(opt)} className={`px-4 py-2 rounded-md text-sm font-medium transition-all ${selectedTime === opt ? "bg-gray-700 text-white shadow-md" : "text-gray-400 hover:text-white" }`} > {opt.charAt(0).toUpperCase() + opt.slice(1)} </button> ))} </div> </div> {/* Key Stats */} <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 p-6 shadow-lg"> <div className="bg-gray-800/50 p-4 rounded-lg border border-gray-700"> <p className="text-sm text-gray-400 mb-1">Volume</p> <p className="text-2xl font-bold">${Number(vlm).toLocaleString()}</p> </div> <div className="bg-gray-800/50 p-4 rounded-lg border border-gray-700"> <p className="text-sm text-gray-400 mb-1">PNL</p> <div className="flex items-end gap-2"> <p className={`text-2xl font-bold ${currentPnl >= 0 ? 'text-green-400' : 'text-red-400'}`}> ${Math.abs(currentPnl).toFixed(2)} </p> <span className={`text-sm mb-1 ${currentPnl >= 0 ? 'text-green-400' : 'text-red-400'}`}> {currentPnl >= 0 ? '↑' : '↓'} {pnlPercentage}% </span> </div> </div> <div className="bg-gray-800/50 p-4 rounded-lg border border-gray-700"> <p className="text-sm text-gray-400 mb-1">Start Value</p> <p className="text-2xl font-bold">${startValue.toFixed(2)}</p> </div> <div className="bg-gray-800/50 p-4 rounded-lg border border-gray-700"> <p className="text-sm text-gray-400 mb-1">End Value</p> <p className="text-2xl font-bold">${endValue.toFixed(2)}</p> </div> </div> {/* Charts */} <div className="grid md:grid-cols-2 gap-6"> {/* Account Value Chart */} <div className="bg-gradient-to-br from-gray-900 to-gray-800 p-3 rounded-xl border border-gray-700 shadow-lg"> <div className="flex justify-between items-center mb-4"> <h3 className="text-lg font-semibold">Account Value</h3> <div className="text-right"> <p className="text-sm text-gray-400">Current Value</p> <p className="text-xl font-bold text-teal-400">${endValue.toFixed(2)}</p> </div> </div> <ResponsiveContainer width="100%" height={250}> <AreaChart data={chartData}> <defs> <linearGradient id="colorAccountValue" x1="0" y1="0" x2="0" y2="1"> <stop offset="5%" stopColor="#34d399" stopOpacity={0.8} /> <stop offset="95%" stopColor="#34d399" stopOpacity={0} /> </linearGradient> </defs> <XAxis dataKey="time" hide /> <YAxis /> <Tooltip contentStyle={{ backgroundColor: '#1e293b', borderColor: '#334155', borderRadius: '0.5rem' }} /> <CartesianGrid strokeDasharray="3 3" stroke="#334155" /> <Area type="monotone" dataKey="accountValue" stroke="#34d399" fillOpacity={1} fill="url(#colorAccountValue)" /> </AreaChart> </ResponsiveContainer> </div> {/* PNL Chart */} <div className="bg-gradient-to-br from-gray-900 to-gray-800 p-5 rounded-xl border border-gray-700 shadow-lg"> <div className="flex justify-between items-center mb-4"> <h3 className="text-lg font-semibold">Profit & Loss</h3> <div className="text-right"> <p className="text-sm text-gray-400">Current PNL</p> <p className={`text-xl font-bold ${currentPnl >= 0 ? 'text-green-400' : 'text-red-400'}`}> ${currentPnl.toFixed(2)} </p> </div> </div> <ResponsiveContainer width="100%" height={250}> <AreaChart data={chartData}> <defs> <linearGradient id="colorPnl" x1="0" y1="0" x2="0" y2="1"> <stop offset="5%" stopColor={currentPnl >= 0 ? "#4ade80" : "#f87171"} stopOpacity={0.8} /> <stop offset="95%" stopColor={currentPnl >= 0 ? "#4ade80" : "#f87171"} stopOpacity={0} /> </linearGradient> </defs> <XAxis dataKey="time" hide /> <YAxis /> <Tooltip contentStyle={{ backgroundColor: '#1e293b', borderColor: '#334155', borderRadius: '0.5rem' }} /> <CartesianGrid strokeDasharray="3 3" stroke="#334155" /> <Area type="monotone" dataKey="pnl" stroke={currentPnl >= 0 ? "#4ade80" : "#f87171"} fillOpacity={1} fill="url(#colorPnl)" /> </AreaChart> </ResponsiveContainer> </div> </div> </div> ); }; export default PortfolioDashboard;Step 5: Add a Simple NavbarUse the RainbowKit ConnectButton to let users link their wallet.import { ConnectButton } from "@rainbow-me/rainbowkit"; function Navbar() { return ( <div className="navbar"> <h1>📊 Hyperliquid Dashboard</h1> <ConnectButton /> </div> ); }Also, read | Decentralized Prediction Market Development on EthereumStep 6: Set Up ProvidersWrap your app with WagmiProvider, RainbowKitProvider, and React Query so you're ready for wallet interactions and data fetching.import { StrictMode } from "react"; import { createRoot } from "react-dom/client"; import "./index.css"; import App from "./App.jsx"; import Providers from "./components/Provider.jsx"; createRoot(document.getElementById("root")).render( <StrictMode> <Providers> <App /> </Providers> </StrictMode> );Step 7: Putting It All TogetherYour main app logic should show different states:Wallet not connectedLoading portfolioDisplay portfolio once data is fetchedimport Navbar from "./components/Navbar"; import PortfolioDashboard from "./components/PortfolioDashboard"; import { useUserPortfolio } from "./hooks/useUserPortfolio"; import { useAccount } from "wagmi"; function App() { const { address, isConnected } = useAccount(); const { portfolio, loading } = useUserPortfolio(address); return ( <div className="min-h-screen w-full bg-black text-white p-5"> <Navbar /> <div className="w-full mx-auto px-10 max-w-[90%] pt-6"> {!isConnected ? ( <p className="text-center text-gray-400"> 🔗 Please connect your wallet to view your portfolio. </p> ) : loading ? ( <p className="text-center">Loading portfolio...</p> ) : ( <PortfolioDashboard portfolioData={portfolio} /> )} </div> </div> ); } export default App;Step 9: Run and TestReplace the test address in your hookStart your app: http://localhost:5173View live token balances from HyperliquidSample UI PreviewConclusionAnd that's it! We have built a working portfolio tracker that fetches real-time wallet data from Hyperliquid. In case you are planning to build your deFi protocol leveraging the potential of Hyperliquid, connect with our skilled blockchain developers to get started.
Technology:TAILWIND CSS, ETHERJS...more
Category:Blockchain Development & Web3 Solutions
Akash Bhardwaj
07 Jul 2025
How to Place a Limit Order on Ethereum using Kyberswap
In this guide, we will walk through the process of placing a limit order on Kyberswap using their API. Kyberswap is a decentralized exchange (DEX) aggregator that provides the best token prices by aggregating liquidity from various DEXs. By leveraging Kyberswap's API, we can automate the process of placing limit orders for token trades, giving you full control over your trade price. This tutorial will guide you through setting up the necessary environment, writing the code to interact with the Kyberswap API, and successfully placing a limit order using Node.js and the appropriate dependencies. For more about DEX, visit crypto exchange development services.What is a limit order?A limit order is an instruction to buy or sell your token at a specific price or better. It gives control over the trade price to be executed.For example:A buy limit order will only execute at the limit price. And a sell limit order will only execute at the limit price or higher.Also Read | Ethereum Smart Contracts: Best Use CasesWhat is Kyberswap?A dex aggregator & liquidity protocol that provides the best token price by aggregating liquidity from various DEXs. It also provides liquidity providers with opportunities to earn rewards by depositing their tokens.Before everything, you must have Node.js and VS Code installed.Let's set up this:Open your terminal and type this command: 1. mkdir KyberswapApi 2. cd KyberswapApi 3. code .It will open your project KyberswapApi in VS Code, then open the terminal in VS Code and type this command: npm init It will initialize a project and create the package.json file. npm install viem ethers axios It will install all dependencies in your package.json file.Create a file index.js and paste this ProgramRun this command in your terminal : node index.js (this will create the limit order successfully).Also, Read | A Dev Guide to Placing Orders using Hyperliquid APIHow to use Kyberswap Api to place a limit orderTo create a new order, we need to make a post request on this URL: https://limit-order.kyberswap.com/write/api/v1/ordersFor this, we need params which include the signed EIP712 message and returned data from this post request(https://limit-order.kyberswap.com/write/api/v1/orders/sign-message).Program : import { createWalletClient, erc20Abi, parseEther, getContract, createPublicClient, http, encodeFunctionData } from "viem"; import { ethers } from "ethers"; import axios from "axios"; import { privateKeyToAccount } from 'viem/accounts'; import { base } from 'viem/chains'; const kyberApiUrl = "https://limit-order.kyberswap.com"; const privateKey = "000000X4PRivateKey"; const rpcUrl = "https://mainnet.base.org"; async function mainApprove(makerAsset, limitOrderContract, maker, makingAmount) { const client = createPublicClient({ chain: { id: 8453, // Base chain ID name: "Base", rpcUrls: { default: { http: ["https://mainnet.base.org"] }, }, }, transport: http("https://mainnet.base.org") }); console.log("Client created for Base chain:", client); const tokenContract = getContract({ abi: erc20Abi, address: makerAsset, client: client, }); console.log("here is the tokenContract",tokenContract.address); const currentAllowance = await tokenContract.read.allowance([ maker, limitOrderContract, ]); console.log("Current Allowance:", currentAllowance.toString()); const encodedCalls = []; if (BigInt(currentAllowance) < BigInt('100000000')) { console.log("here it comes "); const approvalData =await getTokenApprovalCalldata( makerAsset, limitOrderContract, makingAmount, ); console.log(' Approval Data:', approvalData); encodedCalls.push({ to: makerAsset , data: approvalData, // gas: '0.007547422' //approvalGas.toString(), }); console.log("Encoded Calls:", encodedCalls); const swaptx = encodedCalls; const str = "000000X4PRivateKey"; const account = privateKeyToAccount(`0x${str}`); const walletClient = createWalletClient({ account, chain: base, transport: http('https://mainnet.base.org'), }); console.log("Wallet Client created:"); const tx1=[]; for (const call of swaptx) { const tx = { to: call.to, data: call.data, value: call.value ? BigInt(call.value) : 0n, }; const hash = await walletClient.sendTransaction(tx); tx1.push(hash); console.log(' Transaction sent, hash:', hash); } return tx1; } return ""; } async function postCreateOrderUnsigned( chainId, makerAsset, takerAsset, maker, //Maker address makingAmount, // "10000" takingAmount // "20000000000000000" ) { let targetPath = `/write/api/v1/orders/sign-message`; // Structure the request to be sent in POST body const requestBody = { chainId: chainId.toString(), makerAsset: makerAsset, // USDC takerAsset: takerAsset, // KNC maker: maker, allowedSenders: [maker], // Included so that only our account can fill this order makingAmount: makingAmount, takingAmount: takingAmount, expiredAt: Math.floor(Date.now() / 1000) + 60 * 60, // 60mins }; console.debug(requestBody); try { const { data } = await axios.post(kyberApiUrl + targetPath, requestBody); // Return the request used and the EIP712 unsigned data console.log("the data we have",data); return { routerContract: data.data.domain.verifyingContract, requestBody: requestBody, returnedData: data.data, }; } catch (error) { throw error; } } //Get Maker Active Making Amount async function getMakerActiveAmount(chainId, makerAsset, makerAddress) { const targetPath = `/read-ks/api/v1/orders/active-making-amount`; const targetPathConfig = { params: { chainId: chainId, makerAsset: makerAsset, maker: makerAddress, }, }; try { const { data } = await axios.get( kyberApiUrl + targetPath, targetPathConfig ); return data.data.activeMakingAmount; } catch (error) { throw error; } } async function getContracts(chainId) { const targetPath = `/read-ks/api/v1/configs/contract-address`; // Specify the chainId to query const targetPathConfig = { params: { chainId: chainId.toString(), }, }; try { console.log(`\nGetting the LO contracts...`); const { data } = await axios.get( kyberApiUrl + targetPath, targetPathConfig ); return data.data; } catch (error) { throw error; } } // Request approval with calldata sending to the user server (client-side) async function getTokenApprovalCalldata( tokenContractAddress, spenderAddress, amount ) { const data = encodeFunctionData({ abi: erc20Abi, functionName: "approve", args: [spenderAddress, parseEther(amount.toString())], }); //TODO: Send the calldata to the user server here return data; } async function signOrderData(domain, types, message) { const provider = new ethers.JsonRpcProvider(rpcUrl); const signer = new ethers.Wallet(privateKey, provider); return await signer.signTypedData(domain, types, message); } // Create New Order on Kyberswap async function postCreateOrder( chainId, makerAsset, takerAsset, maker, makingAmount, takingAmount ) { const targetPath = `/write/api/v1/orders`; const unsignedOrder = await postCreateOrderUnsigned( chainId, makerAsset, takerAsset, maker, makingAmount, takingAmount ); // Get the request body and the EIP712 order creation data const unsignedOrderReqBody = unsignedOrder.requestBody; const unsignedOrderReturnData = unsignedOrder.returnedData; const routerContract = unsignedOrder.routerContract; // Get the Maker current making amount to ensure contract has sufficient allowance across all orders const currentMakingAmount = await getMakerActiveAmount( chainId, makerAsset, maker ); const newMakingAmount = Number(currentMakingAmount) + Number(unsignedOrderReqBody.makingAmount); // Get the LO contract address to interact with on-chain const limitOrderContract = (await getContracts(chainId)).latest; // Check if LO contract has sufficient allowance to spend makerAsset await getTokenApprovalCalldata( makerAsset, limitOrderContract, newMakingAmount ); const swaptx= await mainApprove( makerAsset, limitOrderContract, maker, newMakingAmount ) console.log("the swaptx is: ",swaptx); // Sign the EIP712 order creation with the user server (client-side) const signature = await signOrderData( unsignedOrderReturnData.domain, { Order: unsignedOrderReturnData.types.Order }, unsignedOrderReturnData.message ); // Structure the request to be sent in POST body const requestBody = { ...unsignedOrderReqBody, salt: unsignedOrderReturnData.message.salt, signature: signature, }; console.log("the request body is: ", requestBody); try { console.log(`\nPosting the create order...`); const { data } = await axios.post(kyberApiUrl + targetPath, requestBody); console.log(`KyberSwap server response:`); console.log(data); } catch (error) { throw error; } }Call the post createOrder function with its parameters, and your order will be created.For example : postCreateOrder( "8453", // chainId "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb", // maker asset "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", // taker asset "0x1AC9b76006BaF4f06563E491d4182C82792D2A2C", // maker address "5000000", // making amount "5000000" // taking amount );You may also like | Building a Portfolio Tracker Dashboard Using Hyperliquid APIConclusion:In conclusion, this guide demonstrates how to place a limit order on Kyberswap using the API, allowing you to efficiently manage trades with full control over your order price. By following the steps to set up your environment, configure your wallet, and interact with the Kyberswap API, you can easily integrate limit orders into your trading strategies. With the right parameters and authentication, you can securely create orders on Kyberswap and take advantage of the liquidity available. This process enables developers to enhance their algorithmic trading systems and automate transactions effectively on the platform. For more information, refer to the Kyberswap API documentation.In case you are planning to build a DEX aggregator like Kyberswap, connect with our skilled blockchain developers to get started.
Technology:ReactJS, Node Js...more
Category:Blockchain Development & Web3 Solutions
Krishan Chand
06 Jul 2025

Frequently Asked Questions

Q1: What CSS development services do Oodles' developers provide?

A: Oodles' CSS developers specialize in responsive web design, cross-browser compatibility, CSS animations and transitions, grid and flexbox layouts, custom styling frameworks, performance optimization, SASS/LESS preprocessing, and pixel-perfect implementation of design mockups for stunning web interfaces.

 

Q2: Are Oodles' CSS developers proficient with modern CSS techniques?

A: Yes, Oodles' CSS developers are experts in CSS Grid, Flexbox, CSS Variables, CSS-in-JS, modern pseudo-classes, container queries, CSS animations, transforms, clipping, filters, and progressive enhancement techniques to create cutting-edge, maintainable stylesheets.

 

Q3: Can Oodles' CSS developers optimize our website's styling performance?

A: Absolutely, Oodles' CSS developers optimize performance through CSS minification, critical CSS extraction, unused CSS removal, efficient selector usage, reduced specificity conflicts, proper cascade management, and implementing best practices that improve load times and rendering speed.

 

Q4: How do Oodles' CSS developers ensure cross-browser compatibility?

A: Oodles' CSS developers ensure compatibility through thorough testing across Chrome, Firefox, Safari, Edge, vendor prefix management, graceful degradation strategies, polyfills when necessary, and responsive design testing across devices to deliver consistent experiences for all users.

 

Q5: Can Oodles' CSS developers work with CSS frameworks and preprocessors?

A: Yes, Oodles' CSS developers are proficient in Tailwind CSS, Bootstrap, Foundation, Material Design, SASS, LESS, PostCSS, styled-components, and can customize frameworks or build custom styling solutions based on your project requirements and preferences.

 

Q6. How can we discuss our CSS development needs?

A: Visit our contact page to share information about your design files, current website if applicable, target browsers and devices, and visual quality standards. We'll schedule a consultation where our CSS development team can review your requirements and propose an approach that delivers the polished, performant interface your users deserve.

© Copyright 2009-2026 Oodles Technologies. All Rights Reserved.