# Selling asset for BTC on Dex

**URL:** <https://forums.counterparty.io/t/selling-asset-for-btc-on-dex/933>\
**Category:** Economy\
**Created:** [March 2, 2015, 3:09pm UTC](https://forums.counterparty.io/t/selling-asset-for-btc-on-dex/933 "2015-03-02T15:09:53Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexila](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/alexila/32/223_2.png) [@Alexila](https://forums.counterparty.io/u/Alexila)\
**Post date:** [March 2, 2015, 3:09pm UTC](https://forums.counterparty.io/t/selling-asset-for-btc-on-dex/933/1 "2015-03-02T15:09:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![something](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/something/32/240_2.png) [@something](https://forums.counterparty.io/u/something)\
**Post date:** [March 2, 2015, 8:27pm UTC](https://forums.counterparty.io/t/selling-asset-for-btc-on-dex/933/2 "2015-03-02T20:27:04Z")

</div>

> [@Alexila](#):
>
> Correct me if I’m wrong, but it looks like the only real currency on Dex is XCP.

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.).

> [@Alexila](#):
>
> 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.

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

> [@Alexila](#):
>
> 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.

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

---

<div class="post-metadata">

**Author:** ![Alexila](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/alexila/32/223_2.png) [@Alexila](https://forums.counterparty.io/u/Alexila)\
**Post date:** [March 3, 2015, 3:06am UTC](https://forums.counterparty.io/t/selling-asset-for-btc-on-dex/933/3 "2015-03-03T03:06:42Z")

</div>

Thank you, Something. Much appreciated!

---

<div class="post-metadata">

**Author:** ![something](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/something/32/240_2.png) [@something](https://forums.counterparty.io/u/something)\
**Post date:** [March 4, 2015, 5:34am UTC](https://forums.counterparty.io/t/selling-asset-for-btc-on-dex/933/4 "2015-03-04T05:34:57Z")

</div>

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](http://blockscan.com/assetInfo/SJCX)). They used [Vennd.io](http://Vennd.io) and it was very smooth as far as I could tell (based on my own experience - I bought some SJCX).

---

<div class="post-metadata">

**Author:** ![Alexila](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/alexila/32/223_2.png) [@Alexila](https://forums.counterparty.io/u/Alexila)\
**Post date:** [March 4, 2015, 7:43am UTC](https://forums.counterparty.io/t/selling-asset-for-btc-on-dex/933/5 "2015-03-04T07:43:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![something](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/something/32/240_2.png) [@something](https://forums.counterparty.io/u/something)\
**Post date:** [March 4, 2015, 10:51am UTC](https://forums.counterparty.io/t/selling-asset-for-btc-on-dex/933/6 "2015-03-04T10:51:01Z")

</div>

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.

> [@Alexila](#):
>
> Then they move their assets back to Dex for trading

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](http://coinmarketcap.com) shows where most trade happens for listed Counterparty assets and those that I traded were on Poloniex.

> [@Alexila](#):
>
> I think Dex (CP) would benefit a lot by adding (at least) BTC to the base currency list.

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.

---

<div class="post-metadata">

**Author:** ![Alexila](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/alexila/32/223_2.png) [@Alexila](https://forums.counterparty.io/u/Alexila)\
**Post date:** [March 13, 2015, 5:14am UTC](https://forums.counterparty.io/t/selling-asset-for-btc-on-dex/933/7 "2015-03-13T05:14:39Z")

</div>

> [@something](#):
>
> 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).

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/11603913)  
[http://www.blockscan.com/orderInfo/11603912](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?

---

<div class="post-metadata">

**Author:** ![something](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/something/32/240_2.png) [@something](https://forums.counterparty.io/u/something)\
**Post date:** [March 14, 2015, 5:02pm UTC](https://forums.counterparty.io/t/selling-asset-for-btc-on-dex/933/8 "2015-03-14T17:02:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![something](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/something/32/240_2.png) [@something](https://forums.counterparty.io/u/something)\
**Post date:** [March 20, 2015, 1:47pm UTC](https://forums.counterparty.io/t/selling-asset-for-btc-on-dex/933/9 "2015-03-20T13:47:59Z")

</div>

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](https://github.com/CounterpartyXCP/counterpartyd/issues/729#issuecomment-84019122)).

Order details: [http://testnet.blockscan.com/orderInfo/2732](http://testnet.blockscan.com/orderInfo/2732)

Try using more than the minimum amount of BTC.

---

<div class="post-metadata">

**Author:** ![SillyWiily](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/sillywiily/32/206_2.png) [@SillyWiily](https://forums.counterparty.io/u/SillyWiily)\
**Post date:** [March 22, 2015, 7:55am UTC](https://forums.counterparty.io/t/selling-asset-for-btc-on-dex/933/10 "2015-03-22T07:55:40Z")

</div>

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  
 ![](https://forums.counterparty.io/uploads/counterpartytalk/219/d06eb7c10678b118.png)

2. Order Info TX #11613220  
 ![](https://forums.counterparty.io/uploads/counterpartytalk/220/6d66cc8e53fb8ce9.png)

Also, we noticed that match notification pops up only in one wallet.  
 ![](https://forums.counterparty.io/uploads/counterpartytalk/221/fdcddfdc281e8a97.png)

---

<div class="post-metadata">

**Author:** ![something](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/something/32/240_2.png) [@something](https://forums.counterparty.io/u/something)\
**Post date:** [March 22, 2015, 12:26pm UTC](https://forums.counterparty.io/t/selling-asset-for-btc-on-dex/933/11 "2015-03-22T12:26:48Z")

</div>

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:

```auto
[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:

```auto
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:

```auto
[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](http://testnet.blockscan.com/orderinfo/2742)

---

<div class="post-metadata">

**Author:** ![SillyWiily](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/sillywiily/32/206_2.png) [@SillyWiily](https://forums.counterparty.io/u/SillyWiily)\
**Post date:** [March 30, 2015, 8:40am UTC](https://forums.counterparty.io/t/selling-asset-for-btc-on-dex/933/12 "2015-03-30T08:40:00Z")

</div>

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

[http://blockscan.com/orderInfo/11620218#ordermatches](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.

![](https://forums.counterparty.io/uploads/counterpartytalk/231/0e4982befca02f61.jpg)

---

<div class="post-metadata">

**Author:** ![SillyWiily](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/sillywiily/32/206_2.png) [@SillyWiily](https://forums.counterparty.io/u/SillyWiily)\
**Post date:** [March 30, 2015, 12:44pm UTC](https://forums.counterparty.io/t/selling-asset-for-btc-on-dex/933/13 "2015-03-30T12:44:33Z")

</div>

> [@SillyWiily](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![something](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/something/32/240_2.png) [@something](https://forums.counterparty.io/u/something)\
**Post date:** [March 30, 2015, 1:38pm UTC](https://forums.counterparty.io/t/selling-asset-for-btc-on-dex/933/14 "2015-03-30T13:38:34Z")

</div>

> [@SillyWiily](#):
>
> 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.

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 😉  
(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?

> [@SillyWiily](#):
>
> 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.

Could be a “feed” bug from Counterblock?

---

<div class="post-metadata">

**Author:** ![SillyWiily](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/sillywiily/32/206_2.png) [@SillyWiily](https://forums.counterparty.io/u/SillyWiily)\
**Post date:** [March 30, 2015, 2:10pm UTC](https://forums.counterparty.io/t/selling-asset-for-btc-on-dex/933/15 "2015-03-30T14:10:28Z")

</div>

> 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.

---

<div class="post-metadata">

**Author:** ![SillyWiily](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/sillywiily/32/206_2.png) [@SillyWiily](https://forums.counterparty.io/u/SillyWiily)\
**Post date:** [March 31, 2015, 2:03am UTC](https://forums.counterparty.io/t/selling-asset-for-btc-on-dex/933/16 "2015-03-31T02:03:32Z")

</div>

> 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.
