LogoLogo
  • ☠️Introduction
    • What is Clipper?
    • How Clipper Makes Money for LPs
    • How LPs Earn from Arbitrage
    • Clipper's Benchmark: No Impermanent Loss
      • Clipper vs. CPMMs vs. HODLing
      • Appendix: Math
    • Why Clipper Has Better Trading Prices
    • DAO Protocol Fees
    • DAO Governance
  • ⚔️How to Use Clipper
    • Liquidity Pools
      • Depositing & Withdrawing
      • Farming Pools
    • Trading
    • Community Adventures
    • FAQs
  • 🪙Governance Token
    • Community Governance
    • ⛵SAIL Primer
      • Clipper Fundamentals
      • DEX Market Structure
      • SAIL Supply & Circulation
      • SAIL Farming
      • veSAIL
      • Token Listings
  • 🏴‍☠️Disclaimers & Technical
    • Audits
    • Smart Contracts
      • Subgraph
        • Entities
        • Queries
    • Integrating with Clipper RFQ
      • Introduction
      • Guides
        • How to use clipper RFQ API?
        • Estimate Clipper Prices
        • Interacting with the Clipper Exchange contracts
        • Integration Examples
          • Swap Native token → Shorttail
          • Swap Shorttail → Native token
          • Swap Shorttail → Shorttail
          • Complete Swap Flow
      • API Reference
        • API v2
          • Overview
          • Pool v2
          • Quote v2
        • API v1
          • Overview
          • Pool
          • Quote
          • Sign
      • Troubleshooting & FAQs
    • Terms of Service
    • Privacy Policy
  • ⛵Come Aboard
    • Discord
    • Twitter
    • Github
Powered by GitBook
On this page
  • URL
  • Request
  • Response
  • Examples

Was this helpful?

  1. Disclaimers & Technical
  2. Integrating with Clipper RFQ
  3. API Reference
  4. API v2

Quote v2

This endpoint facilitates the creation of a potential quote for executing a swap between two assets. It allows users to obtain pricing information and other essential details necessary to initiate asset swaps within the system. Use this endpoint to explore the potential cost and feasibility of asset exchanges before finalizing transactions.

URL

https://api.clipper.exchange/rfq/v2/quote/{CHAIN_ID}

Request

Path Param
Description
Example

chain

Integer - Required ID of the chain

chain_id=137

Query Param
Description
Example

pool_address

str - Optional Address of the pool. If not present, the best pool will be calculated

pool_address=0x655eDCE464CC797526600a462A8154650EEe4B77

time_in_seconds

Integer - Optional Amount of time between accepting a quote and receiving the quote on the blockchain. As this value increases, the quote will get worse for the user.

time_in_seconds=30

output_amount

Integer/String - Optional Desired quantity of assets to receive as part of the swap This field is mutually exclusive with input_amount

output_amount=18000

input_amount

Integer/String - Optional Desired quantity of assets you are willing to exchange This field is mutually exclusive with output_amount

input_amount=18000

input_asset_symbol

input_asset_symbol=ETH

output_asset_symbol

output_asset_symbol=DAI

Response

Quote object

Field
Description

id

String(UUID) - Id of the quote, use this value when signing a quote

must_accept_by

String - Human-readable UTC timestamp by which you must accept the quote and should be expected to be a short duration. If this time has passed already, request a new quote - the server will not sign a quote after must_accept_by has passed

good_until

Integer - number of seconds that quotes live

chain_id

Integer - Represents the ID of the chain

input_asset_address

String - Contract address of the asset you want to provide for the swap

input_amount

String - Amount of assets to be exchanged

output_asset_address

String - Contract address of the asset you want to receive in the swap

output_amount

String - Amount of assets you will receive in the exchange

input_value_in_usd

Float - Amount in dollars to be exchanged

output_value_in_usd

Float - Amount in dollars you will receive in the exchange

created_at

Integer - Unix Timestamp indicating the date and time when the quote was created

rate

Float - swap rate

Examples

If you want to create a quote to make a swap from ETH to USDC in Ethereum Mainnet (chain_id=1)

Request

curl -X GET "https://api.clipper.exchange/rfq/v2/quote/1?pool_address=0x655eDCE464CC797526600a462A8154650EEe4B77&time_in_seconds=60&output_asset_symbol=USDC&input_asset_symbol=ETH&input_amount=10000000000000000000" \
-H "x-api-key: mQzA8Uy6nZ8Vyh" \
-H "Content-Type: application/json"

Response

{
    "id": "05a51aa6-41b5-4c61-a452-f1b95d0d43e4",
    "must_accept_by": "2023-10-13 22:24:20.932560+00:00",
    "good_until": 1697235920,
    "chain_id": 1,
    "input_amount": "10000000000000000000",
    "output_amount": "5661947917",
    "input_value_in_usd": 15595.15,
    "output_value_in_usd": 5668.12,
    "created_at": 1697235848,
    "rate": 566.1947917,
    "input_asset_address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "output_asset_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
}
PreviousPool v2NextAPI v1

Last updated 2 months ago

Was this helpful?

String - Required Identifier of the asset you want to provide for the swap Should correspond to the asset name returned from the call

String - Required Identifier of the asset you want to receive in the swap Should correspond to the asset name returned from the call

🏴‍☠️
pool
pool