TransWikia.com

Will a market offer trigger a new subentry?

Stellar Asked by J R on August 21, 2021

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?

One Answer

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.

Answered by Orbit Lens on August 21, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP