Wallet Manager Project Code

If you haven’t been following this blog, I’ve periodically posted about a “Wallet Manager” project that myself and my trading partners, Raath and James, have been working on for the past two years to help us manage our Eve activities using the Eve API.

The project started small, with the first page being driven only by the wallet API feed. As we expanded our industrial scope in the game so too did the Wallet Manager’s requirements. Soon I needed to keep track of blueprints, assets, capital production, PI, and tech 2 invention; each new requirement expanded the original scope.

What grew was a project that contained many methods by coders of different proficiencies. James took my undergraduate C/C++ knowledge and showed me how to work with more objects, models, JavaScript, and even Ajax. Over the course of two years we spent many hours developing methods to handle assets (when items get stacked their unique ID changes), minerals pricing, API caching, and ultimately usability.

The code backend is not something we are extremely proud of, but the presentation and workflow has suited our operations well. If you have the fortitude to tolerate our design, then feel free to give our project a test run.

Disclaimer *IMPORTANT*

  1. Code is provided as is.
  2. If you want to try to setup your own instance, I would advice that you have an understanding of PHP, MySQL, and general code architecture. Getting this to run is not a beginner project.
  3. I cannot provide any commitment for bugs corrections, adding features, or providing support.
  4. There are many, many non-sanitized input points that are major security issues as noted in this post. I would not use this as a public-facing site.
  5. There are unfinished pages, hacked together solutions, code in the view, display code in the controllers, etc. — don’t expect clean, production quality code.
  6. Be prepared to edit the database table to enter your users and API keys. The ‘admin’ section is only partially completed.

Prerequisites

  1. MySQL, PHP5+
  2. Yii Framework
  3. phpMyAdmin to efficiently work with the database

Installation

  1. Download the ZIP here. [April 2014 Update] I’ve moved the project to GitHub here.
  2. Extract the code to your var/www folder
  3. Edit protected/config/main.php.changeme
    1. Line 29 contains IP limitations for working with Gii. Enter your WAN IP address here if you want to work with this module.
    2. Line 57/58 contain your database connection information.
    3. Rename to main.php
  4. Edit protected/config/console.php.changeme
    1. Line 22 contains the database name. My project was named after my holding corporation PROHD so the database name is ‘prohd’.
    2. Line 24/25 contain the user/password to login to the application.
    3. Rename to console.php.
  5. Modify Yii path in index.php
    1. Change the path to your Yii framework location $yii=’/usr/local/lib/yii/yii.php’;
  6. Replace /usr/local/lib/yii/caching/CDbCache.php with the one in the zip.
  7. Create database structure with prohd.sql
  8. Create a login in the ‘accounts’ table. The default userLevel is ‘1’.
  9. Enable the API feed by adding a 1,1 row to the apiStatus table.
  10. Define a group in trackingGroups table.
  11. Add your character information in the ‘characters’  table.
  12. Import the Eve static data tables from https://www.fuzzwork.co.uk/dump/
  13. Import the following table into typeBuildReqs for Tech 2 items. You can generate this table using my query or import from the previous table export.

Recommendations

If you are intimated by the scope of the setup procedure, I would recommend that you use the DRK Industry Tracker for your construction projects as my partner Raath is actively developing this project.

Update

https://k162space.com/2013/08/13/wallet-manager-code-update/


2011 Trading and Industry Reflection

Overview

Moved my operations completely out of wormhole space and into known space. Attempted to get into the 0.01 fast flip market in Jita and Amarr. My interested in Eve faded over the Summer with the lackluster expansion and Monoclegate sentiments. I eventually expanded into Capital production with the acquisition of Carrier and Capital Part BPOs. Later on in the year I attempted a Invention/T2 production line but ultimately decided it was far too click heavy for the effort.

Profit Summary

The start of the year, I found great market niches and was moving 35-40 B/month to achieve around 7-9 B/month profit. Later on in the year due to personal life commitments and a lack of interest in Eve, I wasn’t logging in as frequently; I found that I was moving about 15-20 B/month in order to turn a 3-4 B/month profit.

Top 30 Items of 2011

The image on the right shows the top 30 items by profit for the last year. This was definitely a breakout year for me as I experimented with the market to find what Ships, Modules, Implants and other items produce the best profit.

