0

A market offer is, for example, a bid offer that takes on an outstanding ask offer at the same price and amount, and vice versa. Since the offer will get filled immediately, will the network reject the transaction if the XLM balance of the source account is not sufficient for another subentry (triggered by the new offer) and the transaction fee? In other words, will the new offer trigger a new subentry for purposes of calculating the XLM minimum balance in order to determine whether the network will let the transaction through or not?

0

It was an issue with the older protocol version (up to v9), addressed by CAP-0003 in protocol v10. It wasn't possible to go under the base reserve amount, but anyone could create multiple offers not backed by corresponding asset balance.

Now when a new offer is placed on Stelalr DEX, the corresponding buying/selling liabilities are reserved on the account balance in advance, so it's not possible to submit an offer that exceeds you actually available balance.

Starting in protocol version 10, it is no longer possible for an offer to be invalidated because the account owning the offer no longer has the asset for sale. Each offer contributes selling liabilities for the selling asset and buying liabilities for the buying asset, which are aggregated in the account (for lumens) or trustline (for other assets) owned by the account creating the offer. Any operation that would cause an account to be unable to satisfy its liabilities, such as sending away too much balance, will fail. This guarantees that any offer in the orderbook can be executed entirely.

The above also relates to transaction fees paid by the account. If xlm balance - (buying_liabilities + selling_liabilities) < fee, the transaction will be rejected.

  • Does the market offer require the 0.5 XLM reserve (required for each offer in general) such that if the XLM available balance is less than the fee plus 0.5 XLM, the transaction will be rejected? – J R Sep 29 at 18:45
  • 1
    Interesting question. Curios about it as well, need to check this on the testnet. Also, if you want to execute market order in the fill-or-kill fashion, it's better to use PathPayment with destination=source (so-called self PathPayment) for this purpose, as it doesn't create a new offer on DEX (and thus doesn't have balance requirements) if the taker offer hasn't been executed in full immediately after transaction execution (standard ManageOffer behavior). – Orbit Lens Sep 29 at 19:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.