Hibit: Omni-chain DEX with CEX-level performance
  • Overview
    • Why Hibit DEX
    • Hibit L1 Features
  • Core mechanisms
    • ๐Ÿ“œHybrid Consensus Protocol
    • ๐Ÿ”AI-Driven Tokenization & Intelligent Interactions
    • โ›ฝOmni-Chain Compatibility
    • ๐Ÿง AI-Powered Liquidity & Order Matching Engine
    • ๐ŸงฉScalable & Sustainable Cross-Chain Solutions
    • ๐Ÿ’ปDevelopment Achievements
    • ๐Ÿ’ Transparency & Open Infrastructure
  • AI-Driven Future and Ecosystem
    • ๐Ÿ“Trading Hub
    • ๐ŸถMeme Economy
    • ๐Ÿ’ธAI-Integrated Wallet
    • ๐Ÿ’ฑPayment System
    • ๐ŸŒฒInfrastructure and Ecosystem
  • Get started
    • ๐Ÿ”‘Login
    • ๐Ÿ’ตDeposit
    • ๐Ÿ“ŠTrade
    • ๐Ÿ’ฐFee Structure
    • โ›ฒWithdrawal
    • ๐Ÿš€Token Listing
      • ๐ŸŒŸBasic mode
      • ๐ŸŽ“Pro mode
    • ๐Ÿ’ณManage Liquidity
    • ๐Ÿ’ธLiquidity Provider
    • โ“Q & A
      • Why Swap Orders Get Cancelled?
  • Developers
    • API
      • Basic
        • get timestamp
        • get chains
        • get assets
        • get asset
      • Market
        • get markets
        • get market
        • get 24hr ticker
        • get extended 24โ€‘hr ticker
        • get kline
        • get swap info
        • get depth
        • get trade history
      • Order
        • get orders
        • get order
        • get trades of order
        • submit spot order
        • cancel spot order
      • Wallet
        • get nonce
        • get balances
      • Broker
        • Get payment address
        • Quote
        • Swap
        • Get agent order
    • Dev SDK
    • Getting Your Proxy Key
  • Risk Management
  • Rewards Program
  • Roadmap
  • Glossary
Powered by GitBook
On this page
  1. Developers
  2. API
  3. Broker

Quote

Provide quotes for exchanges so that the returned quote value can be used to submit the actual swap request.

PreviousGet payment addressNextSwap

Last updated 23 days ago

Code example

import { brokerClient } from '@delandlabs/hibit-sdk';

const options = {
  network: HibitNetwork.Testnet
};
brokerClient.setOptions(options);

const req: QuoteInput = {
        sourceChainId:  new ChainId(Chain.Kaspa, ChainNetwork.KaspaTestNet)
        sourceAssetType: ChainAssetType.Native, 
        sourceVolume: BigInt(input.sourceVolume),
        // targetChainId: new ChainId(Chain.Ethereum, ChainNetwork.BscTest), // undefined means same as source chain id
        targetAssetType: ChainAssetType.ERC20,
        targetAsset: "erc20_token_contract_address"
      };
const res = await brokerClient.quote(req);

SDK

Source code

https://github.com/Deland-Labs/hibit-sdk

Quote exchange rate

get

Quotes the exchange rate between two assets.

Query parameters
SourceChainIdstringOptional

The blockchain where the source asset currently resides (e.g., Bitcoin, Ethereum, Kaspa).

SourceAssetTypestringOptional

The type of the source asset (Native, SPL, ERC20, KRC20 etc.). Determines how the asset is identified and processed.

SourceAssetstringOptional

The identifier for the source asset - either a contract address for tokens or a ticker symbol. Should be null when SourceAssetType is Native (e.g., BTC, ETH, KAS).

SourceVolumestring ยท stringOptional

The amount of source asset to be exchanged/transferred, expressed in the smallest unit of the asset (e.g., satoshi for Bitcoin, wei for Ethereum).

TargetChainIdstringOptional

The destination blockchain for the exchange operation. When null, the system will use the same chain as the source (intra-chain operation).

TargetAssetTypestringOptional

The type of the target asset to receive. When null, the system will use the same asset type as the source.

TargetAssetstringOptional

The identifier for the target asset - either a contract address for tokens or a ticker symbol. Should be null when TargetAssetType is Native (e.g., BTC, ETH, KAS).

Responses
200
OK
400
Bad Request
401
Unauthorized
403
Forbidden
404
Not Found
500
Internal Server Error
501
Not Implemented
get
GET /v1/quote HTTP/1.1
Host: testnetbrokerapi.hibit.app
Accept: */*
{
  "code": 1,
  "message": "text",
  "data": {
    "targetChainId": "text",
    "targetVolume": "text",
    "receiveVolume": "text",
    "gasFee": "text",
    "brokerFee": "text",
    "brokerFeeRate": 1,
    "priceImpact": 1,
    "slippage": 1,
    "targetVolumeInUsd": 1
  }
}
  • GETQuote exchange rate
  • Code example
  • SDK