Skip to main content

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.

At a glance
  • 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​

FeePaid byPaid toWhenHow much
Network feeWhoever sends the transactionThe network, in DUSTEvery transactionSet by the network
Protocol feeThe lender, out of interestAMP FinanceWhen a loan is repaidA percentage of the interest, per market
Late feeThe borrowerThe lenderWhen a loan is repaid during the grace windowA 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.

StageWhat is happening
Checking the contractThe 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 keyMidnight 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 proofThe wallet builds the proof on the device. This is the slow step.
Waiting for wallet approvalThe wallet shows the transaction and asks for approval.
Sending to the networkThe transaction is submitted.
Waiting for the blockThe 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.

MessageWhat it meansWhat to do
Your wallet has not finished loadingThe wallet is locked or still starting upOpen it, unlock it if asked, then try again
Your wallet is still syncingThe wallet has not caught up with the networkWait and try again
Your wallet has no DUST ready to pay the feeDUST has run out or has not built up yetWait a few minutes, or hold more NIGHT, then try again
Your wallet declined the transactionApproval was dismissed; nothing happenedTry again when ready
Your wallet closed before the transaction finishedThe wallet window was closed part way throughCheck Positions or the wallet first, then try again and keep the wallet open until it is done
Your wallet did not answerThe wallet extension had gone idleOpen the wallet once so it wakes up, then try again
The proof server could not be reachedThe service that builds the proof was unavailable, so nothing was sentTry again in a moment
That offer changed under youSomeone else drew from the offer firstReload the board and choose again
This request already went throughA retry of something that had in fact landedCheck Positions before trying again
Your wallet could not put the transaction togetherUsually a DUST shortfall, or not enough of the token being sentCheck both balances
Your computer's clock disagrees with the chain'sBorrowing pins a start time; a clock far from the network's is refusedCorrect the clock and retry
This market's fees changed while you were composingThe market's rates were updated mid-wayReload and review again
Nothing to shield (or to repay, claim and so on)The amount was zeroEnter an amount
… a deployment problem, not a problem with your requestThe interface and the contract it is using do not matchNothing to fix on your side. Report it to team@ampfinance.io
The repay (or the shield, the claim and so on) did not go throughAnything elseTry again. If it keeps failing, report it to team@ampfinance.io
Before retrying

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.