Bible Pay

TestNet => Active Discussions => Topic started by: Rob Andrews on January 06, 2025, 01:08:46 PM

Title: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on January 06, 2025, 01:08:46 PM
This is our TestNet thread for our new BBP - DOGE Decentralized Exchange!

Welcome!

Please sign up here if you can help us test the feature.



Wallet download:

https://biblepay.org/wallet

Or

Self Build:  https://github.com/biblepay/biblepay/commit/2ba1eb9386960e0749f1cab64414019cc2502fea

Or

Direct link to win64:
https://biblepay.org/biblepay-win64.exe
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: talisman on January 07, 2025, 07:11:06 AM
Count me in, great idea !
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on January 17, 2025, 04:57:23 PM
Alright, biblepay-doge atomic transactions 1.0 are being released now:

First question: Why don't we have a separate wallet for TestNet:
This build runs in the latest Production wallet (0.22.4-HamansHanging).
I chose to release this into the prod version rather than the testnet version because the AtomicTx uses real DOGE and real BBP.
(I did not want the feature to work with TBBP).

So please download the latest version with the link in the OP post and we can do testing with real coins.

Up to this point there are 3 primary architectures that we can use to accomplish these atomic tx's:
1) Coins are sent directly from user to user, Doge tx's are not mined into the chain unless the UTXO is confirmed by 6 sanctuaries, requires buyers and sellers to be online to trade, and requires a hard fork.  I originally wrote the whole system this way, but decided to remove that code and make method 1 dormant, because I didnt like the hard fork nor the fact the users have to be online constantly to trade. 
2) Escrow Tx's are sent to a sanc, the sanc holds on to the Tx and does the atomic swap if a match occurs, however, if a match does not occur or if the user Cancels the trade, the coins are returned.  <-- This is actually how the AtomicTx works right now.
3) Colored Coins are used to send WDOGE back and forth.  A user can Wrap a doge using a Wrapping Tx, or Redeem DOGE using an unwrapping tx against a sanc.  This will allow frictionless trading whether online or offline and almost fee-free trading for fractional quantities, and some other exciting things.  Im actually working on this proof-of-concept in the background and this may be the best method of all, but more on that later.

Now moving to my mini instructions (will make a Wiki for this page asap):
Assume that you must go the RPC console to do any of these.

How do I list the orders?

exec listorderbook buy
exec listorderbook sell

How do I place a trace?


exec placetrade buy NNNN pppp
Where NNNN is the Qty and pppp is the price.
You can also place a trade to SELL bbp for DOGE using:
exec placetrade sell NNNN_bbp pppp

How do I cancel a trade and get my collateral back?
Take note of the order id by either 'listorderbook buy-sell and find it' or the ID that was printed when you placed the trade.
You can see your orders in the orderbook by looking for a FLAG="M".  You can also find your ID in the trading_log.  You can also find your id in the
BBP transactionlist, double click it and read the advanced information (IE <atomictransaction>ID: nnnn</atomictransaction>).
Once you know the ID of the trade type:
exec canceltrade ID


How do I see my integrated DOGE wallet balance?

exec getdogebalance
This command also shows your DOGE public key, and your doge balance, and your BX link.

How do I send DOGE from my BBP wallet?

exec senddoge destination_address amount

NOTE:  The BBP wallet will not spend any of your funds from your normal keys.
To start trading you will have to go to receiving addresses, and find your TRADING-PUBLIC-KEY, and send funds to it.
Also your wallet must be unlocked to trade.
All atomic tx funds are spent from the TRADING-PUBLIC-KEY, and all canceled transactions and filled transactions from other users are sent to your TRADING-PUBLIC-KEY.  All inbound DOGE comes to your 'exec getdogebalance' key.  All outbound doge comes out of your 'exec getdogebalance' key.

In version 1.0, this atomic trading system is only capable of matching Exact trades (meaning that the buyer and seller are selling the same quantity of coins) and the price must be at or better than the sellers price.

Example:
If I am selling 1000 BBP for .0001 doge, the buyer must be buying 1000 BBP for .0001 or .00011 or .00015 (IE at that price or higher) to get the coins.

In v1.1, we will attempt to introduce fractional fills.

Enjoy.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on January 21, 2025, 01:57:21 PM
its probably right in front of my face but how do i get my trading public key
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on January 21, 2025, 07:41:27 PM
its probably right in front of my face but how do i get my trading public key

Hey bro,
Thank you for testing.  Glad we can at least get started.
Also with Bololex being down again, we need it even more.

Let me give you a quick fake set of commands to get you started:

1) Funding your trading-public-key with BBP first:
Go to Receive addresses, find Trading*, copy the key.  Send some funds to it.  The wallet will only spend the amount of the trade into escrow and of course you get it back if you cancel an order.
2) To send DOGE to your bbp wallet:
exec getdogebalance


I have some trades in there but feel free to tell me what you placed and ill place some opposing orders for you.

Because in this version they only match on a full quantity match.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on January 21, 2025, 10:06:03 PM
i placed a few sells at 5000-5003 bbp @0.0001 and one buy for 15000 bbp @0.000007

i noticed you can't make a buy for less than 0.10 doge but some of the sells are less than that so i couldn't match their order exactly

i think i messed up my first sell order and i don't see an id beside it its "0          0"?

sometimes i would do a command and then nothing happens  ie

Quote

22:49:16
exec placetrade sell 5002 0.0001


22:49:17
{
  "Command": "placetrade",
  "id": "0",
  "Tx": "{\"SymbolBuy\":\"\",\"SymbolSell\":\"\",\"Action\":\"\",\"id\":\"0\",\"Version\":1,\"Quantity\":0,\"Price\":0,\"Status\":\"NA\",\"Signer\":\"\",\"Signature\":\"\",\"CollateralBBPAddress\":\"\",\"CollateralDOGEAddress\":\"\",\"CollateralTXID\":\"\",\"ReturnTXID\":\"\",\"BlockExplorerURL\":\"\",\"Message\":\"\",\"AltAddress\":\"\",\"TXID\":\"\",\"MatchedTo\":\"\",\"FilledQuantity\":0,\"Time\":1737517756,\"Height\":0,\"Error\":\"\"}\n",
  "block_explorer": "",
  "Error": ""
}

is that to do with confirmations on my previous txs or something like that?
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on January 21, 2025, 10:29:17 PM
i just successfully bought 9000 bbp
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on January 22, 2025, 06:18:47 AM

i think i messed up my first sell order and i don't see an id beside it its "0          0"?
sometimes i would do a command and then nothing happens  ie
is that to do with confirmations on my previous txs or something like that?

Let me just address this one by itself, because I see two problems in there.
I think the first one is harmless, when you did the exec placetrade sell 5002 0.0001, the command syntax was correct.
It was supposed to generate a collateral tx, and a tradeID, and I see that didnt happen on the one that returned 0 on the screen, as the whole transaction is empty (no txid, no collateral address), so that one we can either chalk up as network error, or race condition. If you want to check something, go to your bbp data directory, (the same place where debug.log is) and you can go back to that timestamp and check the trading_log.  see if anything is weird in there at that particular timestamp?  Maybe a wallet error or something.  Now usually we handle all the known ones, like not enough balance, or wallet locked, or, in the case of DOGE if you just spent some to buy some BBP, the UTXO is spent and we have to wait 1 more block before successfuly placing another trade.  But that is a known condition so you will see an error saying Unable to create transaction::No utxos - something to that effect.

But moving on to this one:
There was one you placed to buy 1000000 bbp at .00000010.  What I find strange about that one is if you look at the BX, your collateral of 1DOGE was sent here:
https://live.blockcypher.com/doge/address/DNjtGEqNFE2RMbjU8kA88iStj9hcRBd9cs/
(Thats the 'collateral address' of the sanc that accepted it).  So its locked in there where no one can touch it unless the trade goes through, but, it has an id of "0" - which is not right.  That should have an ID > current unix timestamp.
So something mostly worked on that and failed to give you good id.
Can you please try a 'exec canceltrade 0' and tell me if it gives you your 1 doge back?  If it doesnt ill cover it.  But yeah I have to find the debug log and fix that one.
Obviously you can place it again once you get it back.

Moving on to normal trading:
I bought the 5001,5002,5003 trades and got the BBP, so that looks like it worked correctly, yay.

(On that first issue with the completely failed tx, you should not have lost any collateral, btw, otherwise you would have seen "collateralAddressDOGE" or "BBP" populated on that output etc).


Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on January 22, 2025, 06:24:09 AM
i just successfully bought 9000 bbp
And on the issue about not being able to buy with DOGE unless > .10, I had to add that to deter people from creating dust transactions.  The issue is, we have to pay doge about .008 tx fee each way, so i wanted to avoid a situation where we send say .008 collateral then with the tx fee round trip, we would get back less than zero (IE the tx would fail), so with the .10 rule, you basically see this : .108 out, .10 back (something like that) so the tx fee is a small part of it). 

But your right -- I will add a rule to increase the sell minimum in the next version to prevent unbalanced trades. 




Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on January 22, 2025, 09:04:05 AM

10:03:03
exec canceltrade 0


10:03:19
{
  "Command": "canceltrade",
  "Tx": "{\"SymbolBuy\":\"bbp\",\"SymbolSell\":\"doge\",\"Action\":\"buy\",\"id\":\"0\",\"Version\":1,\"Quantity\":10000000,\"Price\":1e-07,\"Status\":\"open\",\"Signer\":\"BG39CtdNTZHRt2tcQ83Qqdkv6EE2Q3Xm8v\",\"Signature\":\"IE0i95DAOBvWkgo7A/W8NZaxOvarMu+UaGxPreFDyVKqZ1uPNiRiGxF8k162RNtH4OjVlOkEzd/PHDWECc0b8Y4=\",\"CollateralBBPAddress\":\"BN3sLhLvhKi3GS331eVXi65xadQtndL5Ef\",\"CollateralDOGEAddress\":\"DNjtGEqNFE2RMbjU8kA88iStj9hcRBd9cs\",\"CollateralTXID\":\"05c9033f695093c5142b5f78cf8bc236a9449654dab3f25ef44fbaa2aa1639ab\",\"ReturnTXID\":\"\",\"BlockExplorerURL\":\"https://live.blockcypher.com/doge/tx/05c9033f695093c5142b5f78cf8bc236a9449654dab3f25ef44fbaa2aa1639ab/\",\"Message\":\"authorize-1737521645\",\"AltAddress\":\"\",\"TXID\":\"\",\"MatchedTo\":\"\",\"FilledQuantity\":0,\"Time\":1737521645,\"Height\":560265,\"Error\":\"Invalid checked base 58 string\"}\n",
  "block_explorer": "https://live.blockcypher.com/doge/tx/05c9033f695093c5142b5f78cf8bc236a9449654dab3f25ef44fbaa2aa1639ab/",
  "Error": "Invalid checked base 58 string"
}
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on January 22, 2025, 04:24:25 PM
10:03:03
exec canceltrade 0


