🔬
Product Docs
  • Welcome to AZKA FINANCE
  • AZKA Token Murabaha Overview
    • General
    • System Components
    • Protocol Architecture
    • Token Types
    • Use Cases
    • AZKA RoadMap
  • Murabaha Pools V1
    • Providing Liquidity
    • Pool Metrics
    • vROI
    • Murabaha Fee Rate Curve
    • Shariah Considerations
  • Executing Murabaha V1
    • Pre-Requisites
    • Initiating Murabaha
    • Executing Murabaha
    • Quote Methodology
      • Amount of Murabaha Token Required (AMTR)
      • Required Amount of Currency (RAC)
    • Shariah Considerations
  • Managing Murabaha V1
    • Managing Murabaha
    • Liquidation Parameters
    • Liquidation Mechanics
    • Shariah Considerations
  • Token Murabaha Risk Framework
    • General
    • Asset Risk
    • Liquidity Pool Risk
    • Liquidation Risk
    • Risk Parameters
  • AZKA Token Design and Tokenomics
    • General
    • Specific Utilities (AZKA, vAZKA, dLP)
    • Token Distribution
    • vAZKA
      • vAZKA Reward Distribution
    • dLP (Dynamic LP)
      • Initiating dLP
      • vAZKA Murabaha Eligibility
      • Managing Eligibility
      • Claiming vAZKA
  • Governance
    • General
    • DAO Structure and Policies
    • azTeams
  • Developer Docs
    • Murabaha Pools
    • Executing Murabaha
    • Liquidations
Powered by GitBook
On this page
  1. Executing Murabaha V1

Quote Methodology

A user requesting Murabaha can incur a few deductions that may make the Murabaha unfeasible for them. A user requesting Murabaha will incur a gas cost for the transaction as well as swap fees (albeit the swap fee is accounted for in the DEX aggregator quote). Price impact is dependent on the size of the Murabaha request compared to available liquidity. Slippage is a possibility, but it is not guaranteed that a Murabaha taker will experience this cost. Before elaborating on how AZKA generates Murabaha based quotes, we will describe how a general swap can be viewed in terms of its real cost.

A DEX aggregator usually provides a quote that accounts for swap fees and price impact such that:

DEX Quote=Global Price×(1−(swap fees+price impact))\text{DEX Quote} = \text{Global Price} \times \left( 1 - (\text{swap fees} + \text{price impact}) \right)DEX Quote=Global Price×(1−(swap fees+price impact))

The general formula to asses the real cost of sourcing any type of token from a DEX aggregator would be:

Real cost of Swap=(DEX Quote×(1−slippage))−Gas Cost\text{Real cost of Swap} = \left( \text{DEX Quote} \times (1 - \text{slippage}) \right) - \text{Gas Cost}Real cost of Swap=(DEX Quote×(1−slippage))−Gas Cost
example to illustrate the real cost of a swap

lets assume a user has 1000 USDT that they want to swap for UNI token, let us further assume that the global price for USDT/UNI is 1 UNI per USDT.

The DEX aggregator will find the most optimal path and source the liquidity from various different DEX's.

Typically a swap fee of 0.5% is incurred on swaps and it is possible that the DEX aggregator takes a small fee also say 0.1%.

We can also assume the slippage is set to a default value of 0.5% and that the price impact of such a small trade is negligible (ie, 0%).

The gas cost can vary depending on which network is being used (ie, Ethereum or Arbitrum) and the congestion of the network at the time of execution. Lets assume the transaction is on Ethereum and incurs a $2 Gas cost. Although gas costs are usually priced in the native currency of the network (ie, in ETH), we can account for them in USD terms or any other token when trying to asses the real cost of our transaction. We can assume that the gas cost is equivalent to 2 UNI tokens based on the global USDT/UNI price. (Typically for such small swaps it makes more sense to execute on a Layer 2 like Arbitrum).

Lets assume that the DEX Aggregator applies the swap fees (0.6%) and price impact (0%), quoting 994 UNI for 1000 USDT . It is possible; but not guaranteed; that once executed the swap may also incur the slippage and result in the user receiving 989 UNI instead of 994 UNI.

If we account for the cost of gas; although the user will receive 989 UNI or 994 UNI; we can assume the real gas adjusted value of the swap is 987 UNI or 992 UNI depending on whether or not slippage was realised. What we can observe from this is that the real cost of the swap could be 1.3% or 0.8% more expensive than the global price.

If we assume a very large swap of say 1 million USDT, it is possible that such a swap may be too large (depending on which network it is being executed) in proportion to the available liquidity to generate a 0% price impact, making the real cost of the swap more expensive.

PreviousExecuting MurabahaNextAmount of Murabaha Token Required (AMTR)

Last updated 1 year ago