Quote display and user preferences | Developers

Quote display and user preferences

Estimated reading time: 2 minutes

Input

To chose a swap service, the user selects:

  1. A source cryptocurrency and a source account
  2. An amount from the source account to swap
  3. The destination cryptocurrency and the destination account
  4. The maximum available amount in the selected source account. The displayed maximum includes the network fees to send the funds to the partner address (payinNetworkFees):
    • a. In case they swap from the native coin, the maximum amount equals to : available balance - payinNetworkFees
    • b. In case they swap from a token, it equals to : available balance (fees are paid in native coin)

Output

According to the input amount, the partner’s API is called to get a quote and check several conditions:

  • Region (AVAILABLE / NOT AVAILABLE)
  • Token (AVAILABLE / NOT AVAILABLE)
  • Amount (TOO LOW / TOO HIGH)

If all of the above conditions are validated, the partners are displayed in Ledger Live, sorted by price (lowest price on top), with the following information:

  1. Network fees to send crypto to partners - payinNetworkFees
  2. Partner quote
    • a. Partner image
    • b. Partner name
    • c. Registration policy of the partner : Needed / Not needed
    • d. Exchange rate of the current swap, after all fees are applied: ex : 1 ETH = 0.0549919 BTC
    • e. Fixed or Floating: When it is fixed, the quote is guaranteed. The user must accept the quote within a certain amount of time (the quote must be guaranteed for at least 60 seconds). When it is floating, the quote is not guaranteed. The user can receive less than the quote according to the market fluctuation but should be protected against a maximum slippage defined by the partner
    • f. Receiving amount: ex = want to Swap 0.04301 ETH, receiving 0.0023652 BTC
      • Quote calculation : {Swap rate output}* (1 - Ledger Fee - Partner fee) - Withdrawal fee.
        With:
        • - Swap rate output: Rate provided by partner
        • - Withdrawal fee : Paid by the user to cover gas from the Partner to Ledger
        • - Ledger fee : fee to be paid to Ledger
        • - Partner fee: fee taken by the partner
        Fees for sending the transaction payinNetworkFees (from Ledger to the partner) are not included in the displayed quote
    • g. time out = 5s. partner must reply in less that 10s, otherwise the quote is not displayed in the quote results. The user needs to trigger a quote again, or wait for timeout

User Preferences

The user can use filters and and change the network fee strategy to find the swap service fit to their need and preferences.

Filters

The options are:

  • Decentralized exchanges/ Centralized exchanges
  • Fixed quotes/ Floating quotes

Fees

The user can change network fees according to the speed of the transaction:

  • Slow
  • Medium
  • Fast

Did you find this page helpful?


How would you improve this page for developers?



Partner Live App
Getting Started
Theme Features
Customization

Swap