10:03:19
{
  "Command": "canceltrade",
  "Tx": "{\"SymbolBuy\":\"bbp\",\"SymbolSell\":\"doge\",\"Action\":\"buy\",\"id\":\"0\",\"Version\":1,\"Quantity\":10000000,\"Price\":1e-07,\"Status\":\"open\",\"Signer\":\"BG39CtdNTZHRt2tcQ83Qqdkv6EE2Q3Xm8v\",\"Signature\":\"IE0i95DAOBvWkgo7A/W8NZaxOvarMu+UaGxPreFDyVKqZ1uPNiRiGxF8k162RNtH4OjVlOkEzd/PHDWECc0b8Y4=\",\"CollateralBBPAddress\":\"BN3sLhLvhKi3GS331eVXi65xadQtndL5Ef\",\"CollateralDOGEAddress\":\"DNjtGEqNFE2RMbjU8kA88iStj9hcRBd9cs\",\"CollateralTXID\":\"05c9033f695093c5142b5f78cf8bc236a9449654dab3f25ef44fbaa2aa1639ab\",\"ReturnTXID\":\"\",\"BlockExplorerURL\":\"https://live.blockcypher.com/doge/tx/05c9033f695093c5142b5f78cf8bc236a9449654dab3f25ef44fbaa2aa1639ab/\",\"Message\":\"authorize-1737521645\",\"AltAddress\":\"\",\"TXID\":\"\",\"MatchedTo\":\"\",\"FilledQuantity\":0,\"Time\":1737521645,\"Height\":560265,\"Error\":\"Invalid checked base 58 string\"}\n",
  "block_explorer": "https://live.blockcypher.com/doge/tx/05c9033f695093c5142b5f78cf8bc236a9449654dab3f25ef44fbaa2aa1639ab/",
  "Error": "Invalid checked base 58 string"
}
Hmm, ok, i took a look at the tx and one thing i noticed it didnt have the AltAddress on the first version of it, and of course it wasnt even the right ID (> 0), so I dont think I can find the root cause, but I can put in rules to prevent this issue in the future.  We can validate the tx a little better, before sending the DOGE and committing it, so I will work on that next.

In the mean time I refunded your DOGE from my wallet:

16:22:18
exec senddoge DA6ALPEJQ3DqYvrbFdRHsZKVFDWNJRE9u1 2


16:22:20
{
  "Command": "senddoge",
  "to_address": "DA6ALPEJQ3DqYvrbFdRHsZKVFDWNJRE9u1",
  "amount": 2,
  "TXID": "ca1ac72dd7376062791a79df7783aa74fff4a0cc3695427e0f459a092c469d8b",
  "Error": ""
}

Did I get the address right?  I got it off the one I sold to you (IE one of the other tx Doge AltAddress).

It should be in your BBP wallet.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on January 22, 2025, 04:47:44 PM
Just want to point out my background conscience with God on all this.
I had similar ideas of integrating an exchange into BBP a couple years ago and when I prayed about it I always got a "No, dont do it" from the Holy Spirit - and I think the reason was--  the SEC started to go after many US exchanges and launched strict rules and threw people in jail for violating anti money transmitter laws.  However I did pray about this more and got a green light for programming this inside the wallet.  I feel the reason for the change is Trump is in and all the pro crypto laws are about to take effect.  Im not interested in creating a centralized exchange that holds funds and is hosted on a US domain.  Im only interested in writing one in wallet, because I feel that is what God approved.

Expanding on this idea a little more, I have worked out the technical requirements to improve this idea way more than we have now imho.  And I also did a little research on existing DEXs.  Almost every existing DEX, if not every one, is based on non BTC (ETH or Solana or smart contract compatible chains).  There is one called BISQ that works with BTC, but, it is not really what we are doing, its a P2P where the order must match exactly and it clears a multisig tx.

So thats exciting because it means if we do this in a way that may be multi-coin-compatible, this could really be useful.

Heres what I plan on doing next:

- There will be 3 major places the crypto goes: "INGATE", "TRADING", "OUTGATE".
- To standardize this idea, we will support more than one crypto by symbol.  The symbol must be listed on a BTC style chain (IE btc,doge,dash etc) to work with this DEX.  (Future state we look at XRP XLM ETH etc).
- A community hosts a node, and a BX, and gives us the BX URL, the Node RPC, the symbol and PNG graphics file, and a blurb about the coin.
- Our wallet will start locking foreign currencies on the chain by adding a new standard: a new type of colored coin.
A colored coin has a special address that ends in the foreign ticker and ZZ. 
There will be new rules where colored coins can only be sent from a colored address to a colored address.  Example:
If you own 100 WDOGE (Wrapped BBP DOGE), you can only send it from a WDOGE address to a WDOGE address.
- The ingate will provide a receive address, so you type something like
wrap WDOGE 2.25
The wallet gives you an address to send the DOGE to, once you send it, your atomic tx will receive WDOGE for the same amount.
We will make it so the block CANNOT BE MINED, unless the DOGE is received and signed by the receiving sanc.
- Once you have these colored assets in your wallet, we can make them trade in a trading room, with high liquidity.
Because then we can do fractional fills.  Also, you will get the strong deterministic BBP transactions on those when they are filled.
Meaning that if you had 2.25 WDOGE, and you send those to another BBP wallet each wallet is adjusted with a standard colored tx immediately.
- The Outgate will allow you to perform a BURN of the tx to our BURN address, and this tx will not be mined unless you receive back your exit collateral.
This will be for withdrawals.
- The security will be increased on the Sanc to store the collateral on the chain this way:
We will make a new transaction Type that will only unlock the foreign funds when the colored recipient signs plus a sanc signs.  This will prevent any security issues for every transaction as if a rogue temple comes online and tries to steal a collateral tx that is live in the trades, they wont have the sig of the person with the colored coin.  Also, we will store the collateral in individual deterministic addresses that relate to the original deposit.  Another words, no big hot wallet building up, but instead hundreds of little cold wallets that can only be liquidated using this special type of liquidation transaction.
- The users can trade 24-7 because of the liquidity of the wrapped funds.
- People can go in and out of the funds at any time  - they can trade for a couple hours and withdraw etc.
- UI:  We can make a trading room that will have the ticker banner, a buy order book and a sell orderbook, volume and totals.  A buy and sell button.
This would probably increase the usage of the feature so I'm willing to do it, God willing.

Would this be cool to do?

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on January 22, 2025, 09:14:18 PM
Hmm, ok, i took a look at the tx and one thing i noticed it didnt have the AltAddress on the first version of it, and of course it wasnt even the right ID (> 0), so I dont think I can find the root cause, but I can put in rules to prevent this issue in the future.  We can validate the tx a little better, before sending the DOGE and committing it, so I will work on that next.

In the mean time I refunded your DOGE from my wallet:

16:22:18
exec senddoge DA6ALPEJQ3DqYvrbFdRHsZKVFDWNJRE9u1 2


16:22:20
{
  "Command": "senddoge",
  "to_address": "DA6ALPEJQ3DqYvrbFdRHsZKVFDWNJRE9u1",
  "amount": 2,
  "TXID": "ca1ac72dd7376062791a79df7783aa74fff4a0cc3695427e0f459a092c469d8b",
  "Error": ""
}

Did I get the address right?  I got it off the one I sold to you (IE one of the other tx Doge AltAddress).

It should be in your BBP wallet.

No, my address is DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg, but don't worry about sending me anything. It's all good.



Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on January 23, 2025, 06:45:49 AM
No, my address is DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg, but don't worry about sending me anything. It's all good.
Np, sent 775540452d61be65d9da3c95ee1f5d26e45a016bbee4a8a351f3463af5a46ca3.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on January 23, 2025, 10:20:21 PM
Just want to point out my background conscience with God on all this.
I had similar ideas of integrating an exchange into BBP a couple years ago and when I prayed about it I always got a "No, dont do it" from the Holy Spirit - and I think the reason was--  the SEC started to go after many US exchanges and launched strict rules and threw people in jail for violating anti money transmitter laws.  However I did pray about this more and got a green light for programming this inside the wallet.  I feel the reason for the change is Trump is in and all the pro crypto laws are about to take effect.  Im not interested in creating a centralized exchange that holds funds and is hosted on a US domain.  Im only interested in writing one in wallet, because I feel that is what God approved.

Expanding on this idea a little more, I have worked out the technical requirements to improve this idea way more than we have now imho.  And I also did a little research on existing DEXs.  Almost every existing DEX, if not every one, is based on non BTC (ETH or Solana or smart contract compatible chains).  There is one called BISQ that works with BTC, but, it is not really what we are doing, its a P2P where the order must match exactly and it clears a multisig tx.

So thats exciting because it means if we do this in a way that may be multi-coin-compatible, this could really be useful.

Heres what I plan on doing next:

- There will be 3 major places the crypto goes: "INGATE", "TRADING", "OUTGATE".
- To standardize this idea, we will support more than one crypto by symbol.  The symbol must be listed on a BTC style chain (IE btc,doge,dash etc) to work with this DEX.  (Future state we look at XRP XLM ETH etc).
- A community hosts a node, and a BX, and gives us the BX URL, the Node RPC, the symbol and PNG graphics file, and a blurb about the coin.
- Our wallet will start locking foreign currencies on the chain by adding a new standard: a new type of colored coin.
A colored coin has a special address that ends in the foreign ticker and ZZ. 
There will be new rules where colored coins can only be sent from a colored address to a colored address.  Example:
If you own 100 WDOGE (Wrapped BBP DOGE), you can only send it from a WDOGE address to a WDOGE address.
- The ingate will provide a receive address, so you type something like
wrap WDOGE 2.25
The wallet gives you an address to send the DOGE to, once you send it, your atomic tx will receive WDOGE for the same amount.
We will make it so the block CANNOT BE MINED, unless the DOGE is received and signed by the receiving sanc.
- Once you have these colored assets in your wallet, we can make them trade in a trading room, with high liquidity.
Because then we can do fractional fills.  Also, you will get the strong deterministic BBP transactions on those when they are filled.
Meaning that if you had 2.25 WDOGE, and you send those to another BBP wallet each wallet is adjusted with a standard colored tx immediately.
- The Outgate will allow you to perform a BURN of the tx to our BURN address, and this tx will not be mined unless you receive back your exit collateral.
This will be for withdrawals.
- The security will be increased on the Sanc to store the collateral on the chain this way:
We will make a new transaction Type that will only unlock the foreign funds when the colored recipient signs plus a sanc signs.  This will prevent any security issues for every transaction as if a rogue temple comes online and tries to steal a collateral tx that is live in the trades, they wont have the sig of the person with the colored coin.  Also, we will store the collateral in individual deterministic addresses that relate to the original deposit.  Another words, no big hot wallet building up, but instead hundreds of little cold wallets that can only be liquidated using this special type of liquidation transaction.
- The users can trade 24-7 because of the liquidity of the wrapped funds.
- People can go in and out of the funds at any time  - they can trade for a couple hours and withdraw etc.
- UI:  We can make a trading room that will have the ticker banner, a buy order book and a sell orderbook, volume and totals.  A buy and sell button.
This would probably increase the usage of the feature so I'm willing to do it, God willing.

Would this be cool to do?

Sounds good!

So, does it drive demand for BBP by requiring a sanctuary to be hosted by each currency that will be listed?
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on January 24, 2025, 06:58:31 AM
Sounds good!

So, does it drive demand for BBP by requiring a sanctuary to be hosted by each currency that will be listed?

Up til now I was only thinking about 1) Getting a new groundbreaking feature in so people would actually use BBP (IE maybe first Bitcoin based wallet to host a true DEX inside the core wallet), 2) Possibly helping smaller crypto communities who desperately want to be listed and cant, 3) It may tie in to our future Index product - where - we can issue fractional shares of the wrapped currencies to create a virtual cryptoindex investment fund in the core wallet, but that maintains your keys your money etc.

From that other side of the coin, IE the service side, we definitely need to approach it where its profitable and not free.
Im starting to like your idea, about needing to host a Temple (Im saying Temple because I think we would need them to host our full suite, which is 45MM bbp).  The full suite runs the sidechain also.  So they host a temple, and run a BX, and run a synced full node (of their currency) which provides our ability to do pushTX to them. 
Otherwise, one of our volunteers who have a temple can host a second market, if they feel like it.
Possibly a third option may be for them to pay a monthly fee for one of our Temples to do it all for them, but we would have to work that out.

Foreign community would need to be vetted to be "good" relationship (IE not SatanCoin). 

