Author

Topic: Looking for a market maker (Read 10042 times)

administrator
Activity: 4228
Merit: 8647
July 27, 2010, 08:23:22 AM
#7
Bitcoin's JSON-RPC deals with floating-point numbers internally, so you need to modify the code to get real precision. Here's a function I wrote to do that:

Code:
std::string taToString(int64 source)
{
std::string number;
std::string splitnumber;
std::stringstream strstream;
strstream < strstream>>number;
int ti=number.length()-1;
bool tdone(false);
while(ti>-1 || tdone==false)
{
if(ti==number.length()-9)
{
splitnumber="."+splitnumber;
tdone=true;
}
if(splitnumber.length()==0)
{
splitnumber=number[ti];
}
else if(ti>-1)
{
splitnumber=number[ti]+splitnumber;
}
if(ti<=-1)
{
splitnumber="0"+splitnumber;
}
ti--;
}

return (splitnumber);
}

Put that in rpc.cpp and replace all instances of nAmount / COIN with taToString(nAmount). Then you'll get a precise string instead of a double.
sr. member
Activity: 350
Merit: 250
probiwon.com
July 27, 2010, 07:44:35 AM
#6
I am recommend use the database and its embedded types

postgresql's "numeric" pretty well for me
full member
Activity: 185
Merit: 102
July 23, 2010, 11:48:34 AM
#5
You are right I'll switch to using decimal arithmetic.
legendary
Activity: 1246
Merit: 1014
Strength in numbers
July 23, 2010, 08:01:32 AM
#4
This is a problem. I got an email saying someone had bought .1BTC for $.061. I don't really mind the tiny trade, but maybe you should throw up a small minimum. The real problem is the my balance now says $.01. Is that my balance? It shouldn't be. But since it says it, it kind of should be.
legendary
Activity: 1246
Merit: 1014
Strength in numbers
July 23, 2010, 07:46:51 AM
#3
Quote
I'm certainly interested in acting as a market maker. I've been playing around with your site, and the basic functionality seems to be there.
Great send me an email when you get a chance or chat me up in the irc channel.

Quote
Professionalism demands that if someone places an order to buy 100 coins at $0.07 each, the total will be $7.00, not 7.00000000000001
This was just a display bug and is fixed now. Let me know if you notice anything else.


You should do something so that that doesn't happen any where. I just got a long string of 9s in the bitcoins sold field.
full member
Activity: 185
Merit: 102
July 18, 2010, 09:20:15 PM
#2
Quote
I'm certainly interested in acting as a market maker. I've been playing around with your site, and the basic functionality seems to be there.
Great send me an email when you get a chance or chat me up in the irc channel.

Quote
Professionalism demands that if someone places an order to buy 100 coins at $0.07 each, the total will be $7.00, not 7.00000000000001
This was just a display bug and is fixed now. Let me know if you notice anything else.
full member
Activity: 185
Merit: 102
July 18, 2010, 07:59:32 AM
#1
I'm looking for someone to act as a market maker on my exchange in order to provide better liquidity. You would have to always hold both a buy and sell order near what you thought the current bitcoin rate should be.
Please email, PM, talk to me if you are interested.
Thanks!
Jump to: