Fees and transactions
Three different things are called a fee around AMP Finance, paid by different people for different reasons. And every action is a transaction on Midnight, which is more involved than a signature.
- Network fees are paid in DUST, which comes from holding NIGHT
- The protocol fee is a share of the lender's interest, paid on repayment
- The late fee is a share of principal, paid by late borrowers to the lender
- A transaction takes tens of seconds; the first of each kind downloads a file
- Check positions before retrying anything
The three fees
| Fee | Paid by | Paid to | When | How much |
|---|---|---|---|---|
| Network fee | Whoever sends the transaction | The network, in DUST | Every transaction | Set by the network |
| Protocol fee | The lender, out of interest | AMP Finance | When a loan is repaid | A percentage of the interest, per market |
| Late fee | The borrower | The lender | When a loan is repaid during the grace window | A percentage of the principal, per market |
Network fees, paid in DUST
Every transaction on Midnight pays a network fee in DUST. DUST is unusual:
- It is not bought and cannot be sent to anyone. It is generated by holding NIGHT, building up over roughly a week to a cap that scales with the NIGHT held.
- It is shielded, so paying a fee does not reveal who paid it.
- The protocol cannot pay it on anyone's behalf. Every person pays their own.
In practice: hold some NIGHT, wait for DUST to accumulate, and the wallet will cover each transaction's fee from it. The account menu shows both balances. A wallet with no DUST cannot send anything, and the failure message names it.
The protocol fee, paid by lenders
AMP Finance takes a protocol fee on each loan that is repaid. It is a percentage of the interest, not of the principal, and it comes out of what the lender receives. A borrower's repayment is the same whether the fee is 0% or 10%.
The fee rate is fixed into an offer when it is posted, and every loan drawn from it carries the same rate, so it never changes for a position that already exists. Each market's page shows its current rate. If a loan is never repaid, there is no interest and no fee: the protocol earns nothing on a default. Markets and parameters has the details.
The late fee, paid by late borrowers
A borrower who repays after the due date but within the grace window pays a late fee on top of principal and interest. It is a percentage of the principal, fixed on the day the loan was drawn, and it goes entirely to the lender. The protocol takes no share of it.
What happens during a transaction
The interface shows each stage as it happens.
| Stage | What is happening |
|---|---|
| Checking the contract | The interface re-reads the offer, loan or market to make sure it is still in the state the screen shows. An offer that was drawn by someone else a moment ago is caught here, before anything is built. |
| Downloading the proving key | Midnight transactions are private, and proving one needs a large file specific to the action. It is downloaded once per action type and kept by the browser. |
| Building the proof | The wallet builds the proof on the device. This is the slow step. |
| Waiting for wallet approval | The wallet shows the transaction and asks for approval. |
| Sending to the network | The transaction is submitted. |
| Waiting for the block | The network confirms it. |
Expect the whole thing to take on the order of half a minute to a minute after approval, more the first time a given action is used.
Downloads on the first action
The file each action needs is between roughly 5 MB and 19 MB. Shielding and unshielding are at the small end; lending, borrowing and the claims are at the large end. The interface shows the size and progress. Once downloaded, a file is reused for every later transaction of that kind on the same browser.
When something does not go through
The interface reports every failure in a sentence, with the wallet's own detail underneath for anyone who needs it.
| Message | What it means | What to do |
|---|---|---|
| Your wallet has not finished loading | The wallet is locked or still starting up | Open it, unlock it if asked, then try again |
| Your wallet is still syncing | The wallet has not caught up with the network | Wait and try again |
| Your wallet has no DUST ready to pay the fee | DUST has run out or has not built up yet | Wait a few minutes, or hold more NIGHT, then try again |
| Your wallet declined the transaction | Approval was dismissed; nothing happened | Try again when ready |
| Your wallet closed before the transaction finished | The wallet window was closed part way through | Check Positions or the wallet first, then try again and keep the wallet open until it is done |
| Your wallet did not answer | The wallet extension had gone idle | Open the wallet once so it wakes up, then try again |
| The proof server could not be reached | The service that builds the proof was unavailable, so nothing was sent | Try again in a moment |
| That offer changed under you | Someone else drew from the offer first | Reload the board and choose again |
| This request already went through | A retry of something that had in fact landed | Check Positions before trying again |
| Your wallet could not put the transaction together | Usually a DUST shortfall, or not enough of the token being sent | Check both balances |
| Your computer's clock disagrees with the chain's | Borrowing pins a start time; a clock far from the network's is refused | Correct the clock and retry |
| This market's fees changed while you were composing | The market's rates were updated mid-way | Reload and review again |
| Nothing to shield (or to repay, claim and so on) | The amount was zero | Enter an amount |
| … a deployment problem, not a problem with your request | The interface and the contract it is using do not match | Nothing to fix on your side. Report it to team@ampfinance.io |
| The repay (or the shield, the claim and so on) did not go through | Anything else | Try again. If it keeps failing, report it to team@ampfinance.io |
A dismissed wallet window is not always a failure. The transaction may have been submitted and be waiting for its block. Before sending the same action again, open Positions or the wallet and check whether the first attempt landed. A second attempt after a successful first one is a second real transaction: a second offer, a second loan, or a second shield.