Note :  We can make so that trading room goes dark or more specifically, just the deposits and withdraws  are disabled when one of their components goes down (it cant operate for example if their full node node is down, because we cant broadcast tx's from a sanc to them). 

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on January 26, 2025, 07:57:11 AM
** ATTENTION **


If everyone could please cancel their trades in the doge/bbp trading room as I am now working on v2.0 which will not be compatible with the old version.

Thanks.

To cancel the trade do:

exec listorderbook buy
Find the ID (** your trades have an M on them)
exec canceltrade ID

Then do the same with any of your Sells.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on January 28, 2025, 09:49:51 PM
** ATTENTION **


If everyone could please cancel their trades in the doge/bbp trading room as I am now working on v2.0 which will not be compatible with the old version.

Thanks.

To cancel the trade do:

exec listorderbook buy
Find the ID (** your trades have an M on them)
exec canceltrade ID

Then do the same with any of your Sells.

Sorry just saw this and canceled!
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on January 30, 2025, 04:33:17 PM
Biblepay v022.8 - Mandatory Upgrade
https://github.com/biblepay/biblepay/releases/tag/v022.8-Mandatory


- Lower Tx fee down to .000001 so we can trade assets with very low tx fees in trading rooms
- Add BBP atomic trading v2.0 and underpinnings
- Add colored coins (which are colored assets) and add one asset: DOGE, which is BBP Wrapped Doge
- Add sendasset (send colored asset from BBP wallet to BBP wallet) and getassetbalance
- Add memory pool rule to reject tx's that violate the colored asset protocol
- Remove colored assets from coin control and accidental wallet spending
- Add background thread to mine first colored DOGE asset address
- Add createassetaddress, which will allow you to create another asset address like BBP-Wrapped-DASH, etc.
- Add exec bankroll, which creates denominated bbp vout transactions.
- Add exec wrap and exec unwrap. This allows you to WRAP doge, and Unwrap doge (or other assets).
- Add getassetbalance to query the colored asset balance by asset type.
- Added TEST version of our next trading room (see testnet thread)


Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on January 30, 2025, 04:42:21 PM
Alright everyone, this release is ready to test.
Let me explain how this works.

1) Wallet will be able to support more than one Asset (IE Trading Room) in the future as the architecture is created.
Right now, we just have DOGE-BBP.
2) There is a trading UI now, click Exchange.
3) On boot, the Exchange will not load for 2 minutes, to keep the wallet boot fast.
4) In order to trade, the wallet needs both a TRADING-PUBLIC-KEY and a TRADING-ASSET-DOGE address.
Each unique trading room we create, we need one corresponding public key for the foreign currency.
Its very easy to fund the BBP side for trading: simply go to receive addresses and copy the TRADING-PUBLIC-KEY and send yourself some BBP and that will allow you to make SELL transactions in the DOGE/BBP room.

However, now that we have a new concept (Assets), your wallet needs to MINE a TRADING-ASSET-DOGE address in the background.
It will do this automatically, but you need to unlock your wallet on boot for it to happen.

Just unlock it and wait 15 mins or so before placing your first trade.
If you place a BUY trade in the exchange room and your wallet has not yet mined the ASSET address, you will see a warning.

5) To send an ASSET from one BBP wallet to another, from the rpc do a :
exec sendasset SYMBOL dest_asset_address amount
Note that you can only send assets to another ASSET address (you would need to set up a second BBP terminal and copy it to the clipboard, as it must end in DGZZ if its a DOGE asset.

6) In order to BUY in the exchange room, you obviously need some wrapped DOGE.
To get that do this:
exec wrap DOGE amount
Note that before you do that, you will need REAL doge, so try:
exec getdogebalance
You can fund your DOGE public key with some DOGE first, then you can wrap the DOGE into BBP-DOGE with the wrap command.
Once you have wrapped DOGE, you can trade in the trading room with it and it does support Instantsend.

7) To Unwrap your doge (I recommend doing this sparingly because it is a heavy process):
unwrap doge amount
The doge will be unwrapped and sent back to your DOGE public key.
Always wait a DOGE block before doing a 'exec getdogebalance'.

8 ) The transaction fees have been lowered by a magnitude in this version so that Wrapped BBP-DOGE will have miniscule fees that will not interfere with a wrap or unwrap.

9) In this first version, only complete MATCH trades will execute.  IE:
Sell 9000 BBP for .002 from USER 1
Buy 9000 BBP for .002 from USER 2
Will match and execute.

10) The Flags column in the exchange:  M = Mine , T=Theirs

I've got a TODO to create partial fills asap.

Just let me know if Ive forgotten anything.

Good luck!

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on January 31, 2025, 09:28:36 AM
Alright everyone, this release is ready to test.
Let me explain how this works.

1) Wallet will be able to support more than one Asset (IE Trading Room) in the future as the architecture is created.
Right now, we just have DOGE-BBP.
2) There is a trading UI now, click Exchange.
3) On boot, the Exchange will not load for 2 minutes, to keep the wallet boot fast.
4) In order to trade, the wallet needs both a TRADING-PUBLIC-KEY and a TRADING-ASSET-DOGE address.
Each unique trading room we create, we need one corresponding public key for the foreign currency.
Its very easy to fund the BBP side for trading: simply go to receive addresses and copy the TRADING-PUBLIC-KEY and send yourself some BBP and that will allow you to make SELL transactions in the DOGE/BBP room.

However, now that we have a new concept (Assets), your wallet needs to MINE a TRADING-ASSET-DOGE address in the background.
It will do this automatically, but you need to unlock your wallet on boot for it to happen.

Just unlock it and wait 15 mins or so before placing your first trade.
If you place a BUY trade in the exchange room and your wallet has not yet mined the ASSET address, you will see a warning.

5) To send an ASSET from one BBP wallet to another, from the rpc do a :
exec sendasset SYMBOL dest_asset_address amount
Note that you can only send assets to another ASSET address (you would need to set up a second BBP terminal and copy it to the clipboard, as it must end in DGZZ if its a DOGE asset.

6) In order to BUY in the exchange room, you obviously need some wrapped DOGE.
To get that do this:
exec wrap DOGE amount
Note that before you do that, you will need REAL doge, so try:
exec getdogebalance
You can fund your DOGE public key with some DOGE first, then you can wrap the DOGE into BBP-DOGE with the wrap command.
Once you have wrapped DOGE, you can trade in the trading room with it and it does support Instantsend.

7) To Unwrap your doge (I recommend doing this sparingly because it is a heavy process):
unwrap doge amount
The doge will be unwrapped and sent back to your DOGE public key.
Always wait a DOGE block before doing a 'exec getdogebalance'.

8 ) The transaction fees have been lowered by a magnitude in this version so that Wrapped BBP-DOGE will have miniscule fees that will not interfere with a wrap or unwrap.

9) In this first version, only complete MATCH trades will execute.  IE:
Sell 9000 BBP for .002 from USER 1
Buy 9000 BBP for .002 from USER 2
Will match and execute.

10) The Flags column in the exchange:  M = Mine , T=Theirs

I've got a TODO to create partial fills asap.

Just let me know if Ive forgotten anything.

Good luck!

Great work Rob,

Im just wondering am i missing something as when i try to sell bbp i get cannot create atomic tx?

Thanks
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on January 31, 2025, 10:00:31 AM
Great work Rob,

Im just wondering am i missing something as when i try to sell bbp i get cannot create atomic tx?

Thanks

Thanks bro.
Just double checking, are you definitely on v0.22.8?

And you are in this Exchange trading room (see pic) right?

If so what is the exact error message?

We moved to the UI version.

PS Try downloading it from the Github link above; our biblepay.org probably takes 24 more hours to uncache.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on January 31, 2025, 01:05:37 PM
I will say the majority of the time exec getdogebalance returns 0 even though the balance is 7.3

then exec wrap doge returns this

14:03:37
exec wrap DOGE 5


14:03:37
{
  "Command": "wrap",
  "id": "0",
  "Tx": "{\"SymbolBuy\":\"\",\"SymbolSell\":\"\",\"Action\":\"\",\"id\":\"0\",\"Version\":1,\"Quantity\":0,\"Price\":0,\"Status\":\"NA\",\"Signer\":\"\",\"Signature\":\"\",\"CollateralBBPAddress\":\"\",\"CollateralDOGEAddress\":\"\",\"CollateralALTAddress\":\"\",\"CollateralAssetAddress\":\"\",\"CollateralTXID\":\"\",\"ReturnTXID\":\"\",\"BlockExplorerURL\":\"\",\"Message\":\"\",\"AltAddress\":\"\",\"TXID\":\"\",\"MatchedTo\":\"\",\"FilledQuantity\":0,\"Time\":1738350217,\"Height\":0,\"Error\":\"\"}\n",
  "Error": ""
}


or am I missing steps?

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on January 31, 2025, 02:17:21 PM
I will say the majority of the time exec getdogebalance returns 0 even though the balance is 7.3

then exec wrap doge returns this

14:03:37
exec wrap DOGE 5


14:03:37
{
  "Command": "wrap",
  "id": "0",
  "Tx": "{\"SymbolBuy\":\"\",\"SymbolSell\":\"\",\"Action\":\"\",\"id\":\"0\",\"Version\":1,\"Quantity\":0,\"Price\":0,\"Status\":\"NA\",\"Signer\":\"\",\"Signature\":\"\",\"CollateralBBPAddress\":\"\",\"CollateralDOGEAddress\":\"\",\"CollateralALTAddress\":\"\",\"CollateralAssetAddress\":\"\",\"CollateralTXID\":\"\",\"ReturnTXID\":\"\",\"BlockExplorerURL\":\"\",\"Message\":\"\",\"AltAddress\":\"\",\"TXID\":\"\",\"MatchedTo\":\"\",\"FilledQuantity\":0,\"Time\":1738350217,\"Height\":0,\"Error\":\"\"}\n",
  "Error": ""
}


or am I missing steps?

1) I have not had that problem where getdogebalance returns 0 most of the time, however I think I know what it may be.
The only time getdogebalance is 0, should be after you spend the doge on an unconfirmed tx for 1 block.
Fortunately, once you wrap the DOGE into BBP-DOGE, you do not have to use the "real" DOGE again, so that problem will be minimalized.
Try this, if you go to your BBP Doge address on blockcypher:
https://live.blockcypher.com/doge/address/DSb6QT7eEsMLFgL4vzPKTBqgQnqEDLPmGE/
Whenever you have an unconfirmed tx, you may see the 0 balance.
If you have everything confirmed, you should see the right balance.
Wait for that to be stable before moving to the WRAP step.
2) Now do the exec wrap command and it should wrap.
Once you wrap, dont do any more DOGE wraps until your balance is > 1 confirm again (or you may see the 0).

3) You can then do this:
exec getassetbalance doge
And now see the total of your wrapped address (the DOGE is either in one place or another, but never missing).

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on February 03, 2025, 01:53:48 AM
Thanks bro.
Just double checking, are you definitely on v0.22.8?

And you are in this Exchange trading room (see pic) right?

If so what is the exact error message?

We moved to the UI version.

PS Try downloading it from the Github link above; our biblepay.org probably takes 24 more hours to uncache.

Hi Rob,

100% i am on the right version but my trading room is blank, please see attached image. The error is unable to create atomic tx.

Thanks
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 03, 2025, 11:27:43 AM
Hi Rob,

100% i am on the right version but my trading room is blank, please see attached image. The error is unable to create atomic tx.

Thanks

Its not normal at all, so we start with a few questions.
1) If on windows, try to go into this folder and delete this file :
%appdata%\Biblepay\SAN
Delete the sidechain file.
Then stop the node and restart the node.

Wait more than 2 minutes then see if the exchange room is populated (there are something like 10 orders in there).
It does stay blank the first 2 minutes normally.

If it still happens, please paste a screenshot of the error.

