You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When querying coins via the get_coins RPC with filter_mode: "selectable", coins are hidden on both sides of an offer — the offered side (correct) and the receive side (incorrect). Only coins being offered should be excluded from selectable results, since receive-side coins aren't locked by the offer.
Expected Behavior
A buy offer (offering XCH, requesting CAT) should only lock/hide the XCH coin used in the offer. The CAT coins should remain visible as selectable, since they aren't part of the offer — they're what we expect to receive.
Similarly, a sell offer (offering CAT, requesting XCH) should only lock/hide the CAT coin. XCH coins should remain selectable.
Actual Behavior
filter_mode: "selectable" hides coins on both sides. This means:
Buy offers hide both the XCH coin (correct) and a CAT coin (incorrect)
Sell offers hide both the CAT coin (correct) and an XCH coin (incorrect)
Evidence
Test environment: 51 buy offers (offering XCH) + 56 sell offers (offering CAT) = 107 total offers active, all created using coin_ids for precise coin selection.
XCH coins
Metric
Value
filter_mode: "owned"
127 coins
filter_mode: "selectable"
25 coins
Difference (owned - selectable)
102 coins hidden
Expected hidden (buy offers only)
51 coins
Extra coins hidden
51 (matches sell offer count exactly)
CAT coins
Metric
Value
filter_mode: "owned"
143 coins
filter_mode: "selectable"
34 coins
Difference (owned - selectable)
109 coins hidden
Expected hidden (sell offers only)
56 coins
Extra coins hidden
53 (approximately matches buy offer count)
The extra hidden XCH coins (51) match the sell offer count exactly. The extra hidden CAT coins (53) closely match the buy offer count (51), with a small difference likely due to offers created/expired during the test window.
Impact
Any application relying on selectable to count available coins will undercount by roughly 2x when many offers are active. In our case, a market maker bot with 100+ simultaneous offers was incorrectly reporting nearly zero free coins and triggering unnecessary coin-splitting operations.
Workaround
We are currently using filter_mode: "owned" to get all coins, then cross-referencing against our own database of which coins are locked by which offers to determine true availability.
Environment
Running a custom build of Sage that includes the coin_ids parameter for make_offer from PR Allow manual coin selection in make offer #761 (Allow manual coin selection in make offer). This is the same PR we raised previously to enable specifying which coin to lock per offer.
~107 simultaneous offers (51 buy, 56 sell), all created using coin_ids to select specific coins
Queried via RPC get_coins with mutual TLS
This bug exists in the core get_coins filtering logic and is independent of the coin_ids feature — it affects any wallet with active offers
Reproduction
Create multiple buy offers (offering XCH, requesting CAT) using specific coin_ids
Create multiple sell offers (offering CAT, requesting XCH) using specific coin_ids
Query XCH coins with filter_mode: "selectable" and filter_mode: "owned"
Compare the difference — it will be roughly 2x the number of offers involving that coin type, instead of 1x
Description
When querying coins via the
get_coinsRPC withfilter_mode: "selectable", coins are hidden on both sides of an offer — the offered side (correct) and the receive side (incorrect). Only coins being offered should be excluded from selectable results, since receive-side coins aren't locked by the offer.Expected Behavior
A buy offer (offering XCH, requesting CAT) should only lock/hide the XCH coin used in the offer. The CAT coins should remain visible as selectable, since they aren't part of the offer — they're what we expect to receive.
Similarly, a sell offer (offering CAT, requesting XCH) should only lock/hide the CAT coin. XCH coins should remain selectable.
Actual Behavior
filter_mode: "selectable"hides coins on both sides. This means:Evidence
Test environment: 51 buy offers (offering XCH) + 56 sell offers (offering CAT) = 107 total offers active, all created using
coin_idsfor precise coin selection.XCH coins
filter_mode: "owned"filter_mode: "selectable"CAT coins
filter_mode: "owned"filter_mode: "selectable"The extra hidden XCH coins (51) match the sell offer count exactly. The extra hidden CAT coins (53) closely match the buy offer count (51), with a small difference likely due to offers created/expired during the test window.
Impact
Any application relying on
selectableto count available coins will undercount by roughly 2x when many offers are active. In our case, a market maker bot with 100+ simultaneous offers was incorrectly reporting nearly zero free coins and triggering unnecessary coin-splitting operations.Workaround
We are currently using
filter_mode: "owned"to get all coins, then cross-referencing against our own database of which coins are locked by which offers to determine true availability.Environment
coin_idsparameter formake_offerfrom PR Allow manual coin selection in make offer #761 (Allow manual coin selection in make offer). This is the same PR we raised previously to enable specifying which coin to lock per offer.coin_idsto select specific coinsget_coinswith mutual TLSget_coinsfiltering logic and is independent of thecoin_idsfeature — it affects any wallet with active offersReproduction
coin_idscoin_idsfilter_mode: "selectable"andfilter_mode: "owned"