0

I have private network, created 6 assets(a,b,c,d,e,f), 6 accounts(1,2,3,4,5,6),all accounts trust all 6 assets. Let account 1 created a selling order using "manageSellOffer" operation and where

selling: a,
buying: b,
amount: "2",
price: "1",
offerId: 0 

Similarly i have created fiurther selling order where account 2

selling: b,
buying: c,
amount: "2",
price: "1",
offerId: 0

Similarly, created further ordersfor account 3,4,5 and 6 where account 6 order looks like

selling: f,
buying: a,
amount: "2",
price: "1",
offerId: 0

Now, account 1 wants to send asset "a" to account 6 with destination asset "f" thorugh "pathPaymentStrictReceive" operation which looks like

 Stellar.Operation.pathPaymentStrictReceive({
      sendAsset: a,
      sendMax: "1",
      destination: account6,
      destAsset: f,
      destAmount: "1",
      path: [b,c,d,e]
    })

Here,inside path, i have mentioned all intermediary assets which can help in conversion of "a" to "f". But it is showing an error "op_too_few_offers". i have even tried below

    Stellar.Operation.pathPaymentStrictReceive({
      sendAsset: c,
      sendMax: "1",
      destination: account6,
      destAsset: e,
      destAmount: "1",
      path: [d]
    })

But, still it is throwing same error. Even created XLM selling order with asset "c" (also changed the path:[Stellar.Asset.native()]) and used the same "pathPaymentStrictReceive" operation as mentioned above but still throwing the same error. What am i doing wrong here?

  • Have you checked that your outstanding offers really exist on the network? op_too_few_offers error means that there in not enough liquidity on the market (not enough outstanding offers) to execute the conversions. Maybe you have already matched some of you own offers earlier. Are you running into this issue on Stellar testnet or you private network? If the testnet, you can find all your assets and check the orderbooks here: stellar.expert/explorer/testnet – Orbit Lens Dec 8 '19 at 22:00
  • First, it a private network. Outstanding offers exist as i have checked my node database "offers" table and also the offers are there. the user of the operation "pathPaymentStrictSend" is new user who have never made any offers and also the destination address do not have any order in the orderbook. Also sir, i mentioned in the question that path already exist,it means one trade is between asset A and asset B , the other trade between Asset B and Asset C.and this new user trying using pathPaymentStrictSend operation where is sending asset A and want that Asset C should be received – Suman Raj Dec 10 '19 at 7:49
  • 1
    I understand your case, and it should work just fine as path payments are stable and always get executed predictably on the mainnet. I just throwing ideas, as it's hard to debug code without actually seeing it. One more thought, check the direction of your offers. It's really easy to get confused and create an offer selling asset B for asset A instead of selling asset A for asset B. Maybe your path payment will work in the reverse direction (i.e. C->B->A) – Orbit Lens Dec 10 '19 at 15:42
  • @OrbitLens i changed and it worked but it is working only on 3 assets and not working in case of D->C->B->A. Also, i want to ask that in my horizon database there are few tables like trustlines, offers etc(which added because of "horizon db migrate up", these all tables are blank. whats the significance of that? Also, i am running stellar core version 0.12.0 and horizon 0.23.0,stellar sdk is also to the latest version. Still why for functions like "pathPaymentStrictSend" , it is throwing error "op_not_supported"? – Suman Raj Dec 11 '19 at 12:08

Your Answer

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

Browse other questions tagged or ask your own question.