2) When you go to Window | Receiving addresses, and search by Trading, do you have both a Trading-public-key and a Trading-asset-doge populated?


Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on February 04, 2025, 01:54:39 AM
Its not normal at all, so we start with a few questions.
1) If on windows, try to go into this folder and delete this file :
%appdata%\Biblepay\SAN
Delete the sidechain file.
Then stop the node and restart the node.

Wait more than 2 minutes then see if the exchange room is populated (there are something like 10 orders in there).
It does stay blank the first 2 minutes normally.

If it still happens, please paste a screenshot of the error.

2) When you go to Window | Receiving addresses, and search by Trading, do you have both a Trading-public-key and a Trading-asset-doge populated?

I deleted the files in SAN and restarted , after about 5 min it showed up as i went to place an order the whole order book went blank. and now i have the same i had in the previous image
I have the receiving addresses too.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on February 04, 2025, 01:41:13 PM
Ive had the order book blank before

when i did

exec listorderbook buy

in the console the GUI order book populated

update: it disappeared after a few minutes, i will try deleting SAN
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on February 04, 2025, 01:59:42 PM
I'm not sure if these screenshots help but just documenting what's happening. I have intermittently been able to post buy and sell trades previously but not today and orderbook appears briefly before disappearing.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 04, 2025, 07:20:12 PM
Ahh, thank you for the screenshots.
Actually its really good to see that you both had the same problem, because ironically I have not had it from my VM or my home pc.

Its possible that I fixed something that did not get in the latest release; really busy at work, so Im going to have to try to reproduce this on my laptop which is not using the compiled version.

Give me a couple days for things to settle down and ill be back asap.

PS In theory you do not have to list orderbook or create atomic from command line (command line should only be needed for the exec getdogebalance etc).  Aids_S,  out of curiosity, on those instances where you had a 0 return for getdogebalance, were those after spends or were they just random problems?  (Cause that should only happen after a spend). 

PS II:  One other thing can you both try in the mean time:  There is a timer meant to save resources, inside the Exchange page inside the order book grid.
It goes to sleep once every few mins and only wakes up if there is mouse move Over the top or bottom grid.  Try this, after the orderbook goes blank (and after 2+ mins after a cold boot) click around in the grid area and wait a few secs and see if that fixes it? 

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on February 04, 2025, 10:29:19 PM
no there are no unconfirmed tx on the doge address Its just random if i spam exec getdogebalance eventually it works sometimes it works first try

Code: [Select]
23:35:47
Executing command using "" wallet


23:35:47
exec getdogebalance


23:35:49
{
  "Command": "getdogebalance",
  "address": "DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg",
  "block_explorer": "https://live.blockcypher.com/doge/address/DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg/",
  "balance": 0.2744
}


23:35:50
exec getdogebalance


23:35:50
{
  "Command": "getdogebalance",
  "address": "DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg",
  "block_explorer": "https://live.blockcypher.com/doge/address/DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg/",
  "balance": 0
}


23:35:51
exec getdogebalance


23:35:51
{
  "Command": "getdogebalance",
  "address": "DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg",
  "block_explorer": "https://live.blockcypher.com/doge/address/DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg/",
  "balance": 0
}


23:35:52
exec getdogebalance


23:35:52
{
  "Command": "getdogebalance",
  "address": "DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg",
  "block_explorer": "https://live.blockcypher.com/doge/address/DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg/",
  "balance": 0
}


23:35:53
exec getdogebalance


23:35:53
{
  "Command": "getdogebalance",
  "address": "DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg",
  "block_explorer": "https://live.blockcypher.com/doge/address/DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg/",
  "balance": 0
}


23:35:54
exec getdogebalance


23:35:54
{
  "Command": "getdogebalance",
  "address": "DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg",
  "block_explorer": "https://live.blockcypher.com/doge/address/DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg/",
  "balance": 0
}


23:35:55
exec getdogebalance


23:35:55
{
  "Command": "getdogebalance",
  "address": "DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg",
  "block_explorer": "https://live.blockcypher.com/doge/address/DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg/",
  "balance": 0
}


23:35:55
exec getdogebalance


23:35:55
{
  "Command": "getdogebalance",
  "address": "DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg",
  "block_explorer": "https://live.blockcypher.com/doge/address/DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg/",
  "balance": 0
}


23:35:56
exec getdogebalance


23:35:56
{
  "Command": "getdogebalance",
  "address": "DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg",
  "block_explorer": "https://live.blockcypher.com/doge/address/DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg/",
  "balance": 0
}


23:35:57
exec getdogebalance


23:35:57
{
  "Command": "getdogebalance",
  "address": "DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg",
  "block_explorer": "https://live.blockcypher.com/doge/address/DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg/",
  "balance": 0
}


23:35:58
exec getdogebalance


23:35:58
{
  "Command": "getdogebalance",
  "address": "DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg",
  "block_explorer": "https://live.blockcypher.com/doge/address/DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg/",
  "balance": 0
}


23:35:59
exec getdogebalance


23:36:00
{
  "Command": "getdogebalance",
  "address": "DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg",
  "block_explorer": "https://live.blockcypher.com/doge/address/DGjA8S7p1TboyCb3XDi1GG7rEkWjvNAaSg/",
  "balance": 0.2744
}
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on February 05, 2025, 04:34:25 AM
Ahh, thank you for the screenshots.
Actually its really good to see that you both had the same problem, because ironically I have not had it from my VM or my home pc.

Its possible that I fixed something that did not get in the latest release; really busy at work, so Im going to have to try to reproduce this on my laptop which is not using the compiled version.

Give me a couple days for things to settle down and ill be back asap.

PS In theory you do not have to list orderbook or create atomic from command line (command line should only be needed for the exec getdogebalance etc).  Aids_S,  out of curiosity, on those instances where you had a 0 return for getdogebalance, were those after spends or were they just random problems?  (Cause that should only happen after a spend). 

PS II:  One other thing can you both try in the mean time:  There is a timer meant to save resources, inside the Exchange page inside the order book grid.
It goes to sleep once every few mins and only wakes up if there is mouse move Over the top or bottom grid.  Try this, after the orderbook goes blank (and after 2+ mins after a cold boot) click around in the grid area and wait a few secs and see if that fixes it?

Hi Rob,

i tried clicking around and restarting the node a few times no luck its just blank.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 08, 2025, 09:47:46 AM
Hi All!

So I believe I found the problem.
I'm testing the solution now.

We should have an update very soon.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 08, 2025, 10:48:11 AM
BIBLEPAY 0.22.9 - Mandatory Upgrade

- Add stability to exchange RPC functions.

https://github.com/biblepay/biblepay/releases/tag/v022.9-Mandatory


All, please upgrade to the latest version (available on the github link above).
Now theoretically all of the commands should be stable.
Aids, can you please check your 'getdogebalance' is stable 7 times in a row during a retest?
And now, Prof Budinga, you can try checking the Exchange room stays populated.
Note that anyone who has an encrypted wallet, you do have to unlock the wallet for the exchange to function.
There is still a 2minute delay after booting the wallet (for the exchange to populate); once that expires it repopulates as you move the mouse over the grids.


Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on February 10, 2025, 04:49:19 AM
BIBLEPAY 0.22.9 - Mandatory Upgrade

- Add stability to exchange RPC functions.

https://github.com/biblepay/biblepay/releases/tag/v022.9-Mandatory


All, please upgrade to the latest version (available on the github link above).
Now theoretically all of the commands should be stable.
Aids, can you please check your 'getdogebalance' is stable 7 times in a row during a retest?
And now, Prof Budinga, you can try checking the Exchange room stays populated.
Note that anyone who has an encrypted wallet, you do have to unlock the wallet for the exchange to function.
There is still a 2minute delay after booting the wallet (for the exchange to populate); once that expires it repopulates as you move the mouse over the grids.

Looks like it has now been solved. Maybe just a suggestion maybe have the amount of BBP and Doge available for trade on the exchange page.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: talisman on February 10, 2025, 02:16:55 PM
Hi Guys!

Sorry, late in the game - hectic these days. I just downloaded 0.22.9 and here is what I have seen so far:

- Exchange showed up fine, populated.
- TRADING-PUBLIC-KEY and TRADING-ASSET-DOGE all there without hassle, cool. For some reason I have 2 addresses labelled TRADING-ASSET-DOGE, don't know if that is normal.
- I transferred some BBP to my TRADING-PUBLIC-KEY
- Checked the board: SELL @ 0.00002939 and BUY @ 0.00002700
- Placed a SELL order for 1000 BBP @ 0.00002900, showed up fine (received warning that min order size is 1000 BBP when tried with lower amount)
- Placed another SELL order for 1000 BBP @ 0.00002700 (where the best BUY was at) : My order just got listed without execution. I understand the book only executes matching orders; so was not surprised to see my order not get executed. Still, kind of awkward to see SELL @ 0.00002700 and BUY @ 0.00002700 on the book :)
- Placed another SELL order for 14777 BBP @ 0.00002700 (to match a standing BUY order on the book) : executed fine, and the BUY order was deleted from the book.
- Cancelled my non-matching SELL order @ 0.00002700 : deleted from the book, good.
- Attempted to mess the book buy placing a non-matching SELL order @ 0.00002600 under the price of the best BUY order @ 0.00002700 : OMG it is listed :)

I think we need to be able to prevent that from happening, until exact matching requirement is lifted.

I will keep playing around and let you know if I come across other glitches. But, all in all, it is WONDERFUL to see this capability in the wallet. Thanks a lot Rob !

 
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 10, 2025, 03:30:35 PM
Looks like it has now been solved. Maybe just a suggestion maybe have the amount of BBP and Doge available for trade on the exchange page.


Ahhh,  great to see that solved it, Praise God!

Yes, good idea, notice I left an area available for metrics.  I also left a little line in between the Bid and Ask where we can put in the current Midpoint (IE the current price).

- Add some volume, price and metrics to the top right and mid pane
- Implement Fractional fills would be sweet

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 10, 2025, 03:33:32 PM
Hi Guys!

Sorry, late in the game - hectic these days. I just downloaded 0.22.9 and here is what I have seen so far:

- Exchange showed up fine, populated.
- TRADING-PUBLIC-KEY and TRADING-ASSET-DOGE all there without hassle, cool. For some reason I have 2 addresses labelled TRADING-ASSET-DOGE, don't know if that is normal.
- I transferred some BBP to my TRADING-PUBLIC-KEY
- Checked the board: SELL @ 0.00002939 and BUY @ 0.00002700
- Placed a SELL order for 1000 BBP @ 0.00002900, showed up fine (received warning that min order size is 1000 BBP when tried with lower amount)
- Placed another SELL order for 1000 BBP @ 0.00002700 (where the best BUY was at) : My order just got listed without execution. I understand the book only executes matching orders; so was not surprised to see my order not get executed. Still, kind of awkward to see SELL @ 0.00002700 and BUY @ 0.00002700 on the book :)
- Placed another SELL order for 14777 BBP @ 0.00002700 (to match a standing BUY order on the book) : executed fine, and the BUY order was deleted from the book.
- Cancelled my non-matching SELL order @ 0.00002700 : deleted from the book, good.
- Attempted to mess the book buy placing a non-matching SELL order @ 0.00002600 under the price of the best BUY order @ 0.00002700 : OMG it is listed :)

I think we need to be able to prevent that from happening, until exact matching requirement is lifted.

I will keep playing around and let you know if I come across other glitches. But, all in all, it is WONDERFUL to see this capability in the wallet. Thanks a lot Rob !

Ahh, thanks for testing and the compliments, sweet!
Notice that I did take into consideration the ability to list another ticker in the future.  Most of the plumbing is there.

I havent dug in to your details too far yet: but notice that when you place an order that matches another order and both are your own (IE the flags are M and M) there is an area of the code where it either cancels both automatically, or ignores them (cant remember which one it is) because it results in an unfillable atomic tx, so that may explain that one exception above.  But yeah everything else should be the "real deal". 

