Hot answers tagged

4 votes
Accepted

What happens to offers that are completely fulfilled and are no longer part of orderbook?

Yes, assuming that the offers are completely fulfilled (i.e. not partially fulfilled), they're removed from the account and reserve lowered.
  • 86
3 votes
Accepted

Can anyone explain what passive offers achieve?

The link provides purpose in a nutshell: Passive offers allow market makers to have zero spread. If you want to trade EUR for USD at 1:1 price and USD for EUR also at 1:1, you can create two ...
  • 416
3 votes
Accepted

How to get the accurate amount of bids?

I think the confusion comes from the fact that Stellar offers amount is always quoted in the amount of the selling asset. When you are selling 10000 XLM for USD the ask offers shows 10000 as expected,...
  • 1,376
2 votes

op_cross_self - while making a new offer

It is the MANAGE_OFFER_CROSS_SELF error described in the guides and it prevents you from unintentionally fullfilling your own previous offer: The account has opposite offer of equal or lesser price ...
  • 2,524
2 votes
Accepted

How to know if an outstanding offer was a product of a buy or a sell offer?

The offer on the orderbook is always a sell offer regardless whether it was created as a result of ManageBuyOffer, ManageSellOffer, or ManagePassiveSellOffer operation. There is no easy way to find ...
  • 6,846
2 votes
Accepted

Various errors in submitting offers

You have to provide buyAmount instead of amount in manageBuyOffer operations. The 400 error on the testnet may be cause by different reasons: no trustline, not enough funds, invalid signers, etc. ...
  • 6,846
1 vote
Accepted

Use case: how to accept only one payment for an item

If each product you are selling is unique (say, art objects), all of them can be treated as non-fungible tokens. Take a look at my write-up on different Stellar-based NFT approaches here. SDF has no ...
  • 6,846
1 vote

Use case: how to accept only one payment for an item

Or just post the product as an offer, given you've created an asset for it. Whoever takes the offer takes the product. If one wants to let the buyers bid, let them submit offers and the seller will ...
  • 157
1 vote

Use case: how to accept only one payment for an item

Don't know a good solution without drawbacks but here are some more ideas: Publishing the sequence number alone wouldn't be sufficient since the seller would also have to sign the transaction if they ...
  • 2,524
1 vote
Accepted

How to submit a buy offer that gets incorporated to a bid entry with the same price

I think the underlying problem is that the number 100/9 has infinite decimal digits and cannot be represented as string. The price you see, 11.1111111 is a truncation of 11.11111111.... = 100/9. When ...
  • 1,376
1 vote
Accepted

Which operations are required to accept an offer?

According to the Stellar developers' guide, a trade is effected when a second offer matching the first is posted.
  • 3,367
1 vote
Accepted

Python: Retrieve Offer_id from a manage offer operation?

It's contained in the horizon response which can be decoded like this: response = builder.submit() result_bytes = base64.b64decode(response['result_xdr']) tx_result = Xdr.StellarXDRUnpacker(...
  • 2,524
1 vote
Accepted

How to derive a number of open Offers for a transaction set that hasn't been fully submitted to the network yet

If you manage those "in-flight" transactions on your side, it won't be a problem. Call horizon.loadAccount('GD...QZ'). Check the subentry_count field. It shows the total number of trustlines/offers/...
  • 6,846
1 vote
Accepted

Fill or Kill (FOK) offers on Stellar?

It is not something that is currently supported. If you want to suggest adding it to the protocol you can do that by creating a Pull Request here
  • 1,070
1 vote

Order doesn't match in Stellar

I think it is a feature with NodeJS. They don't go deep to reveal every detail down an object. Note the difference at console.log: offerResult.records VS offerResult server.offers('accounts', ...
  • 1,517
1 vote

Making offer gives error: TypeError: opts.selling.toXDRObject is not a function

I found the answer. I was not representing the Assets that I need to sell properly. Replacing MCoin with new StellarSdk.Asset('MCoin', 'GCKRPJXPGNHBPMRCXEX4MDH532BN5RLUJJOMVACA3CB7E2LWSTKTB5U2') ...
1 vote

Best way to calculate exact offer price?

If you pass a string as a price in Operation.manageOffer JS SDK will use continued fraction approximation algorithm. I've just checked it and it approximates 41.5 to {n: 83, d: 2} which is fine. Not ...
1 vote

Bidding and asking price conversion on client or server?

The prices submitted to the blockchain must be in the format specified by the Stellar docs to actually reflect your intention. As for representing it on your client (or storing it on your server), ...
  • 1,070
1 vote

Bidding and asking price conversion on client or server?

Both would be fine. Caution: keep your price with at least 10 decimal places, because the system treats the bidding/asking price as fractions. Each price is stored as 2 integer variables: numerator ...
  • 1,517
1 vote
Accepted

How do folks keep offers in sync with market prices?

As far as I know, there is no other way at the moment. If you would do 1 operation with base fee per second (which is most probably huge overkill) for one day it would cost you less than 1XLM. Even ...
  • 146

Only top scored, non community-wiki answers of a minimum length are eligible