RiskMan @AgileCamp 2010 - Lugano

474 views

Published on

RiskMan is a simple open source project in the finance industry developed in TDD in Java with 2 purposes in mind:

1. solve a real life problem of a customer

2. produce something didactic and useful as base for preparing exciting code katas.

Please, feel free to comment and use!

http://github.com/pino1068/riskman

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
474
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide










































































  • RiskMan @AgileCamp 2010 - Lugano

    1. 1. RiskMan Open Source Agile Project by SIAgile - Svizzera Italiana Agile Smart Risk Management presented by: giuseppe.dipierri@gmail.com
    2. 2. Why ?
    3. 3. Why ? we like code katas
    4. 4. Why ? we like code katas we like randori
    5. 5. Why ? we like code katas we like randori we like no profit
    6. 6. Why ? we like code katas we like randori we like no profit we need training
    7. 7. Why ? we like code katas we like randori we like no profit we need training let’s show that agile rocks!
    8. 8. Why ? we like code katas we like randori we like no profit we need training let’s show that agile rocks! we wanna a real life project
    9. 9. What ? in 4 weeks job!
    10. 10. What ? in 4 weeks job! portfolio selection with no sql
    11. 11. What ? in 4 weeks job! portfolio selection with no sql “equity:CHF + bond:USA:Aaa”
    12. 12. What ? in 4 weeks job! portfolio selection with no sql “equity:CHF + bond:USA:Aaa” check against portfolio: “from 5% to 13%”
    13. 13. What ? in 4 weeks job! portfolio selection with no sql “equity:CHF + bond:USA:Aaa” check against portfolio: “from 5% to 13%” no db - no web - just shell & files
    14. 14. What ? in 4 weeks job! portfolio selection with no sql “equity:CHF + bond:USA:Aaa” check against portfolio: “from 5% to 13%” no db - no web - just shell & files bottom up approach
    15. 15. What ? in 4 weeks job! portfolio selection with no sql “equity:CHF + bond:USA:Aaa” check against portfolio: “from 5% to 13%” no db - no web - just shell & files bottom up approach ∼ no dependencies
    16. 16. What ? in 4 weeks job! portfolio selection with no sql “equity:CHF + bond:USA:Aaa” check against portfolio: “from 5% to 13%” no db - no web - just shell & files bottom up approach ∼ no dependencies minimalism & pragmatism
    17. 17. How ?
    18. 18. How ? TDD: no test => no code
    19. 19. How ? TDD: no test => no code DDD: no tech name
    20. 20. How ? TDD: no test => no code DDD: no tech name OCP & SoC ...
    21. 21. How ? TDD: no test => no code DDD: no tech name OCP & SoC ... Method: < 7 LoC
    22. 22. How ? TDD: no test => no code DDD: no tech name OCP & SoC ... Method: < 7 LoC Method: one for - one if (or no if at all)
    23. 23. How ? TDD: no test => no code DDD: no tech name OCP & SoC ... Method: < 7 LoC Method: one for - one if (or no if at all) Class < 3 attrs
    24. 24. How ? TDD: no test => no code DDD: no tech name OCP & SoC ... Method: < 7 LoC Method: one for - one if (or no if at all) Class < 3 attrs Method: no base parameter (one only)
    25. 25. How ? TDD: no test => no code DDD: no tech name OCP & SoC ... Method: < 7 LoC Method: one for - one if (or no if at all) Class < 3 attrs Method: no base parameter (one only)
    26. 26. simplicity CHF100 = Money.CHF(100); USD100 = Money.USD(100); final Money sum = Money.CHF(210); assertEquals(sum, CHF100.plus(USD100)); first
    27. 27. domain driven final MoodyRating A2 = MoodyRatings.find("A2"); final Area UE = Area.from("UE"); positions = new Positions() { { add(account("salary", CHF(10))); add(UBS(CHF(100))); add(bond(Bond.from("GECC", A2, UE), CHF(100), "100%")); } }; constraint = contraint("UE,USA", "min 20%"); assertTrue(constraint.checkLimitOn(positions)); design
    28. 28. some example...
    29. 29. > help Menu: -------------------- 'p' or 'positions' - print all positions 'h' or 'help' - print this help 'r or remove' - remove last filter 'check on <group>' - split and check according to criteria and print results, i.e. check on owner max 5% 'group by <criteria>' - print the positions grouped by given criteria 'load <file>' - load positions from given file 'show <data>' - print the values, where <data> can be one of: areas, owners, equities, bonds, moody 'q' or 'quit' - to exit this program 'filter by <criteria>' - change context on positions filtered by given criteria --------------------------
    30. 30. > load “all-positions.csv” [...] aaa13: Equity: SPY - 25'135 with price:113.66 USD = 2'856'844.1 USD aaa13: Equity: HSBC GIF Indian Equity AD - 2'350 with price:183.074 USD = 430'223.9 USD aaa13: Account: CHF-0172-EUR75-CHF 2'100'287.357 CHF aaa14: Account: EUR-0172-EUR75-EUR 3'816'729.798 EUR aaa14: Account: USD-0172-EUR75-USD 581'430.622 USD aaa14: Account: CHF-548713.2120.001.01 -0 CHF aaa14: Account: EUR-548713.2120.814.01 -0.06 EUR aaa14: Account: EUR-0456-0466553-52-001 0 EUR aaa14: Equity: CB-Accent Global Equity Fund Cap B - 2'200 with price:78.29 CHF = 172'238 CHF aaa14: Equity: KPN Koninklijke - 8'200 with price:11.97 EUR = 98'154 EUR aaa14: Equity: Siemens N eur - 200 with price:66.3 EUR = 13'260 EUR aaa14: Account: CHF-0456-0642763-11-000 1'749.957 CHF aaa14: Account: EUR-0456-0642763-12-000 1'871.49 EUR 1'850 positions loaded! Total Value is: 467'770'275.36 USD > cool!
    31. 31. > group by currency ----------------- currency=AUD; aaa2: Account: AUD-0456-0124244-72-001 1'633.694 AUD aaa3: Account: AUD-0456-0540424-72-002 -0.002 AUD aaa4: Account: AUD-0247.681.504.61R 847.208 AUD aaa6: Bond 20110218 - 7.375% Ned Waterschapsbank 18-02-11 rating:NR: 200'000 AUD 102.542% = 205'084 AUD aaa6: Bond 20110218 - 7.375% Ned Waterschapsbank 18-02-11 Pro-rata rating:NR: 0 AUD 0% = 0 AUD aaa6: Account: AUD-0229291049 1'771.315 AUD aaa7: Bond 20100127 - 5.5% Rabo 27-01-10 rating:NR: 350'000 AUD 99.97% = 349'895 AUD aaa7: Bond 20100127 - 5.5% Rabo 27-01-10 Pro-rata rating:NR: 0 AUD 0% = 0 AUD 8 positions found for group: <AUD> ----------------- currency=GBP; pippo1: Account: GBP-0056712AE -0.001 GBP pippo23: Account: GBP-0234-641.817.65N -0 GBP pippo24: Account: GBP-0247-665.980.70B 0 GBP pippo28: Account: GBP-0247-688.557.60R -0 GBP pippo28: Account: GBP-0247-688.557.60R -0.16 GBP pippo33: Account: GBP-0247-693.051.60V 0 GBP pippo34: Account: GBP-0247-697.217.6BB 0 GBP pippo54: Account: GBP-0002194057 0.003 GBP pippo54: Account: GBP-CallGeld LGT-CALL GELD 0 GBP aaa6: Account: GBP-0247.681.504.62H 2'890.803 GBP aaa6: Bond 20110208 - 5.625% BNG 08-02-11 rating:NR: 50'000 GBP 104.99% = 52'495 GBP aaa6: Bond 20110208 - 5.625% BNG 08-02-11 Pro-rata rating:NR: 0 GBP 0% = 0 GBP 12 positions found for group: <GBP>
    32. 32. > check on currency max 5% JPY KO, check <max:5%> but is 21.733% (50'829'486.39 USD over 233'885'137.68 USD) CHF KO, check <max:5%> but is 26.978% (63'097'704.953 CHF over 233'885'137.68 USD) EUR KO, check <max:5%> but is 40.631% (95'030'812.698 USD over 233'885'137.68 USD) USD KO, check <max:5%> but is 14.159% (33'115'022.738 CHF over 233'885'137.68 USD) AUD OK GBP OK > what about if Japan (with its Dept at 200% of GDP) gets on default?
    33. 33. Future ?
    34. 34. Future ? don’t stop here
    35. 35. Future ? don’t stop here goal: katas also on real life projects
    36. 36. Future ? don’t stop here goal: katas also on real life projects goal: training - no profit (siagile)
    37. 37. Future ? don’t stop here goal: katas also on real life projects goal: training - no profit (siagile) goal: conferences, workshops
    38. 38. Future ? don’t stop here goal: katas also on real life projects goal: training - no profit (siagile) goal: conferences, workshops vertical open source (finance industry)
    39. 39. Future ? don’t stop here goal: katas also on real life projects goal: training - no profit (siagile) goal: conferences, workshops vertical open source (finance industry) mentor wanted!
    40. 40. Future ? don’t stop here goal: katas also on real life projects goal: training - no profit (siagile) goal: conferences, workshops vertical open source (finance industry) mentor wanted! new developers are welcome
    41. 41. RiskMan Thanks! see: http://www.github.com/pino1068/riskman Smart Risk Management Open Source Agile Project by SIAgile - Svizzera Italiana Agile presented by: giuseppe.dipierri@gmail.com

    ×