I am going to work on fractional fills soon as that would be exciting to get in there.

Glad we did it, as it provides some value to BBP (rather than just another clone coin); plus Bololex has not come back. 

So im just reading through your message Talisman and on the two addresses for TRADING-ASSET-DOGE, can you paste the pubkeys?  I just want to see if they both end in DGZZ.  That is weird, because we check to see if you have one before we mine a new one.   It should be OK though as when the wallet goes to spend a colored coin, it searches all the DGZZ addresses for it (IE the same type of coin that is being spent in the trading room).  Need to make it so it lists the pubkey on the 'getassetbalance doge' output as well (TODO).

Very cool on the test results, they seem OK.  Now I will get on to fractional fills soon.  When fractional fills work, there will no longer be crosses in the order book.


Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: talisman on February 10, 2025, 04:26:00 PM
Hi again Rob !

Here are the two TRADING-ASSET-DOGE addresses I see in my wallet:

B98GozkCagidcdFMY2zyKf7k3ioud2DgZz
BM9NqJq4JEDcGuEa1oR3vcpKgLPaoeDgzz

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on February 10, 2025, 10:15:17 PM
exec getdogebalance works every time now

the exchange is populated

i attempted to buy all open sell orders and was able to but my exec getassetbalance DOGE only was deducted from twice... i still have over 6 but spent more than that... i have all the bbp

https://chainz.cryptoid.info/bbp/address.dws?BG39CtdNTZHRt2tcQ83Qqdkv6EE2Q3Xm8v.htm

https://chainz.cryptoid.info/bbp/block.dws?564829.htm

idk what im looking at
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on February 11, 2025, 01:59:01 AM

Ahhh,  great to see that solved it, Praise God!

Yes, good idea, notice I left an area available for metrics.  I also left a little line in between the Bid and Ask where we can put in the current Midpoint (IE the current price).

- Add some volume, price and metrics to the top right and mid pane
- Implement Fractional fills would be sweet

So now ive managed to sell some bbp and if i do
exec getassetbalance DOGE

I have a balance i dont seem to be able to buy back now, it says my balance is 0.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 14, 2025, 11:17:21 AM
Hi again Rob !

Here are the two TRADING-ASSET-DOGE addresses I see in my wallet:

B98GozkCagidcdFMY2zyKf7k3ioud2DgZz
BM9NqJq4JEDcGuEa1oR3vcpKgLPaoeDgzz
Yeah its weird because I havent seen that happen to any of my 3 installs (it may be a race condition).
Can you tell me exactly what is the label on each of them?  "TRADING-ASSET-DOGE"?  Yeah, they were both mined as DGZZ DOGE asset addresses so they are valid.  Technically the wallet should work fine with two of those.  I will add code very soon to show the address in 'exec getassetbalance' that goes along with the amount.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 14, 2025, 11:21:06 AM
exec getdogebalance works every time now

the exchange is populated

i attempted to buy all open sell orders and was able to but my exec getassetbalance DOGE only was deducted from twice... i still have over 6 but spent more than that... i have all the bbp

https://chainz.cryptoid.info/bbp/address.dws?BG39CtdNTZHRt2tcQ83Qqdkv6EE2Q3Xm8v.htm

https://chainz.cryptoid.info/bbp/block.dws?564829.htm

idk what im looking at

As you said above when you buy or sell in the trading room, it only affects your wrapped DOGE (IE getassetbalance doge) balance, but only when a fill occurs.
This way you can have standing orders as long as your balance is greater than the sum of the standing orders.
This allows them to fill when you are offline.

For orders that fill when you are offline, the trades still occur and your wrapped balance is subtracted atomically with the other traders tx - even when offline.

However, if a traders wrapped DOGE cannot pay for the order in the orderbook, the order is automatically canceled, so no trades can occur where users do not have funds to cover them (they will be skipped then canceled right away).

So your balances should reflect what was "transacted" up to this point.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 14, 2025, 11:24:14 AM
So now ive managed to sell some bbp and if i do
exec getassetbalance DOGE

I have a balance i dont seem to be able to buy back now, it says my balance is 0.

I do not know what you mean; you would have to start over and write all the tx's down, with their respective debits and credits and addresses.
The amount should be in either your DOGE,BBP, or Wrapped DOGE balance though (it should not be possible to be missing).
You can go through all your tx's in the tx history to see what you traded by double clicking and reading the XML.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on February 14, 2025, 11:56:58 AM
Rob what I was saying is I did like 13-14 trades all purchases i started with about 7 wrapped doge each trade was for about 0.5 doge only 2 trades deducted from my wrapped doge balance I still have 6 wrapped doge even though i should have 0 but i did get all of the bbp...
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on February 14, 2025, 12:14:01 PM
Check this out I just purchased these 5 sell orders which is 1.48 doge but only 0.1625 doge was deducted

also i recieved 7 tx of 2000 bbp when only 2 of the sell orders were for that amount
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 14, 2025, 01:18:38 PM
Check this out I just purchased these 5 sell orders which is 1.48 doge but only 0.1625 doge was deducted

also i recieved 7 tx of 2000 bbp when only 2 of the sell orders were for that amount

Ahh, thanks for the pics.
Luckily, I was the seller so in my wallet I was able to confirm each of these 5 tx's as the counterparty and diagnose this.

Tx 1 = height 565644, txid   f39e5eefa3e9b520d0f47622fc899ea0bb6517c6031f116969ce6ae79d9b0cb8   2000   0.000056   filled
Tx 2 = height 565644, txid   29d6b7afbfd5e225ea0e633853ff229815070d618ff323ab3fb4d9eefc116d03   2000   0.000076   filled

Tx 3 = memory-pool-error      4000   0.000076   error
Tx 4 = memory-pool-error      5000   0.000076   error
Tx 5 = memory-pool-error      7000   0.000076   error

So what is really interesting is somehow in my wallet, it sent the BBP but did not successfully sign over the remaining .22 DGZZ because of a memory pool error.  Not sure what that is, so I have to debug and try to reproduce this.

Checking
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 14, 2025, 01:47:58 PM
Check this out I just purchased these 5 sell orders which is 1.48 doge but only 0.1625 doge was deducted

also i recieved 7 tx of 2000 bbp when only 2 of the sell orders were for that amount
Yeah I found the problem... The good news is, this should actually improve the service in the end to be 100% reliable (which is what we need for this to have any adoption).  The bad news is its kind of complicated and requires a mandatory.

So in our memory pool we have a set of rules where atomics can fail if they violate the colored asset protocol.  Im going to need to modify that to account for multisig txs in some cases where it is allowed to transact the non colored plus the colored in one single atomic tx, as long as the sum(colored sender amount) = spent(colored recv amount).  This will allow the tx to go out in one single atomic tx (thats not exactly how it is today).

So ill work on this next then we can have a new mandatory.  I will probably do this in a way where we just re-test everything we have now and wait for that to finish before we add the complexity of fractional fills.

Please check back over the weekend guys.

I believe we will also have to have a sanc hard fork.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 15, 2025, 12:59:45 PM
Biblepay v023.3 - Mandatory Upgrade for Entire Network

- Fix memory pool validation



https://github.com/biblepay/biblepay/releases/tag/v023.3-Mandatory





Let's give it another shot guys!


Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 15, 2025, 01:10:23 PM
1) If all goes well, these trades should be fully atomic now, meaning that you lose the wrapped DOGE in the same TXID that you gain the BBP, or you lose the BBP and gain the wrapped DOGE atomically in the same TXID.  I just tested one (Note that if you do this you must test on two machines because the tx's are only constructed properly with a counterparty-- not with your own wallet); and it worked!  So far so good on my trade (good luck).  I also tested an ingate and an outgate (which are the same as before).  A nice bonus out of this new feature is if either party either does not have the funds or the tx fails, the entire trade fails and waits for the next block and tries again (which is nice if we lose our quorum for some reason).  Additionally these trades work with instantsend, so you should see the trade go through instantly and see the lightning bolt (when the supermajority of the sancs are upgraded properly).

2) After we get over this hump and things appear to work perfectly then we can move on to fractional fills and populating the metrics in.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on February 15, 2025, 01:24:32 PM
was i suppose to wait for sancs to upgrade before testing ? because i think i got a similar error again when selling bbp 7 sells resulted in 18 tx out of bbp but i think i got all the doge
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on February 15, 2025, 01:25:40 PM
screenshots
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on February 15, 2025, 01:37:47 PM
could i be on a fork or something?

my blockheight 565864 - Sat Feb 15 14:35:08 2025 - 000000db04270eadc190de339a848e54cc3a027a3bda97eecd7bd25d5bafe171

cryptoid is up to 565880 ...  https://chainz.cryptoid.info/bbp/block.dws?565880
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 15, 2025, 01:45:47 PM
screenshots
You should be fine because it was a hard fork, 00000237a182585f0ce421958a4fce3bb73a86c7a8edc56c24ee9b3acd1c5255
is the hash for 565868 - are you synced with me now?
(We cant check chainz now until we notify them).

Actually I think it worked this time, because the trades that you made at that time- im looking at all the DOGE I lost and the BBP i gained.
I gained 84K bbp and lost 9.4 wrapped doge.  So you should have lost 84k bbp from your wallet.  I can tell its working now because every
tx in my wallet has 2 rows for each one (IE losing bbp, gaining wdoge). 

If you can check one all by itself and just watch it til it fills and then monitor your wdoge asset balance and your bbp balance you should see both change.

I just put a few more in


Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 15, 2025, 04:41:43 PM
could i be on a fork or something?

my blockheight 565864 - Sat Feb 15 14:35:08 2025 - 000000db04270eadc190de339a848e54cc3a027a3bda97eecd7bd25d5bafe171

cryptoid is up to 565880 ...  https://chainz.cryptoid.info/bbp/block.dws?565880
Aha!  I see what you were talking about, I was doing some more testing to see exactly what is being transferred.
So realize that the Native BBP going from wallet to wallet will look fine in the transaction list, because the debit in one wallet is really a negative in the txlist, and the credit in the other wallet is a Credit, so that part is not confusing.

HOWEVER, on the colored asset (IE getassetbalance DOGE), since the atomic tx sends the original owner Change, it will actually look as if you are Receiving more DOGE PLUS receiving the BBP if you are the seller.  Thats pretty confusing (we can fix that cosmetically later once we certify the operation of the exchange with about 40+ tests etc and everyone feels comfortable that it is working right).

So I did a test as a buyer just now, and the way I verified it was I recorded my BBP balance before and after the trade and I can see my exec getassetbalance doge going down, my BBP going up, but yet I see a credit in the txlist for +1.2 colored doge-- that is because if you look at getrawtransaction, if you audit the tx, there is 1.2 wdoge in change but yet my wdoge decreased NET by .4.... 

So yeah I believe this is all actually working so far..

Ill see if I can come back online and do 6 tests wallet to wallet and log the results in a spreadsheet.

In the end we just want to see that the only cosmetic issue that needs fixed is the txlist would need to mask the "TRADING-ASSET-DOGE" transactions and just let the rpc show those.


Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on February 15, 2025, 05:22:10 PM
You should be fine because it was a hard fork, 00000237a182585f0ce421958a4fce3bb73a86c7a8edc56c24ee9b3acd1c5255
is the hash for 565868 - are you synced with me now?
(We cant check chainz now until we notify them).

Actually I think it worked this time, because the trades that you made at that time- im looking at all the DOGE I lost and the BBP i gained.
I gained 84K bbp and lost 9.4 wrapped doge.  So you should have lost 84k bbp from your wallet.  I can tell its working now because every
tx in my wallet has 2 rows for each one (IE losing bbp, gaining wdoge). 