#1 Large CCC’s. The best performer as these rigs are used in Capital and Battleships to reduce the Capacitor recharge cycle time.

#2 Capital Shield Transporter I. Producing Capitals in lowsec and keeping these items on the market was a great cross sell.

#3/4 Large Rigs. No surprise here as these are put in every Battleship.

#5 Maelstrom. I was slow to move into the Maelstrom market but after looking at the standard 2011 nullsec Alpha fleet doctrine, I quickly realized that I needed to be trading these heavy hitters — pun intended.

#6 Ishtar. This HAC was a surprise performer for me as they kept getting sold. My theory is that they are great AFK mission ships.

#7/8. Capital ship and the popular module. Easy cross sell like the Shield Transporter.

#9 Noctis. Everyone wants one.

#14 Oxygen Isotopes. I did not make any profits from the GoonSwarm ice interdiction. I was working through a stockpile of about 2-3 M Isotopes before the announcement hit. I was trading all four racial Isotopes but due to the popularity of Gallente towers, Oxygen Isotopes traded better than the other three.

#19 Hulk. Surprisingly a good performer. The majority of Jita flips came in at 5-6 M profit each.

#21 Dominix. The Space Potato is a great mission ship.

#22 Anshar. I wanted to build one as the project was a end-game build for an Industrialist. Details about the build costs and profits can be found in this post.

#26/27/29 Blockade Runners. This item was also a nice discovery once I started trading them.

#30 Dramiel. With the nerf in Crucible, I have seen a slow down in sales.

#12/13/18/20/24/25/28 Implants. People die.

SQL Profit Query

If you have your own wallet table, here is the query I used to pull up the stats for the year. Granted I took the output and made a nice table with it using PHP, but you can easily work with this query.

