Selling asset for BTC on Dex

Correct me if I’m wrong, but it looks like the only real currency on Dex is XCP. Therefore it makes virtually impossible to raise funds for the asset/shares of the company in Dex in the amount equal to, let’s say, $400,000 without seriously moving XCP price. So the question is “Is it possible to sell the asset on DEX for BTC, and not XCP”? I think the answer is NO, but would like to hear arguments. Thx.

Kind of. You can sell stuff for BTC, but not from inside of Counterwallet (you’d have to use the API or CLI).
It was removed because people couldn’t get used to how it works (i.e. you need to wait a certain amount of time for confirmations, etc.).

Yes, but that’s regardless of where you sell for XCP.

Yes, you can (and should) sell your asset for BTC.
And you shouldn’t use DEx. You should use something like http://vennd.io
Also see this:
https://forums.counterparty.io/t/roll-your-own-on-a-centralized-exchange-masterxchange/624

Thank you, Something. Much appreciated!

You’re welcome @alexila!
By the way, if I recall correctly Storj sold about 300-400 K (in BTC) of SJCX (http://blockscan.com/assetInfo/SJCX). They used Vennd.io and it was very smooth as far as I could tell (based on my own experience - I bought some SJCX).

What sorta upsets me is the fact that company must go out of CP DEx to Vennd (Storj) or Koinify (Gems) to raise funds (in BTC). Then they move their assets back to Dex for trading BUT because of low XCP popularity and liquidity it’s not possible to achieve any significant trading volumes. Even if BTC was a second currency on Dex, it’s still not a clear entry for a general investor with cash.
I think Dex (CP) would benefit a lot by adding (at least) BTC to the base currency list. This way, it could get a piece of business from Vennd and Koinify.

It’s not really that one must go anywhere, it’s just that it may be more practical to do it that way.
I’m not promoting any particular approach, to be clear - I just highlighted those that I thought may be more suitable in case of a non-trivial issuance (e.g. > 100 BTC or whatever).

I would think that if one is having a relatively high-profile issuance, he probably wants to reach out to Regular Joe and make it as easy and user friendly as possible because it has to be a 2 minute operation (send BTC to the crowdsourcing address - done!).

For comparison, if that was done on DEx you’d need to create a wallet, send some BTC to it, and then place an order. Assuming you know what the symbol is and don’t place an order for STORJ instead of SJCX, you’re half done.
Then you need to remember to stay logged in for 10-15 minutes so that you can execute BTC pay. If you just place an order and close your browser tab/window, your order will fail because Counterparty can’t escrow BTC so you need to stay online to pay once the match is made and confirmations of that received (asset that’s being sold would be in protocol’s escrow, but your BTC wouldn’t).
There are ways to improve that, but there is no way to make a transaction faster than the blockchain takes to confirm them. It’s relatively safer to trade on DEx (no counterparty), but since one is buying a new asset, obviously some degree of trust has to be involved in the issuer and the vending solution he chose to use.

DEx works when used properly, but for crowdsourcing most people are new not only to Counterparty (and Counterwallet), but also to bitcoin, so it turns into a big barrier.

To be honest I didn’t look where they move it for trading.
In case fo GEMZ as far as I remember during crowdsourcing trading was’t possible and after it was finished, people were able to withdraw (and many withdrew to Poloniex). coinmarketcap.com shows where most trade happens for listed Counterparty assets and those that I traded were on Poloniex.

For the issuer, it’s very easy to use the CLI or API to make a huge asset sell order at the initial price (it’s a one line command, actually). Problem appears when a user new to DEx wants to buy stuff for BTC (aka: BTC_Pay; pay with BTC, sell BTC on DEx).

The vending machine approach is fast, user-friendly and flexible (e.g. can “lock” trading until the selling period is over, etc.).
Counterparty doesn’t make any revenue from the DEx and I think non-trivial crowdsourcing involves quite a few things (marketing, organization, etc.) so to me it makes sense that there are specialized organizations for that.

The MasterXchange approach is low cost, fast and simple. Buyers need to open an account and can trade the asset as soon as they buy it. However that can probably be done faster and without reading any instructions (compared to DEx), so it’s still more user friendly.

As the issuer you could certainly build a simple API gateway to the DEx and outsource market-making to someone, but that sounds way more expensive and complicated than any other choice that I mentioned.

Counterparty GUI v1.0 will come out soon.It will require counterparty-client, but it will be able to use public servers (both bitcoin and counterparty). Maybe someone will build a vending plugin or DEx plugin or Smart Contracts plugin that will be able to simplify crowdsourcing.

Quick update in this. We created 2 orders using API. One order to SELL asset for BTC and another to BUY.
http://www.blockscan.com/orderInfo/11603913
http://www.blockscan.com/orderInfo/11603912
Wallets for buyer and seller were opened for a few hours in different browsers. Orders were never executed and still have “open” status.
Therefore I can conclude this system is far from perfection. Any inputs?

It should be matched within a block, so that looks like a bug.
Submitted here (https://github.com/CounterpartyXCP/counterpartyd/issues/729).

I just tried on testnet using BTC amount > 0.001 (as proposed by @jpja) and the orders matched (https://github.com/CounterpartyXCP/counterpartyd/issues/729#issuecomment-84019122).

Order details: http://testnet.blockscan.com/orderInfo/2732

Try using more than the minimum amount of BTC.

We created new orders with amount of 0.0011 BTC
They matched, but the orders were not marked as “filled” and still stay in “open” status.
Also no actual exchange of OAZT to BTC was done.

  1. Order Info TX #11611649

  2. Order Info TX #11613220

Also, we noticed that match notification pops up only in one wallet.

Well you’re trading with BTC in Counterwallet, which is not supported as I explained above, so notifications may not work either.

Did you execute BTC_Pay from the CLI?

I just went through this procedure again, using two variants:

  • Asset for asset (automatically matched and executed, no issues)
  • Asset for BTC (automatically matched, but of course BTC_Pay had to be done manually, which is how it’s supposed to be done)

For the second case:

  • Seller of asset: order --source mvBrgbMAucRUQJFJ4Ddjog6FvL4JDQtoPZ --give-quantity 0.00101 --get-quantity 1 --get-asset GOLDBITCHEZ --give-asset BTC --fee-fraction-required 0 --fee-fraction-provided 0.01 --expiration 1000
  • Buyer of asset (i.e. seller of BTC): order --source mkZ6ECVZYtTE6iGZ6wvBfkw49KLAvsGhCM --get-quantity 0.00101 --give-quantity 1 --give-asset GOLDBITCHEZ --get-asset BTC --fee-fraction-required 0 --fee-fraction-provided 0.01 --expiration 1000

Then I wait until the orders get matched:

[INFO] Order Match: 0.00101 BTC for 1 GOLDBITCHEZ (971bd5ddfadeee623b21a903a3b53
d29987d6ceba96c6d4ffc9f2376d42e259d_4e38c89a828add14ad5db037fdbf2735b2de09b6c76f
c5d8a990ea7045a5ae6c) [pending]←[0m
[INFO] Block: 328548 (1.32s)←[0m

Now I could wait longer (say for 6 confirmations, and then I’d have time, within 20 blocks since the order was placed, to execute BTC_Pay), but this is on testnet so I just waited for order match to appear in counterparty-client's output of the market command:

Your Pending Order Matches
+-----------------------------------------------------------------------------------------------------------------------------------+-----------+
|                                                          Matched Order ID                                                         | Time Left |
+-----------------------------------------------------------------------------------------------------------------------------------+-----------+
| 971bd5ddfadeee623b21a903a3b53d29987d6ceba96c6d4ffc9f2376d42e259d_4e38c89a828add14ad5db037fdbf2735b2de09b6c76fc5d8a990ea7045a5ae6c |     7     |
+-----------------------------------------------------------------------------------------------------------------------------------+-----------+

Now buyer can send BTC to have the system release seller’s escrowed asset to buyer:

  • Buyer of asset: btcpay --source mvBrgbMAucRUQJFJ4Ddjog6FvL4JDQtoPZ --order-match 971bd5ddfadeee623b21a903a3b53d29987d6ceba96c6d4ffc9f2376d42e259d_4e38c89a828add14ad5db037fdbf2735b2de09b6c76fc5d8a990ea7045a5ae6c

That went through:

[INFO] Block: 328561 (1.41s)←[0m
←[33m[WARNING] Order match has only 3 confirmation(s).←[0m
[INFO] BTC Payment: mvBrgbMAucRUQJFJ4Ddjog6FvL4JDQtoPZ paid 0.00101 BTC to mkZ6E
CVZYtTE6iGZ6wvBfkw49KLAvsGhCM for order match 971bd5ddfadeee623b21a903a3b53d2998
7d6ceba96c6d4ffc9f2376d42e259d_4e38c89a828add14ad5db037fdbf2735b2de09b6c76fc5d8a
990ea7045a5ae6c (4d15ead293b4fa200e2668e1b43f8adf03be092793e41d90935621c7deccf7d
0) [valid]←[0m

Soon after as BTC payment was cleared asset buyer received asset that was escrowed by the protocol.

You can see the order, matches, and BTC_Pay details here: http://testnet.blockscan.com/orderinfo/2742

Finally, we were able to repeat all steps of selling asset for BTC.

http://blockscan.com/orderInfo/11620218#ordermatches
Order is marked as “complete” now.

Despite that both wallets were open during and after btcpay, asset coins still stay in escrow, and were not transferred to buyer’s address.

Through trial and error we found that the seller should make any other transaction in his wallet to initiate the transfer of asset funds from the escrow account to buyer’s address.

As well, it appears that the changes in the balance of the buyer will not be displayed until he logs out from Counterwallet and login again.

Seller of what - BTC or asset?
Is transaction-type of activity required on the address or on the account (i.e. any address)?
I am kind of skeptical about your conclusions, but I’d like to know more :wink:
(Auto) BTC Pay for settled transactions isn’t supposed to work, so if it does work, that would be weird.
If you’re talking about selling asset, then the protocol should definitively take care of everything (if it’s not, that would be a bug).
Are you sure it wasn’t just a coincidental timing issue that led you to conclude it’s related to what you were doing in the GUI?
Did you use the CLI for BTC Pay or (as mentioned in Github issues) pasted unsigned transactions into CW?

Could be a “feed” bug from Counterblock?

Seller of what - BTC or asset?

Seller of asset.

Is transaction-type of activity required on the address or on the account (i.e. any address)?

I’m not sure, I made a transaction from the same address with the same asset.

If you’re talking about selling asset, then the protocol should definitively take care of everything (if it’s not, that would be a bug).
Are you sure it wasn’t just a coincidental timing issue that led you to conclude it’s related to what you were doing in the GUI?

I waited for more than an hour for the transfer of asset funds from escrow to buyer’s address. And they only were transferred after I’ve made another transaction. I made new orders and repeated all steps to be sure.

Did you use the CLI for BTC Pay or (as mentioned in Github issues) pasted unsigned transactions into CW?

Yes.

Could be a “feed” bug from Counterblock?

Maybe. And perhaps the need to make another transaction in the asset seller’s account could be related to this bug too.

I’ll check again later and will write the results.

And perhaps the need to make another transaction in the asset seller’s account could be related to this bug too.

So, looks like another transaction was needed only to refresh escrow balances. Loging out and loging in works as well. So, nothing mysterious here.