If you can check one all by itself and just watch it til it fills and then monitor your wdoge asset balance and your bbp balance you should see both change.

I just put a few more in

yes its synced

yeah so thats the confusing part for me then if i only sold 49k worth of bbp 7 trades @ 7000? how did you get 84k? i lost 126k and you shouldve only spent 3.794 wrapped doge


edit: It must be something to do with when you put in multiple orders for the same amount, like the first time it happened with the 2000 BBP transactions this time with 7000 BBP.  If i do trades one at a time and let them find a match it works fine, when you spam order all of the sells if there's more than 1 match for the order it can buy it multiple times? not sure.

I will put up a bunch of sell orders for 5000 BBP each try to buy all of them at once and see if it replicates the issue for you.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 15, 2025, 06:34:18 PM
Regarding the base behavior, for orders that have different amounts per order, ignoring the txlist, I got a 100% success rate on all fills over two machines over 10 transactions.  I logged the before and after balance during each trade in this spreadsheet - see below.

Yes, it is possible something else is happening with tx's that have the same amount, or maybe it was just the txlist confusion.
What you can do is load BBP on two machines and transact across those and try to replicate it.
I can also take the other side of the trade on a few that have the same amount next.

In the mean time, Im going to push a version (for windows only) with one tiny change that makes it easier to record this audit log.
I added 'exec getassetbalance trading' which shows your Trading-public-key balance.  What Im doing to audit this is doing exec getassetbalance trading and recording it, and exec getassetbalance doge, and recording it and then finishing the trade.  Ill update separately with that windows version in a few minutes.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 15, 2025, 06:39:30 PM
yes its synced

yeah so thats the confusing part for me then if i only sold 49k worth of bbp 7 trades @ 7000? how did you get 84k? i lost 126k and you shouldve only spent 3.794 wrapped doge


edit: It must be something to do with when you put in multiple orders for the same amount, like the first time it happened with the 2000 BBP transactions this time with 7000 BBP.  If i do trades one at a time and let them find a match it works fine, when you spam order all of the sells if there's more than 1 match for the order it can buy it multiple times? not sure.

I will put up a bunch of sell orders for 5000 BBP each try to buy all of them at once and see if it replicates the issue for you.

Ok good on synced.
Yeah, that comment about 84K was a very rough comment before I even started digging into the getrawtransaction, so lets let that one go as i might not have been counting something in my list as I have a lot of dust in there from doing some back and forth testing, but if we can keep a log of some sort as we transact to each other, lets start over and do that.

I will think about the possibility of a duplicate also, and get back to you more on that.
Give me a few mins to release this new version with exec getassetbalance trading.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 15, 2025, 06:42:38 PM
Ok, hopefully this will help you guys hone in on auditing.

If you want, please upgrade to this v0.23.3:
https://github.com/biblepay/biblepay/releases/tag/v023.3-Mandatory

It has the :
exec getassetbalance trading
exec getassetbalance doge

Which you can do before and after a trade and then you can log it in the spreadsheet, and see how your wallet balances were updated.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 15, 2025, 06:57:35 PM
Ok good on synced.
Yeah, that comment about 84K was a very rough comment before I even started digging into the getrawtransaction, so lets let that one go as i might not have been counting something in my list as I have a lot of dust in there from doing some back and forth testing, but if we can keep a log of some sort as we transact to each other, lets start over and do that.

I will think about the possibility of a duplicate also, and get back to you more on that.
Give me a few mins to release this new version with exec getassetbalance trading.

On the 5K transactions, I bought 5 of them at 5K each. My bbp balance increased by 24999 and my w-doge balance decreased by 1.06.
See if yours had the opposite effect, but without looking at the txlist, maybe checking the two commands instead?






Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on February 16, 2025, 08:59:19 PM
ive been trading with myself using 2 machines and im not able to replicate what happened previously

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: talisman on February 17, 2025, 07:19:30 AM
Yeah its weird because I havent seen that happen to any of my 3 installs (it may be a race condition).
Can you tell me exactly what is the label on each of them?  "TRADING-ASSET-DOGE"?  Yeah, they were both mined as DGZZ DOGE asset addresses so they are valid.  Technically the wallet should work fine with two of those.  I will add code very soon to show the address in 'exec getassetbalance' that goes along with the amount.

Hi Rob,

Both addresses have the same label:  "TRADING-ASSET-DOGE"

When I check my asset balance at the console, it reports only one of them though: B98GozkCagidcdFMY2zyKf7k3ioud2DgZz (it seems to hold the wrapped DOGE from my only transaction on the exchange)
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 17, 2025, 11:14:59 AM
ive been trading with myself using 2 machines and im not able to replicate what happened previously
Great on two machines, we will test this extensively before moving it to prod.
Ill also put a mutex on it when we are in there next time for anything.
In the mean time feel free to try to abuse it.

It also could have been during the transition from the fork to instantsend.  If you want, you can reindex your wallet and check and see if any orphaned tx's are released to your main balance.

(Unfortuantely dash took out the feature called -zapwallettxes=1 otherwise I would suggest that).

I think the main priority is to try to see if there is ever an error with these.

One other feature we could probably add, is for me to log the trading balance and the doge balance every time something is done in the tradinglog.  We have a tradinglog.dat file being appended now.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 17, 2025, 11:18:09 AM
Hi Rob,

Both addresses have the same label:  "TRADING-ASSET-DOGE"

When I check my asset balance at the console, it reports only one of them though: B98GozkCagidcdFMY2zyKf7k3ioud2DgZz (it seems to hold the wrapped DOGE from my only transaction on the exchange)

Ok, so to get rid of the second one, just pick the one where the address is not equal to the official one in the RPC output, just edit it and make it something completely different like 'old-asset-doge' and then it wont be used by the wallet.

We will keep an eye on this behavior and see if it happens again.  Ill also think of ways that could cause this race condition.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 20, 2025, 03:18:44 PM
So I assume, with lack of any more complaints that everything is working perfectly as far as trades with perfect matches.

Im going to move on to partial fills next.

Please keep an eye out for the next mandatory upgrade- most likely by the weekend.

If anyone can do any more testing, please do it so we can build on something that already works properly.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on February 24, 2025, 08:06:25 AM
Hi Rob,

I still keep getting public trading key is 1 when i try to sell some bbp,  and i have funded it a couple of times.

any ideas? wallet is unlocked, and i have waited a few blocks.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 24, 2025, 10:52:01 AM
Hi Rob,

I still keep getting public trading key is 1 when i try to sell some bbp,  and i have funded it a couple of times.

any ideas? wallet is unlocked, and i have waited a few blocks.
Hi Bro Budinga,
Can you give me an example or a paste of what output you mean?
Im not sure what you mean.

Heres two things you can try:
1) exec getassetbalance trading
Verify balance is good (^ that command only works on the latest version of the wallet btw).

2) From coin control, find your 'TRADING-PUBLIC-KEY' and verify it has a positive balance.
You may have spent some from it, if so you can just re-send funds to it.
Then you can LOCK the funds with Coin Control to keep that from happening again.
The exchange can spend from it when an order is filled.


Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on February 25, 2025, 01:45:32 AM
Hi Bro Budinga,
Can you give me an example or a paste of what output you mean?
Im not sure what you mean.

Heres two things you can try:
1) exec getassetbalance trading
Verify balance is good (^ that command only works on the latest version of the wallet btw).

2) From coin control, find your 'TRADING-PUBLIC-KEY' and verify it has a positive balance.
You may have spent some from it, if so you can just re-send funds to it.
Then you can LOCK the funds with Coin Control to keep that from happening again.
The exchange can spend from it when an order is filled.

Hi Rob,

exec getassetbalance trading shows i have loads in it, but when i go to coin control the trading public key shows 1bbp. I just sent another 100k coins to see if it goes up.
Ill give it an hour or so, and see.


Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on February 25, 2025, 02:41:53 AM
Hi Rob,

exec getassetbalance trading shows i have loads in it, but when i go to coin control the trading public key shows 1bbp. I just sent another 100k coins to see if it goes up.
Ill give it an hour or so, and see.

Ok now suddenly it seems to be working, maybe i was doing something wrong thanks rob.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 26, 2025, 09:00:23 PM
Ok now suddenly it seems to be working, maybe i was doing something wrong thanks rob.
Ok, glad you got it working.
Just an FYI, both the colored DOGE and the Trading balance (but NOT the native DOGE), those two addresses are internal and should never be out of sync with coin control (as they are regular chain addresses).  If you see an amount in coin control, it must match what is on the RPC.
Unless wallet is syncing or out of sync.  Also, these two addresses use instantsend, so as long as you see a lightning bolt after releasing money to yourself, it is instantly available in the rpc and in the trading room.

The getassetbalance DOGE however, is your private key, but we make a DOGE rpc call to count your UTXOs in real time so that balance can be off for a few minutes if a DOGE block is being mined (for example if you recently spent a DOGE txid, you would see the last balance until the block is mined).  But nevertheless there cannot be a double spend because at the time of spending we spend the confirmed UTXO.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on February 27, 2025, 03:36:35 AM
Ok, glad you got it working.
Just an FYI, both the colored DOGE and the Trading balance (but NOT the native DOGE), those two addresses are internal and should never be out of sync with coin control (as they are regular chain addresses).  If you see an amount in coin control, it must match what is on the RPC.
Unless wallet is syncing or out of sync.  Also, these two addresses use instantsend, so as long as you see a lightning bolt after releasing money to yourself, it is instantly available in the rpc and in the trading room.

The getassetbalance DOGE however, is your private key, but we make a DOGE rpc call to count your UTXOs in real time so that balance can be off for a few minutes if a DOGE block is being mined (for example if you recently spent a DOGE txid, you would see the last balance until the block is mined).  But nevertheless there cannot be a double spend because at the time of spending we spend the confirmed UTXO.

all seems good now. thanks.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on February 28, 2025, 07:38:43 AM
I'm still testing for thourough coverage; I havent encountered any more new errors since our first test that AIDS reported.

Btw, fractional fills are almost done - and portfolio builder is almost ready to test.

I bought someones 60K sale and it worked as expected (BBP +60K, Doge down 2.5 or so).
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 01, 2025, 09:28:06 AM
Biblepay v0.24.2
Mandatory Upgrade


Make Exchange UI remember your row select positions, and refresh gracefully
Add pricing feeds (dogeusd,bbpusd,dogebbp) into the trading room UI, and add the midpoint to the center of the orderbook grids.
Add XLM/XRP multiwallet support
Add PortfolioBuilder phase 1 (XRP/DOGE/XLM) multiwallet
Added fractional fills to exchange, as long as the fractional remainder will be > 25K bbp


https://github.com/biblepay/biblepay/releases/tag/v024.2-Mandatory
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 01, 2025, 11:34:34 AM
To test Portfolio Builder:

Note that we have a new version of BBPExtensions, so after this newest upgrade, click on Extensions.
From that list of Apps, click Portfolio Builder.

The new wallet creates a few new keys:
ASSET-XLM
ASSET-XRP
ASSET-BBP

These are intended to be Portfolio Builder private keys (they never leave the machine and are private to your BBP core wallet).
The idea is when you send assets into these keys, they will be countable by Portfolio Builder (which gives you the ability to earn APR% annual rewards from the PB feature).  The rewards come in the form of Staked Block BBP rewards, which are not enabled yet).

So the way multi wallet works is when you launch PB, the BBP core wallet encrypts these 3 keys and sends them to the multiwallet.  Note the multiwallet runs on your machine in C#, so the keys are never exposed to the outside world.

However, with these 3 keys you can now send and receive XRP/XLM/DOGE from the multiwallet.