$sql = ('SELECT typeID, typeName, sum(profit) AS totalProfit, sum(quantity) AS totalVolume
				FROM wallet
				WHERE DATE(transactionDateTime) > DATE_SUB( DATE( :eveDate ), INTERVAL 365
				DAY )
				AND personal = 0
				AND transactionType = "sell"
				GROUP BY typeID
				ORDER BY totalProfit DESC
				LIMIT 30');

2012 Prospects

I’ve found a new, painless method for moving around large amounts of minerals using compression techniques. The new Tier3 Battlecruisers have great market potential not only in the ship hull, but the associated Large guns and modules.

I have been considering shutting down the Capital operation and venturing into different areas. This will move about 20-25 B worth of BPOs into liquid ISK. More spreadsheets are needed to illuminate my path.


Ammo BPO ME Insanity

Background for the Non-industrialist

That projectile ammo that comes out of your Hurricane guns has been created by a player with minerals and a BPO or a BPC. When BPOs are purchased off of the market, they are not researched. This means that creating from the BPO will most likely result in a loss given the competitive market that exists.

People invest time into increasing the ME (Material Efficiency) level to a high number to lower the material requirements in order to build the item.

ME 500

Often times I see people researching their BPOs to a an insanely high level. More is always better when it comes to ME? Wong.

If you take a look at the EMP L BPO on chruker.dk’s site, there is a box titled Research Levels. Take note of the stated Perfect ME level as going beyond this number will not change the build requirements.

Charting the cost to produce the item based on ME levels shows a logarithmic trend towards the perfect ME level. For our EMP L BPO this perfect level is 320. Researching or paying additional costs for a further researched BPO is worthless.

Take note as every item has its own perfect ME level. Here is a shot of ammo research jobs showing how different the ME levels can be for each type.

Though I did not cover PE (Production Efficiency), the same rules apply in order to reduce the manufacturing time of an item.


PI Customs Office Changes

Another iteration of PI is coming to the server. The existing Office structures in orbit around planets in lowsec, nullsec, and wormhole space will disappear. Players will have to build their own player-controlled Offices in order to move PI items on and off of planets. Note: Highsec will not be affected.

For 6,000 Concord LPs and 20 M ISK, you can get one Customs Office Gantry BPC. Interesting move that the BPO will not be released. This means that people will have to continually engage in Concord LP activities such as Incursions or Faction Warfare.

Jester went into detail about the gameplay changes due to the hit point values, reinforcement timer options, and LP requirements, but I wanted to cover the market aspects of the changes. You might be able to make a lot of money off of the changes. When PI was first introduced, I was able to turn 2 B into around 5 B by playing the speculation game.

Disclaimer: Everything I say and quote could be entirely wrong so do your own research.

As soon as the devblog was posted, the market speculators began to buy up the component items. The consensus is that when this goes live all existing PI in lowsec, nullsec, and wormhole space will be affected. There is going to be a delay to get the new Customs Offices in place because people will have to obtain a BPC from the Concord office, build the Gantries, and anchor them in place. Additionally, there will be a wave of people that will consider this effort to high and give up on their existing PI production. Prices for the parts that made the Gantries, items for POS fuel, and T2 production are going to increase.

Manufacturing the Customs Office Gantry Upgrade to Customs Office
Integrity Response Drones: 5
Nano-Factory: 10
Organic Mortar Applicators: 10
Sterile Conduits: 14
Capital Construction Parts: 1
Broadcast Node: 8
Recursive Computing Module: 8
Self-Harmonizing Power Core: 8
Wetware Mainframe: 8

If you want some hard speculation numbers, a 40-60% increase short-term in the first few months and a general 20% increase over the long-term seems reasonable to me. Take a look at the speculators in action in The Forge.

Now is not a good time to have to buy POS fuel. I hope you have 6 months to a year in reserve!


Capital Industry Calendar

The industry posts at Eve fail have inspired me to start producing Capitals and this has spawned some new requirements out of our Wallet Manager program.

Problem: Expensive Capital BPOs that are idle mean that they are not producing profitable items

Solution: Use the Corporation Industry Jobs API to display a visual aid of capital job production progress as to easily tell when BPOs will be idle

As always, James and I start off with a quick sketch on paper of what we think the final layout should look like. After some scribbling, debates about tables/CSS/javascript, and layout design we settled on a design.

Here is a shot of our paper sketch.

My knowledge of javascript is rather limited and James is usually the one spearheading new and innovative solutions when I present a design challenges.

Notes from James:

Blake often comes to me with a “I need this thing. Can you make this thing?”, to which I often pause and perform what I like to call shriveled programmer stare. This maneuver involves me scrunching my face as much as possible, raising one eyebrow, and giving a bit of a pained look. I’m quite sure I gave this look when the idea was first proposed. The basic idea actually is just a Gantt chart. I have x number of capital ships in production at any given time and I would like to know exactly, at a quick glance, when they come out of the oven so the next batch of parts will be ready. Simple enough, on paper. The real question is implementation.

A first idea was to use a table, and just change the background color if the job is still running on that day. However, we decided we would like to have the chart auto-scale, so that it would always display far enough out to have the end of the longest job on the chart. Doing this as a pure table would have been inelegant at best, with quite possibly a ludicrous amount of table columns needed for very long jobs. Instead, I took a more difficult, but ultimately more elegant approach; use a single row per job and utilize the margin-left and width css properties to control the positioning and length of each bar.

This, however, required that we have non-table-based vertical lines to delineate our days. For this I used Raphael. Raphael is a nifty little SVG canvas library with decent documentation and a good community base.


//Initialize our variables
var width = $this.width();
var height = $this.children('.industry-job-calendar-table').height();
var offset = globals.headerOffset;

var canvasDiv = $this.children('.industry-job-calendar-table').children('.industry-job-calendar-canvas')[0];

//Create the canvas
var paper = Raphael(canvasDiv, width, height + offset);

A lot of work went into getting our start and end dates, and anyone who’s worked with the JS Date object knows how painful operating in the non-native timezone (even if it is UTC) can be. After our fancy date math, we set the job bar properties, draw the canvas object behind the table rows, attach our tooltip hover() events to the bars, then do a pretty animation of the bars to their final widths.

All in all, a nice little idea that came in at around 325 lines of JS and 20 lines of PHP. And to use it is quite simple:

$('#industry-calendar').phdIndustryCalendar({url: './getCapitalJobs.php'});

And the final result is a clean looking display of our Capital production line.