Advanced Instructions for using Maddavo data with TradeDangerous
This page provides some more in-depth information about using Maddavo data with TradeDangerous.

If you need basic instructions for using the data then CLICK HERE.

Importing Data into TradeDangerous

Kfsone has written a plug-in for TradeDangerous that imports Maddavo data. It will check the site and if necessary it will download a small 'price update' file that contains prices for the last 48hrs. If you haven't used this command within that time, then it will download a large file that contains all the known prices. To import price data, use the following command:

> import --plug=maddavo

To import price data AND the latest list of stations, use the following command:

> import --plug=maddavo --option=stations

To import price data AND the latest list of stations AND the latest list of systems, use the following command:

> import --plug=maddavo --option=stations --option=systems

Uploading Data from TradeDangerous

The ' update' command is used to update price data. When this is used, a file 'updated.prices' is created in the TD directory. This file can be uploaded to the Maddavo market share site. Other prices files can be uploaded and will update price data, but the 'updated.prices' file is special because it contains a list of all commodities. For example, if an item is no longer sold at a station, then the buy price and the sell price will be set to 0. This will delete the item from the online prices database.

You edit your own Station.csv to add stations. You can then add prices for that station if it has a market. The Station.csv file from TD can also be uploaded to Maddavo database. Normally when prices for a new station are uploaded, the station is created in the database but the prices file only contains the System and Station names. The Station.csv contains other data such as ls_from_star (the approximate distance of the station from the nav point), blackmarket (whether the station has a black market) or max_pad_size (what size is the station's largest landing pad).

The ls_from_star value changes over time so this value is just an approximate value - what you see in the nav panel when you jump into a system is close enough. You can also sometimes get the distance from the System View by converting the Semi-Major Axis of the orbit from AU to Ls (1 AU = 499 Ls). If you use this method, you have to consider what the station is orbiting. If it is orbiting a planet or moon, then you need to select the body that is actually orbiting the main 'A' star.

The blackmarket value can be '?' (unknown), 'N' (No) or 'Y' (Yes). The blackmarket is in the Contacts in Station Services. You can only get this information by landing at the station.

The max_pad_size value can be '?' (unknown), 'M' (Medium) or 'L' (Large). When stations are created by default the value is unknown. The pad size can be obtained from the System View. All major (rotating) stations such as Coriolis, Orbis and Ocellus have Large pads and can be seen by their distinctive icon in the System View. All outposts (outpost icon) have only a Medium pad as maximum. This is important because some large ships require a large pad and thus cannot land at outposts. So this information is needed if you have a large ship and TD is used to exclude outposts from trading considerations.

How it works

Prices files and Station files are uploaded and stored temporarily on the server for processing. Every 2 minutes, a program runs on the server that processes the files.

Any new stations in the prices files are added. Prices are timestamped, so if there is a later price for an item at a station then the prices are updated. New prices are inserted.

When the station files are processed, any new stations are added. Any data that changes values from default are updated. Newer data wins so that's where the 'modified' timestamp field comes in.

Conflicting or Bad data

For prices, it is possible that people may enter bad data by typos or OCR recognition is sub-optimal. This can result in bad prices or bad station names. Generally, bad prices are fixed by subsequent price uploads for a station. Because the prices are timestamped, we only keep the latest price. If a later price is received, the data is updated. In this way, bad price data is corrected and updated.

Sometimes there might be an item that is no longer sold at a station or an item that was incorrectly entered at a station previously. Updating the buy and sell price to 0 will delete such an item.

For stations, it is possible that people may enter bad data too. Typos are an issue but also there might be stations that no longer exist or were entered in the wrong system. To delete a station, use the station editor (HERE) and delete it. This will permanently delete the station. Also, there may be circumstances where people enter different data for a station (particularly ls_from_star values). The latest value takes priority. This why the station has a 'modified' timestamp.

If you come across a station in the data that doesn't exist in the game but it does in the database, then you can delete it by uploading a Station.csv that has -1 as the distance for the station, or upload a corrections.csv file that marks that station as deleted, or use the online station editor (HERE again). If you come across a station that has different data then update it in your Station.csv and upload it or use the online station editor.

One last comment about ls_from_star... don't be too precious about the precision of this value. The value you see in the nav panel when jumping into a system is OK, but it will change because different times you jump in at different positions but also remember that the station is MOVING as are all the objects in the system are orbiting something. Taking the distance of the star to a planet where the station is orbiting is fine as that will be the average distance. Where there are binary stars or binary planets, then it's more complex and you cannot use the System View.