The code in the multiwallet is smart enough to create a Stellar or Ripple account if one does not exist.  So this only comes into play if you are sending Stellar from a BBP Stellar wallet to another BBP stellar wallet (we detect that and call the stellar c# code to create the new account).  If you fund Stellar from another stellar account they automatically create the account for you.

For Ripple, the XRP network will create an account for you if you fund the wallet with more than 20 XRP into your BBP Ripple wallet.  That is their network minimum (not ours).  Be careful if you plan on using Ripple, to send it more than 20 XRP to the address so that you don't lose the usability of the address.

In Phase 2, I will add the ability to see the APR% and you assessed staking level, and also to receive the extra rewards.



Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 01, 2025, 11:37:53 AM
The Exchange has a couple new features:  You can see smooth refreshing, it remembers your last persisted row position that you clicked, it has some price feeds, and notice the midpoint (the current BBP-DOGE price) is on the middle of the screen.

To use the new fractional fills feature you must have a big enough order in that will result in more than 25,000 extra BBP after the fractional fill is filled.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on March 03, 2025, 06:54:43 AM
To test Portfolio Builder:

Note that we have a new version of BBPExtensions, so after this newest upgrade, click on Extensions.
From that list of Apps, click Portfolio Builder.

The new wallet creates a few new keys:
ASSET-XLM
ASSET-XRP
ASSET-BBP

These are intended to be Portfolio Builder private keys (they never leave the machine and are private to your BBP core wallet).
The idea is when you send assets into these keys, they will be countable by Portfolio Builder (which gives you the ability to earn APR% annual rewards from the PB feature).  The rewards come in the form of Staked Block BBP rewards, which are not enabled yet).

So the way multi wallet works is when you launch PB, the BBP core wallet encrypts these 3 keys and sends them to the multiwallet.  Note the multiwallet runs on your machine in C#, so the keys are never exposed to the outside world.

However, with these 3 keys you can now send and receive XRP/XLM/DOGE from the multiwallet.

The code in the multiwallet is smart enough to create a Stellar or Ripple account if one does not exist.  So this only comes into play if you are sending Stellar from a BBP Stellar wallet to another BBP stellar wallet (we detect that and call the stellar c# code to create the new account).  If you fund Stellar from another stellar account they automatically create the account for you.

For Ripple, the XRP network will create an account for you if you fund the wallet with more than 20 XRP into your BBP Ripple wallet.  That is their network minimum (not ours).  Be careful if you plan on using Ripple, to send it more than 20 XRP to the address so that you don't lose the usability of the address.

In Phase 2, I will add the ability to see the APR% and you assessed staking level, and also to receive the extra rewards.

Hi Rob,

This is great , i am trying to test it now but i keep getting an error please see attached image. My wallet is unlocked and i have tried also as Administrator.

Any ideas?

Thanks
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 03, 2025, 07:11:03 PM
Hi Rob,

This is great , i am trying to test it now but i keep getting an error please see attached image. My wallet is unlocked and i have tried also as Administrator.

Any ideas?

Thanks

Hi Bro Budinga,

Lets try this:
1) Completely close Extensions
2) Unlock wallet in BBP core first from command line
3) Open Extensions, and verify it says PB v1.52 on the list
4) Launch PortfolioBuilder

See if it still does that.  I just ran this on my home PC which had a locked wallet and everything worked.

If it still fails, then do this:
Navigate to %appdata%\biblepay
You should have a pb.dat file, open it and see if there are 4 encrypted keys in there.
Thats what its looking for when it opens.

Most likely it was just the order that you did things (wallet has to be unlocked before launching extensions from the left menu).
Once extensions has that file, then you are good in the future as order no longer matters.

PS :  I just remembered the most likely reason.  You have to be on v0.23.9 for all this to work, as that is the latest version and only that version writes the pb.dat file.  You can actually get PB's latest version, even on old BBP wallets, because the Extensions module self upgrades each submodule, so thats possibly whats going on there.



Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on March 04, 2025, 05:24:11 AM
Hi Bro Budinga,

Lets try this:
1) Completely close Extensions
2) Unlock wallet in BBP core first from command line
3) Open Extensions, and verify it says PB v1.52 on the list
4) Launch PortfolioBuilder

See if it still does that.  I just ran this on my home PC which had a locked wallet and everything worked.

If it still fails, then do this:
Navigate to %appdata%\biblepay
You should have a pb.dat file, open it and see if there are 4 encrypted keys in there.
Thats what its looking for when it opens.

Most likely it was just the order that you did things (wallet has to be unlocked before launching extensions from the left menu).
Once extensions has that file, then you are good in the future as order no longer matters.

PS :  I just remembered the most likely reason.  You have to be on v0.23.9 for all this to work, as that is the latest version and only that version writes the pb.dat file.  You can actually get PB's latest version, even on old BBP wallets, because the Extensions module self upgrades each submodule, so thats possibly whats going on there.

Hi Rob,

how do i unlock from the command line when i use the walletpassphrase command it just returns null, 
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on March 04, 2025, 05:33:29 AM
Hi Rob,

how do i unlock from the command line when i use the walletpassphrase command it just returns null,

Sorry ignore that last one it does work. But i still get the same error could it be something on my pc blocking it?
I have close - reopened - restarted and i get the same error and also i have the latest client installed.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 04, 2025, 12:13:11 PM
Sorry ignore that last one it does work. But i still get the same error could it be something on my pc blocking it?
I have close - reopened - restarted and i get the same error and also i have the latest client installed.
When you put in the right phrase, it just returns null meaning "success". 
So that part passed.
Now just go back to the reply and see the question about the pb file, and see whats up with all that part?

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on March 05, 2025, 01:32:16 AM
When you put in the right phrase, it just returns null meaning "success". 
So that part passed.
Now just go back to the reply and see the question about the pb file, and see whats up with all that part?

I have an ipc.dat file and thats it, and a BMS folder.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on March 05, 2025, 01:41:35 AM
I have an ipc.dat file and thats it, and a BMS folder.

I think i solved it. The pb.dat file was in my blockchain folder. I then copied it to the %appdata% biblepay folder and the portfolio builder launched straight away. Maybe something to do with me not using default folders.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 05, 2025, 07:08:35 AM
I think i solved it. The pb.dat file was in my blockchain folder. I then copied it to the %appdata% biblepay folder and the portfolio builder launched straight away. Maybe something to do with me not using default folders.

Ahh, yeah thats the whole problem.  It assumes the users Biblepay data folder is always at one of three places (Mac,Win,Linux have different defaults).
Its assuming %appdata%\biblepay for windows.
Will have to make a way for the code to respect the custom folder path in our nice-to-have list.

That also explains why your ipc.dat was not being read- which only affects the old behavior when we had a compiled version of unchained for a short period of time.  IPC is used to determine if Unchained was launched successfully so in your case it would just time out.  (No longer used now, however).

Alright let me know how PB works.  I dont forsee any problems with those 3 offline wallets because the code base for each of those is pretty battle hardened.  Stellar released its own version of an SDK (we are using that) and Ripple is very similar: we use its SDK.  Doge is using NBitcoin, same code that runs on unchained when you send or receive BBP.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on March 05, 2025, 08:32:47 AM
Ahh, yeah thats the whole problem.  It assumes the users Biblepay data folder is always at one of three places (Mac,Win,Linux have different defaults).
Its assuming %appdata%\biblepay for windows.
Will have to make a way for the code to respect the custom folder path in our nice-to-have list.

That also explains why your ipc.dat was not being read- which only affects the old behavior when we had a compiled version of unchained for a short period of time.  IPC is used to determine if Unchained was launched successfully so in your case it would just time out.  (No longer used now, however).

Alright let me know how PB works.  I dont forsee any problems with those 3 offline wallets because the code base for each of those is pretty battle hardened.  Stellar released its own version of an SDK (we are using that) and Ripple is very similar: we use its SDK.  Doge is using NBitcoin, same code that runs on unchained when you send or receive BBP.

Ill try, now i just have to figure out how to convert the doge i traded on our exchange in to doge in the portfolio builder.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 05, 2025, 10:55:01 AM
Ill try, now i just have to figure out how to convert the doge i traded on our exchange in to doge in the portfolio builder.
Once you move your colored doge to native doge the PortfolioBuilder DOGE balance should match the 'exec getdogebalance' as its the same key.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on March 06, 2025, 08:31:01 AM
Once you move your colored doge to native doge the PortfolioBuilder DOGE balance should match the 'exec getdogebalance' as its the same key.

Sorry Rob one more silly question from me :). How exactly do i do that :).
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 07, 2025, 08:16:37 AM
Sorry Rob one more silly question from me :). How exactly do i do that :).
No problem bruvva, just a full end to end example for clarity.
Say a new user wants to move 50 doge to the native doge wallet.
exec getdogebalance
That shows your public doge key.
Send doge there.  After it is more than 1 block do an 'exec getdogebalance' and see the balance has increased (of native doge).


Convert native doge to colored:
Now the user wants to convert 25 doge to colored doge (for trading in the trading room).
exec wrap doge 25
That converts the doge to colored then you can do :
exec getassetbalance doge
Which shows your 25 colored doge balance, while exec getdogebalance now shows 0.

Now you trade for a while and end up with 26 colored doge in 'exec getassetbalance doge'.

To convert back to native doge:
exec unwrap doge 25

Then after that you can do:
exec getdogebalance
And it will be 25 native again.

Also that key will have the same balance as the portfolio builder DOGE key.

PS I will work on portfolio builder rewards next.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on March 07, 2025, 08:35:42 AM
No problem bruvva, just a full end to end example for clarity.
Say a new user wants to move 50 doge to the native doge wallet.
exec getdogebalance
That shows your public doge key.
Send doge there.  After it is more than 1 block do an 'exec getdogebalance' and see the balance has increased (of native doge).


Convert native doge to colored:
Now the user wants to convert 25 doge to colored doge (for trading in the trading room).
exec wrap doge 25
That converts the doge to colored then you can do :
exec getassetbalance doge
Which shows your 25 colored doge balance, while exec getdogebalance now shows 0.

Now you trade for a while and end up with 26 colored doge in 'exec getassetbalance doge'.

To convert back to native doge:
exec unwrap doge 25

Then after that you can do:
exec getdogebalance
And it will be 25 native again.

Also that key will have the same balance as the portfolio builder DOGE key.

PS I will work on portfolio builder rewards next.

Fantastic thank you so much, worked like a charm, i enabled rewards in the portfolio builder but i guess ill have to wait for you to work on it.

This is really good work Rob, the fact we do not need an exchange at all is great.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 07, 2025, 09:49:54 AM
Fantastic thank you so much, worked like a charm, i enabled rewards in the portfolio builder but i guess ill have to wait for you to work on it.

This is really good work Rob, the fact we do not need an exchange at all is great.
Thanks bro, I appreciate the compliment.

Yes, will get this out asap.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on March 07, 2025, 09:51:28 AM
Thanks bro, I appreciate the compliment.

Yes, will get this out asap.

I see you already working on it :), thanks
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 07, 2025, 09:54:19 AM
Now for portfolio builder, I just added rewards.

If you close Portfolio Builder and extensions, then re-launch Extensions (it automatically upgrades modules that have a higher version).
Then re-launch portfolio builder.
You should now be able to click Enable Rewards (Plz re-enable rewards, because the Object must be of version >= 3 to work).

See screenshot:

Starting tomorrow, we should start receiving those daily rewards.
The APR is currently set at 12%.

When we go live in Prod, Ill probably have it so people can donate to the foundation as much as they want in BBP to contribute to this endeavor so that we can raise the reward 1% a week until we have say 500-900 active users then we can move it back to a normal amount.  At least theoretically.

But for now the rewards come out of the foundations private key, using our Temple API (which executes from Sanc 1 once per day).
That balance is 6MM currently, but Ill be donating to it, for example to keep it topped up.

EDIT: Minimum payout threshold: you must be owed at least 1BBP for it to pay the reward.


Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on March 11, 2025, 01:40:42 AM
Now for portfolio builder, I just added rewards.

