Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Query Exchange Rate?

Tiyuk Quellmalz
Registered User
Join date: 9 Jan 2007
Posts: 24
02-02-2009 07:57
Hi,

I know that the people who have privileged access to the Exchange Risk API can do all sorts of querying of current financial data on the Linden Exchange. But I don't need all that data, nor am I starting my own Linden Dollar Exchange website. All I want to do is "convert", at the top level, between Lindens and USD. I don't want to use static values, I want to use something like the Today's Average, or whatever LL officially considers to be the exchange rate between USD and Lindens for the day. Is there any way I can query this over SOAP or HTTP or XML-RPC or something? I am ready and able to do this using a dedicated server, using protocols which may not be supported in LSL - I don't need this in LSL at all.

However, if you have an LSL way to do this, then you can basically cut the HttpRequest out of it and paste that here - that would be great! :)

Thanks,

Tiyuk
Elanthius Flagstaff
Registered User
Join date: 30 Apr 2006
Posts: 1,534
02-02-2009 08:34
I publish the historic exchange rates here: http://ninjaland.net/tools/lindex-market-data/ which might work for you. I could also have a simpler raw data display I can make for you if you think it's helpful but you'll have to tell me what format you want and what data you want in it.

It's not as simple as just publishing the best rate because maybe you want to do a market order or a limit order and if you want to do limit how long do you want to wait and if you want to do market how much do you want to trade.
_____________________
Visit http://ninjaland.net for mainland and covenant rentals or visit our amazing land store at Steamboat (199, 56).

Also, we pay L$0.15/sqm/week for tier donated to our group and we rent pure tier to your group for L$0.25/sqm/week.

Free L$ for Everyone - http://ninjaland.net/tools/search-scumming/
Lindal Kidd
Dances With Noobs
Join date: 26 Jun 2007
Posts: 8,371
02-02-2009 08:36
You can view outstanding buy and sell orders on both the Lindex and XStreet exchanges, as well as see a graph of the exchange rate.

Examine those, then place a limit buy or sell order at an exchange rate you think is likely, in the time frame you are prepared to wait for the order to be filled.
_____________________
It's still My World and My Imagination! So there.
Lindal Kidd
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
02-02-2009 08:42
I'm understanding that you want real-time data. One way might be to periodically scrape the html of http://secondlife.com/currency/market.php to parse out that "Daily Summary" table. It seems to update dynamically, and looking at the page source, it's just a text table. (At the moment it starts on line 448 of the source.)

No idea if the data that populate that table are exposed more directly, assuming that's even the data you'd want.
Elanthius Flagstaff
Registered User
Join date: 30 Apr 2006
Posts: 1,534
02-02-2009 08:47
Qie, that's how I do it. The tricky part is you have to be logged in to get at that info so you need some fancy programming tricks. It's not impossible and if you know how it's easy, but it's not as straightforward as scraping the page.
_____________________
Visit http://ninjaland.net for mainland and covenant rentals or visit our amazing land store at Steamboat (199, 56).

Also, we pay L$0.15/sqm/week for tier donated to our group and we rent pure tier to your group for L$0.25/sqm/week.

Free L$ for Everyone - http://ninjaland.net/tools/search-scumming/
Tiyuk Quellmalz
Registered User
Join date: 9 Jan 2007
Posts: 24
02-02-2009 11:39
Hi Elanthius,

Many thanks for sharing your own (scraped) market data. That is very handy.

Unfortunately, I'm not sure I can use that market data. For the purposes of business, I have committed to defining the "value of a Linden in US Dollars at any given moment" as the rate declared as "Today's average:" in the Daily Summary table of: https://secure-web2.secondlife.com/currency/market.php .

If their average is just based on an average across one row of your table, then that would be great - that means I can use your data (with your permission, of course) to roll up to the Linden number, or something extremely close to it (within L$1.0 per USD).

If not, I may end up writing my own parser of that page (and I'll have to resolve the login issues myself) to get at that one golden value. I'm sort of annoyed that Linden Lab hasn't made this data explicitly queryable using SOAP.

For now, I've got a plug number in my web app which assumes a value of L$265 per USD, and I'll just update that if it changes significantly. The good news is that the app I'm designing is only supposed to provide an estimate of cost, not an actual billable amount.

Thank you all for your responses and insights... they were each very helpful :)

Tiyuk