l8orre
Legendary
Offline
Activity: 1181
Merit: 1018
|
|
February 10, 2014, 06:56:25 AM |
|
Quick question while getting familiar with AE API calls:
Besided showing orders, there is no way to get the actual trades that happened, right? Because I think we need a way to show the current price of an asset, don't we?
Use getTradesThat isn't in the Wiki. I'll peek into the decompiled source to get all calls. Use asset, firstIndex and lastIndex parameters. Indices set range of trades in the history. If omitted 0 and 2^32-1 default values r used. Well, that is a new one to me - certainly very important function call. I'll have to include that in my client. Since when has that been in
|
|
|
|
Come-from-Beyond
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
|
February 10, 2014, 07:28:39 AM |
|
Since when has that been in ~1 week
|
|
|
|
marcus03
|
|
February 10, 2014, 12:45:15 PM |
|
Quick question while getting familiar with AE API calls:
Besided showing orders, there is no way to get the actual trades that happened, right? Because I think we need a way to show the current price of an asset, don't we?
Use getTradesThat isn't in the Wiki. I'll peek into the decompiled source to get all calls. Use asset, firstIndex and lastIndex parameters. Indices set range of trades in the history. If omitted 0 and 2^32-1 default values r used. Thanks! And more questions: What would I need to do to calculate the quantity of an asset in an account by going through the transaction list? If an asset is issued, initially the quantity of assets created belong to the account the asset was created in, right? If transferAsset is used, I can add/substract the quantity from the balance. What if a trade happens? Will there be a "Asset transfer" transaction for the trade without transferAsset being explicilty called? EDIT: The attachment in an "issue asset" transaction should definetly include the assetID.
|
|
|
|
Come-from-Beyond
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
|
February 10, 2014, 01:10:13 PM |
|
What would I need to do to calculate the quantity of an asset in an account by going through the transaction list?
U can't get the correct quantity of an asset easily coz u have to emulate order matching engine. If an asset is issued, initially the quantity of assets created belong to the account the asset was created in, right?
Right If transferAsset is used, I can add/substract the quantity from the balance.
Yes What if a trade happens? Will there be a "Asset transfer" transaction for the trade without transferAsset being explicilty called?
Alice places an ask order 10 USD @ 2 NXT/USD. Her USD asset balance is adjusted by minus 10 USD. Bob places a bid order 7 USD @ 2 NXT/USD. His balance is adjusted by minus 14 NXT. System matches the orders. Alice gets +14 NXT. Bob gets +7 USD. Alice cancels her order. Her USD asset balance is adjusted by plus 3 USD. No an "Asset transfer" transaction happens.
|
|
|
|
marcus03
|
|
February 10, 2014, 02:16:28 PM |
|
Thanks again. So no way to implement it in a lighter way in my client.
Somewhere I read a few days ago about new API call like getBalance which returns NXT and asset balances for an account, but I can't find it any longer. What's that API call again?
|
|
|
|
marcus03
|
|
February 10, 2014, 03:01:27 PM |
|
Thanks again. So no way to implement it in a lighter way in my client.
Somewhere I read a few days ago about new API call like getBalance which returns NXT and asset balances for an account, but I can't find it any longer. What's that API call again?
Ok, found it: nxt?requestType=getAccount&account=...
|
|
|
|
marcus03
|
|
February 10, 2014, 05:13:49 PM |
|
Out of curiosity:
Alice places an ask order 10 USD @ 3 NXT/USD. (Alice wants 10 USD for 30 NXT) Bob places a bid order 10 USD @ 2 NXT/USD. (Bob sells 10 USD for 20 NXT) No other open orders.
How does the system match these orders? 2, 3 or 2.5 NXT/USD trade price?
|
|
|
|
Come-from-Beyond
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
|
February 10, 2014, 06:17:31 PM |
|
Out of curiosity:
Alice places an ask order 10 USD @ 3 NXT/USD. (Alice wants 10 USD for 30 NXT) Bob places a bid order 10 USD @ 2 NXT/USD. (Bob sells 10 USD for 20 NXT) No other open orders.
How does the system match these orders? 2, 3 or 2.5 NXT/USD trade price?
Price depends on order the orders confirmed.
|
|
|
|
marcus03
|
|
February 10, 2014, 06:27:44 PM |
|
Out of curiosity:
Alice places an ask order 10 USD @ 3 NXT/USD. (Alice wants 10 USD for 30 NXT) Bob places a bid order 10 USD @ 2 NXT/USD. (Bob sells 10 USD for 20 NXT) No other open orders.
How does the system match these orders? 2, 3 or 2.5 NXT/USD trade price?
Price depends on order the orders confirmed. So in the example above, if Alice's order was confirmed first, she will get 10 USD for 20 NTX?
|
|
|
|
Come-from-Beyond
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
|
February 10, 2014, 06:30:28 PM |
|
Out of curiosity:
Alice places an ask order 10 USD @ 3 NXT/USD. (Alice wants 10 USD for 30 NXT) Bob places a bid order 10 USD @ 2 NXT/USD. (Bob sells 10 USD for 20 NXT) No other open orders.
How does the system match these orders? 2, 3 or 2.5 NXT/USD trade price?
Price depends on order the orders confirmed. So in the example above, if Alice's order was confirmed first, she will get 10 USD for 20 NTX? The price will be 3 NXT.
|
|
|
|
|
Come-from-Beyond
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
|
February 11, 2014, 01:13:48 PM |
|
|
|
|
|
marcus03
|
|
February 12, 2014, 11:52:28 AM |
|
From the wiki: Place order Places an "ask" or "bid" order for an asset onto the exchange. Request http://localhost:7874/nxt? requestType=BID_OR_ASK& secretPhrase=SECRET& asset=ASSETID& quantity=QTY& price=PRICE& fee=FEE& deadline=DEADLINE& referencedTransaction=REFTXID Where: BID_OR_ASK is either "placeAskOrder" or "placeBidOrder" SECRET is the secret passphrase of the account issuing the transaction ASSETID is the assetID of the asset being ordered QTY is the amount of the asset being ordered PRICE is the bid/ask price, expressed in Nxt-cents (i.e. "145" is "1.45 Nxt")FEE is the fee for the transaction Is this still correct or are prices in full NXT only?
|
|
|
|
Come-from-Beyond
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
|
February 12, 2014, 11:56:13 AM |
|
Is this still correct or are prices in full NXT only?
In cents.
|
|
|
|
xchrix
|
|
February 12, 2014, 12:57:00 PM |
|
guys i am a huge fan of NXT and saw that the asset exchange feature is coming alive! checked the API documentation and looks like its easy to get a list of assets, their orderbook and the trades. i want to make a completely new section on cryptocoincharts.info . beside cryptocoins and exchanges i want to show charts for assets. and i want to start with NXT assets as a promotion. is somebody here willing to help me implementing this? i dont have deep knowledge of the NXT api so it would be good if somebody could implement the cronjobs which are polling the orderbook/trades of an asset and my part is doing the charts and info pages. please contact me at office@cryptocoincharts.info if you want to help. thank and keep up the good work!!!
|
|
|
|
marcus03
|
|
February 12, 2014, 02:27:37 PM |
|
guys i am a huge fan of NXT and saw that the asset exchange feature is coming alive! checked the API documentation and looks like its easy to get a list of assets, their orderbook and the trades. i want to make a completely new section on cryptocoincharts.info . beside cryptocoins and exchanges i want to show charts for assets. and i want to start with NXT assets as a promotion. is somebody here willing to help me implementing this? i dont have deep knowledge of the NXT api so it would be good if somebody could implement the cronjobs which are polling the orderbook/trades of an asset and my part is doing the charts and info pages. please contact me at office@cryptocoincharts.info if you want to help. thank and keep up the good work!!! Sorry Chris, but I have no time left currently. I hope somebody else can jump in and help you.
|
|
|
|
marcus03
|
|
February 12, 2014, 02:31:04 PM |
|
I was trying to get the account number of buyers and sellers by calling getAskOrder/getBidOrder on the orderIDs that are returned with getTrades, but they are no longer available.
Fullfilled orders are immediately deleted from the system, right? So no way to show the seller and buyer account for a trade?
|
|
|
|
bitcoinpaul
|
|
February 12, 2014, 03:32:50 PM |
|
guys i am a huge fan of NXT and saw that the asset exchange feature is coming alive! checked the API documentation and looks like its easy to get a list of assets, their orderbook and the trades. i want to make a completely new section on cryptocoincharts.info . beside cryptocoins and exchanges i want to show charts for assets. and i want to start with NXT assets as a promotion. is somebody here willing to help me implementing this? i dont have deep knowledge of the NXT api so it would be good if somebody could implement the cronjobs which are polling the orderbook/trades of an asset and my part is doing the charts and info pages. please contact me at office@cryptocoincharts.info if you want to help. thank and keep up the good work!!! Very nice! https://bitcointalk.org/index.php?topic=345619.msg5101634#msg5101634
|
|
|
|
xchrix
|
|
February 12, 2014, 04:33:35 PM |
|
guys i am a huge fan of NXT and saw that the asset exchange feature is coming alive! checked the API documentation and looks like its easy to get a list of assets, their orderbook and the trades. i want to make a completely new section on cryptocoincharts.info . beside cryptocoins and exchanges i want to show charts for assets. and i want to start with NXT assets as a promotion. is somebody here willing to help me implementing this? i dont have deep knowledge of the NXT api so it would be good if somebody could implement the cronjobs which are polling the orderbook/trades of an asset and my part is doing the charts and info pages. please contact me at office@cryptocoincharts.info if you want to help. thank and keep up the good work!!! Very nice! https://bitcointalk.org/index.php?topic=345619.msg5101634#msg5101634thx. sent a message
|
|
|
|
Come-from-Beyond
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
|
February 12, 2014, 04:36:20 PM |
|
Fullfilled orders are immediately deleted from the system, right? So no way to show the seller and buyer account for a trade?
Right. Use getTransaction and feed orderId as transactionId.
|
|
|
|
|