🔬
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
  2. Quote Methodology

Amount of Murabaha Token Required (AMTR)

Unlike a generic swap, in a Murabaha transaction the user does not have the currency token (ie, USDT) to facilitate a swap that would result in them receiving some token (ie, ARB). The currency token is being provided by the AZKA liquidity providers. These LP's are willing to purchase the token on behalf of the Murabaha taker and sell it to them at a markup profit, generating a debt that must be repaid by some date. Hence, it is logical to assume that the Murabaha taker has some idea as to the amount of token they require (This is essentially the AMTR or 'Amount of Murabaha Token Required'). The LP's need to provide the correct amount of currency token that would result in a swap which satisfies the Murabaha takers request. What the Murabaha Order book needs to do is the following:

  1. Conduct a reverse DEX aggregator query that identifies the amount (A) of the currency token (ie USDT) that is needed to facilitate a swap that would result in the 'AMTR'. The amount (A) obtained is essentially the DEX aggregator Quote (Q) and represents the base debt (ex additional protocol fees) in the currency token that the user would would owe the pool. The DEX aggregator quote/base debt is what will be taken from the pool to facilitate the takers request.

  2. The price impact and swap fees are contained in the DEX Aggregator quote. Price impact will be displayed on the UI for the user to asses the real cost of the swap with regards to the global market price.

  3. In order to ensure that the ‘Amount received’ by the Murabaha Taker is equal ‘Amount of Murabaha token required (AMTR)’ that was requested, the Murabaha Order Book would add the slippage onto this AMTR as follows:

AMTR (Slippage Adjusted)=AMTR×(1+slippage tolerance)\text{AMTR (Slippage Adjusted)} = \text{AMTR} \times (1 + \text{slippage tolerance})AMTR (Slippage Adjusted)=AMTR×(1+slippage tolerance)

This would generate a DEX aggregator quote that ensures; after execution; that the amount of tokens received is no less than what is required by the taker. As mentioned previously, in most cases the slippage will not be incurred and the taker will end up with slightly more than quoted. With regards to Shariah compliance, it is required that taker does not receive less than the quote in order for the Murabaha to be valid, albeit receiving more than the quote is acceptable. Given the nature of the operating environment and MEV dynamics, reverting transactions that still bear a gas cost are also deemed as an acceptable situation under the justification that there is no influence or control over the occurrence.

  1. The Murabaha Aggregator/Order Book then adds on any additional Fees to the DEX quote/Base Debt as follows:

Deferred Payment=DEX Quote×(1+((Murabaha Fee Rate+Protocol fee)×D365)){\small \text{Deferred Payment} = \text{DEX Quote} \times \left(1 + \left( (\text{Murabaha Fee Rate} + \text{Protocol fee}) \times \frac{D}{365} \right)\right)}Deferred Payment=DEX Quote×(1+((Murabaha Fee Rate+Protocol fee)×365D​))

We can break down the Murabaha Transaction as follows:

The Sum Debts Owed to the pool = Deferred Payment

Base Debt to Pool = DEX Quote

Pool Profit = DEX Quote * ( (Murabaha Fee Rate *(D) ) / 365)

AZKA Protocol Profit = DEX Quote * ( (Protocol Fee *(D) ) / 365)

  1. The Murabaha and protocol fees are a compensation for the providing this financing up front for the specified duration. It is possible; that due to the pool already having a high utilisation and/or the impact of the DEX Quote/Base debt on the pools utilisation; the Murabaha fee and Protocol fee is quite high. This coupled with price impact and gas fees might make the Murabaha transaction unfeasible for the taker.

Example: Feasibility of a AMTR Transaction with low price impact

Lets assume a user requires 1000 ARB tokens. Let us further assume that the user is willing to repay the debt after 180 days and would like the debt to be denominated in USDT. The global price for USDT/ARB is 1 ARB per USDT.

In the AZKA UI the user fills the relevant fields, selects the default slippage tolerance and specifies the AMTR to be 1000 ARB.

The Murabaha Aggregator/Order Book adds the default slippage (0.5%) to the AMTR and generates a DEX Quote of 1010 USDT. We can assume that the price impact on such a swap is negligible (ie, 0%) and swap fees as well as slippage are accounted for in the quote.

Lets further assume that the Murabaha Fee rate and protocol fee are 5% and 1% respectively (per annum), and the size of the quote doesn't change the utilisation of the AZKA USDT pool such that these rates are impacted significantly.

The base debt is essentially the DEX Quote and Murabaha Fee's and Protocol Fees are applied using the formula as follows:

Deferred Payment = 1010 USDT * (1 + ( (0.05 + 0.01 ) * (180/365) ) )

Deferred Payment = 1010 USDT * (1 + ( (0.06 * 0.493 ) )

Deferred Payment = 1010 USDT * 1.029589

Therefore the Deferred Payment is equal to 1,039.885 USDT.

The user would need to pay this amount no later than the 180 day expiration date.

Lets assume this was a Ethereum based transaction that would incur a gas fee of $5 or 5 USDT in ETH terms. The true cost of this debt would be 1,044.88493 USDT.

What does this tell us?

Well it basically tells us that if we want to receive finance of 1000 ARB tokens which have a market value of 1000 USDT (based on global price) for a duration of 180 days, we would incur a debt of 1,039.885 USDT to the AZKA USDT pool. For the Murabaha taker the true gas adjusted cost of this debt is 1,044.88493 USDT.

If the user is happy with these parameters, they can execute the transaction and expect to receive no less than 1000 ARB tokens. If slippage is not incurred, they will receive 1005 ARB tokens. If the slippage tolerance is not enough to absorb a severe broad market movement then the transaction could revert and still cost the user 5$ for broadcasting the transaction.

In the most likely scenario the user receives 1005 ARB tokens. Based on the global market price of USDT/ARB, these 1005 ARB tokens have a market value of 1005 USDT. Essentially; in order to obtain financing; the user is paying 39.8849 USDT (1,044.88493 - 1005) more than the market value of the ARB tokens received.

If the user received 1000 ARB tokens. Based on the global market price of USDT/ARB, these 1000 ARB tokens have a market value of 1000 USDT. Essentially; in order to obtain financing; the user is paying 44.88493 USDT (1,044.88493 - 1000) more than the market value of the ARB tokens received.

Example: Feasibility of a AMTR Transaction with high price impact

Lets assume a user requires 1,000,000 ARB tokens. Let us further assume that the user is willing to repay the debt after 180 days and would like the debt to be denominated in USDT. The global price for USDT/ARB is 1 UNI per USDT.

In the AZKA UI the user fills the relevant fields, selects the default slippage tolerance and specifies the AMTR to be 1000 ARB.

The Murabaha Aggregator/Order Book adds the default slippage (0.5%) to the AMTR and generates a DEX Quote of 1,023,000 USDT. Lets assume that the price impact on such a swap is approximately 1.3%. Swap fees are 0.5% and slippage is 0.5% amounting to approximately 1%. Both are accounted for in the quote. From the get go, the user is exercising a swap that is at most 2.3% below the market value and at least 1.8% below the market value

Lets further assume that the Murabaha Fee rate and protocol fee; at current pool utilisation; are 5% and 1% respectively (per annum), but the size of the quote would impact the AZKA USDT pool's utilisation significantly, resulting in the rates to change to 15% and 1.5% respectively (per annum) .

The base debt is essentially the DEX Quote and Murabaha Fee's and Protocol Fees are applied using the formula as follows:

Deferred Payment = 1,023,000 USDT * (1 + ( (0.15 + 0.015 ) * (180/365) ) )

Deferred Payment = 1,023,000 USDT * (1 + ( (0.165 * 0.493 ) )

Deferred Payment = 1,023,000 USDT * 1.081369

Therefore the Deferred Payment is equal to 1,106,241.37 USDT.

The user would need to pay this amount no later than the 180 day expiration date.

Lets assume this was a Ethereum based transaction that would incur a gas fee of $1000 or 1000 USDT in ETH terms. The true cost of this debt would be 1,107,241.37 USDT.

What does this tell us?

Well it basically tells us that if we want to receive finance of 1,000,000 ARB tokens which have a market value of 1,000,000 USDT (based on global price) for a duration of 180 days, we would incur a debt of 11,106,241.37 USDT to the AZKA USDT pool. For the Murabaha taker the true gas adjusted cost of this debt is 1,107,241.37 USDT.

If the user is happy with these parameters, they can execute the transaction and expect to receive no less than 1,000,000 ARB tokens. If slippage is not incurred, they will receive 1,005,000 ARB tokens. If the slippage tolerance is not enough to absorb a severe broad market movement then the transaction could revert and still cost the user 1000$ for broadcasting the transaction.

For larger transactions it is more likely that MEV agents try to extract value from the swap and hence it is more likely that slippage is incurred.

If the user received 1,000,000 ARB tokens. Based on the global market price of USDT/UNI, these 1,000,000 ARB tokens have a market value of 1,000,000 USDT. Essentially; in order to obtain financing; the user is paying 107,241.37 USDT (1,107,241.37 - 1,000,000) more than the market value of the ARB tokens received. Which is approximately 10.7% more expensive. This is a result of the price impact and higher Murabaha Fee/Protocol Fee. The price impact described in this example is a true representation of the price impact of such a swap at the time of writing. It is unclear what the underlying liquidity of the AZKA USDT pool will be and subsequently what the Murabaha/protocol fees will be. This example illustrates how internal and external liquidity constraints make Murabaha more expensive and costly.

PreviousQuote MethodologyNextRequired Amount of Currency (RAC)

Last updated 1 year ago