If you close Portfolio Builder and extensions, then re-launch Extensions (it automatically upgrades modules that have a higher version).
Then re-launch portfolio builder.
You should now be able to click Enable Rewards (Plz re-enable rewards, because the Object must be of version >= 3 to work).

See screenshot:

Starting tomorrow, we should start receiving those daily rewards.
The APR is currently set at 12%.

When we go live in Prod, Ill probably have it so people can donate to the foundation as much as they want in BBP to contribute to this endeavor so that we can raise the reward 1% a week until we have say 500-900 active users then we can move it back to a normal amount.  At least theoretically.

But for now the rewards come out of the foundations private key, using our Temple API (which executes from Sanc 1 once per day).
That balance is 6MM currently, but Ill be donating to it, for example to keep it topped up.

EDIT: Minimum payout threshold: you must be owed at least 1BBP for it to pay the reward.

The rewards seem to have gone to 0 on mine yesterday they were showing is this because my coins are too low?
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 11, 2025, 05:40:09 AM
The rewards seem to have gone to 0 on mine yesterday they were showing is this because my coins are too low?
Hi bro,

The total daily reward has to be 1bbp or greater to recv the reward, but that is probably not it.

Can u plz paste a screen shot of your PB screen and Ill try to figure out mathematically whats going on.

Remember its the lowest min(ForeignValueUSD,BBPValueUSD) before it does its total assessment.

Thanks

PS One other "issue" that we have to address for the Prod release:  The XRP,XLM wont really be affected by this as those wallets dont get spent from by the  core wallet.

However, take a look in coin control and make sure your "ASSET-BBP" key still has BBP in it.  It can get spent by normal wallet operations (coins being shuffled around), and as a temporary workaround, you can lock those in coin control once you have some staking coins deposited there.  The other possibility: check your native DOGE balance too.

PPS : I pulled up my PB screen and Im still populated at about the same amount as the old screenshot, so most likely its one of your buckets (IE primary BBP staking address, ASSET-BBP)
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on March 11, 2025, 08:53:25 AM
Hi bro,

The total daily reward has to be 1bbp or greater to recv the reward, but that is probably not it.

Can u plz paste a screen shot of your PB screen and Ill try to figure out mathematically whats going on.

Remember its the lowest min(ForeignValueUSD,BBPValueUSD) before it does its total assessment.

Thanks

PS One other "issue" that we have to address for the Prod release:  The XRP,XLM wont really be affected by this as those wallets dont get spent from by the  core wallet.

However, take a look in coin control and make sure your "ASSET-BBP" key still has BBP in it.  It can get spent by normal wallet operations (coins being shuffled around), and as a temporary workaround, you can lock those in coin control once you have some staking coins deposited there.  The other possibility: check your native DOGE balance too.

PPS : I pulled up my PB screen and I'm still populated at about the same amount as the old screenshot, so most likely its one of your buckets (IE primary BBP staking address, ASSET-BBP)

Hi Rob,

please see attached image.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 11, 2025, 10:14:18 AM
Hi Rob,

please see attached image.
Yeah, I see the problem, it was rounding to the 2nd digit and not the 6th.  Fixed.
Please reclose and relaunch, and see if you get about 7bbp a day now?

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Budinga on March 12, 2025, 01:45:39 AM
Yeah, I see the problem, it was rounding to the 2nd digit and not the 6th.  Fixed.
Please reclose and relaunch, and see if you get about 7bbp a day now?

Great, yep that seems to have fixed it thanks Rob.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 15, 2025, 06:23:14 PM
Biblepay - Leisure Upgrade
v024.3
https://github.com/biblepay/biblepay/releases/tag/v024.3-Leisure



- Add Exchange Wallet Balances UI fields so users can do the main features from the exchange UI
- Fixed Colored DOGE balance display amount (prior to this, this is what was causing 'Unable to create Atomic Tx error')


Hopefully with this release, it will be close enough for us to release to prod and get more users involved.  Once we kick it around a little.

! NOTE !  If your wallet is locked, the exchange will start, but will not function until you unlock the wallet.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on March 16, 2025, 08:50:07 PM
ok so i put in a buy for 250k bbp at 0.0001 doge it seemed to fill from highest seller first instead of lowest? shouldn't it fill from bottom up? also its down from 250k to 72405 but i only got 15555. concerned it didn't take the lower sell first 27600 @ 0.00007700
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on March 17, 2025, 07:05:05 PM
logged in today and my trade is gone but i only got one transaction in for 15555 bbp when i bid for 250k at 0.0001 doge

i know my bbp trading balance is up by 15k but i didnt take note of my doge balance before hand looks like i was only charged for the 1 buy of 15555 bbp .

still a bit confusing
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 18, 2025, 06:02:59 AM
logged in today and my trade is gone but i only got one transaction in for 15555 bbp when i bid for 250k at 0.0001 doge

i know my bbp trading balance is up by 15k but i didnt take note of my doge balance before hand looks like i was only charged for the 1 buy of 15555 bbp .

still a bit confusing

The trades get canceled if our sanctuary poller tests the balance of the buyer (or seller), and determines the available funds to be smaller than the total trade amount, then it auto cancels the trade.  Let me know if that was true at all on your Buy with colored doge side (IE colored balance dropped below trade amount).  I think it gives it a few hours for each trade, before marking one as cancelled.  (Maybe you moved some balances around, in and out).  That also means technically, every order on the board has backing collateral for one instance of a trade - when collateral goes away the trades go away too. 

I have not read your other post yet regarding the FIFO rule, I need to debug that and see why that happens (I think it can happen and probably needs an adjustment in the order of fill in the algorithm).

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 21, 2025, 06:07:22 AM
logged in today and my trade is gone but i only got one transaction in for 15555 bbp when i bid for 250k at 0.0001 doge

i know my bbp trading balance is up by 15k but i didnt take note of my doge balance before hand looks like i was only charged for the 1 buy of 15555 bbp .

still a bit confusing
So second part of the reply:
Current ruleset says it will do a partial fill against the first other trade it finds where the selling price is <= buying price (so instead of filling at lowest first, its filling at first one it finds) where there will be at least 25K of leftover BBP in the remaining tx.

So yes this can be improved by trying to fill at the *cheapest* where there will be at least .10doge leftover (that rule has more to do so the autocanceler will not cancel the new partial amount -- so im changing this from 25K leftover, to .10doge - or Room tradining minimum).

So in response to this, I made it order the order book by price ascending, before it starts the matching process.  This should always fill the cheapest first.

This will be out whenever we have another necessary release.
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on March 21, 2025, 09:47:58 AM
awesome also i know i had enough wrapped doge cause i have like 1600 and the order was for 25 doge
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 21, 2025, 10:18:02 AM
awesome also i know i had enough wrapped doge cause i have like 1600 and the order was for 25 doge

Ok, we definitely only autocancel if the temple thinks the collateral is gone for a particular tx.
However I have seen circumstances where the GetColoredBalance returns 0 while a tx is being spent, and thats probably what happened.
Most of the time instantsend has already fixed that since these trading tx's are actually all native (none are on the DOGE chain) they are both BBP.
So i could add logging so we can see the canceled qty, amount, and estimated users balances.
Lets see if it happens again and on the side Ill see if I can add the logging, if it happens again ill make a high priority to get the logging in.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 22, 2025, 10:57:34 AM
awesome also i know i had enough wrapped doge cause i have like 1600 and the order was for 25 doge
You still have > 1000 colored doge right? Another words, its not in your native doge key (with portfolio builder) its in your colored key and that hasnt been moving?

I was debugging this this morning and I found one other way it can partially fill and cancel.  We have a situation where we mark the tx with "matchedTo" which is what the engine thinks it is going to fill next, but then if that other order it is matched to gets canceled (for real reasons, didnt have enough collateral, probably because it had a user that had other tx's that were filled) then that becomes a problem, because the matched to is canceled.

Working on that next.

The tx's themself are true atomicTx's in that they move the colored and the native in a single two leg tx, so we dont have a risk of a partial fill taking too much from the user, or giving too much.  We just have a situation where we have to partially fill the first one, and make a new atomic that has the lesser amount.



Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on March 22, 2025, 04:58:28 PM
yeah i have over 1500 colored doge
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on March 22, 2025, 08:26:27 PM
So I put an order in for 1,000,000bbp at 0.0001 doge price  total 100 doge the order was then split and it changed to an order for 390kish and an order for 63327 nothing has filled or actually transacted. only interesting thing is there is a sell order for 63327 bbp at 0.00008200 which is the lowest sell order right now. the 390k order vanished as well.

just put a new order in for 1m at 0.00009955 because there is an actual sell at that price lets see what happens.. it split into 3 then 4 then just to the 63327 order nothing actually traded no increase in bbp or decrease in doge
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 23, 2025, 11:15:25 AM
So I put an order in for 1,000,000bbp at 0.0001 doge price  total 100 doge the order was then split and it changed to an order for 390kish and an order for 63327 nothing has filled or actually transacted. only interesting thing is there is a sell order for 63327 bbp at 0.00008200 which is the lowest sell order right now. the 390k order vanished as well.

just put a new order in for 1m at 0.00009955 because there is an actual sell at that price lets see what happens.. it split into 3 then 4 then just to the 63327 order nothing actually traded no increase in bbp or decrease in doge

Ok, I do see that happening.  I see that all night, the sidechain was creating blocks with some tx that would not fill, going from block num 20000 to 23000 but not actually filling the tx.  After yours reached a qty of 0, I put another one in and im reproducing it now, i think there is a problem with the fractional fills.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 26, 2025, 05:55:22 PM
So I put an order in for 1,000,000bbp at 0.0001 doge price  total 100 doge the order was then split and it changed to an order for 390kish and an order for 63327 nothing has filled or actually transacted. only interesting thing is there is a sell order for 63327 bbp at 0.00008200 which is the lowest sell order right now. the 390k order vanished as well.

just put a new order in for 1m at 0.00009955 because there is an actual sell at that price lets see what happens.. it split into 3 then 4 then just to the 63327 order nothing actually traded no increase in bbp or decrease in doge

So theoretically these two bugs (fractional fill - sidechain) and (fill lowest first) should be fixed now.
These were in the sidechain code so I did not need a bbp core client release to accomplish this.
(Although yes, temples who run the BBP API will see a code change when its checked in).




Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: AIDS_SKRILLEX on March 26, 2025, 08:20:37 PM
i just put an order in and i think it worked completely as expected! amazing!
Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 27, 2025, 07:02:25 PM
i just put an order in and i think it worked completely as expected! amazing!
Ahh, thanks!

To each of the testers, general question:
I was thinking, it may actually be altruistic and valuable for us to continue down this path of improving the decentralized exchange.  Especially since we have a lot of the groundwork laid to create another trading room.

What are the top 5 currencies you would like to see tradeable on the platform?

So far my top preferences are XLM, XRP, DASH, GRC, BTC, ETH.  XLM,XRP,ETH cause special problems for us as we have to make the sancs do an ingate and outgate from colored BBP back to the respective networks using each networks respective SDK (XRP SDK, XLM SDK, and Nethereum SDK), however I think technically its probably possible.  To me the most exciting one is XLM because its still the cheapest per unit and we can overcome the small minimum 1XLM fee for the exchange to have in the corresponding sanc derived escrow account.

Title: Re: BIBLEPAY - DOGE DECENTRALIZED EXCHANGE
Post by: Rob Andrews on March 30, 2025, 03:02:20 PM
Biblepay - 0.24.5 - Mandatory Upgrade
https://github.com/biblepay/biblepay/releases/tag/0.24.5-Mandatory



Add support for XLM (Stellar)
Use RSA for key security
Add BBP logo to left menu and trading coin logo to the exchange UI
Add ability to switch exchange currencies (DOGE, XLM)