bond trading - tech contract

来源:互联网 发布:3ds淘宝哪家店没问题 编辑:程序博客网 时间:2024/06/07 01:45

Contract definition

Overview

This document defined the contractbetween back-end system (Simulator) and front-end system (java server), it isnot for front-end .net UI and front-end java server. You can define yourinternal contract between java server and .net UI by yourself.

JMS Message Format Example

(Simulator & Front-end java server)

Message Name

Destination

Publisher

Subscriber

Demo

Sell Message

[Topic]

EBOND.BOND.TRADING

Simulator

Front-end java server

{"action":"SELL","quantity":100,

"name":"APPLE 20 years bond", "cusip":"99006D9R0","fv":100,

"couponRate":0.07,"ytm":0.1,

"maturity":20,"rate":"AA-","expiredTimestamp":1425455547185,"tradeId":100001}

Buy Message

[Topic]

EBOND.BOND.TRADING

Simulator

Front-end java server

{"action":"BUY","quantity":100,

"name":"APPLE 20 years bond", "cusip":"99006D9R0","fv":100,

"couponRate":0.07,"ytm":0.1,

"maturity":20,"rate":"AA-","expiredTimestamp":1425455547185,"tradeId":100002,”price”:90}

Stop Sell/Buy Message

[Topic]

EBOND.BOND.TRADING

Simulator

Front-end java server

{“Result”:”CLOSED”,”TradeID”:”100001”}

{“Result”:”CLOSED”,”TradeID”:”100002”}

Bid Message

[Queue] EBOND.BOND.TRADEQUEUE

Front-end java server

Simulator

{“Account”:”DARREN”,”Action”:”BUY”,

”TradeID”:”100001”,”Price”:”90”}

Offer Message

[Queue] EBOND.BOND.TRADEQUEUE

Front-end java server

Simulator

{“Account”:”DARREN”,”Action”:”SELL”,

”TradeID”:”100001”}

Bid Result Message

[Queue]

EBOND.USER.ACCOUNT

 

 

 

{“Result”:”EXECUTED”,”TradeID”:”100001”}

Offer Result Message

[Queue]

EBOND.USER.ACCOUNT

 

Simulator

Front-end java server

{“Result”:”REJECTED”,”TradeID”:”100002”}

Table 1: Tradingmessage format

 

 

Bond Template

Simulator need to generate random bonds every minute, youcan refer to below bond samples.

 

CUSIP: identifier of each bond.

FV: face value.

Coupon Rate:

YTM Rate: Yield to maturity rate.

Maturity: 5 years/10 years/15 years/20 years/30 years.

Bond CUSIP

Bond Type

Bond Name

Issued

Date

CCY

Maturity

Quantity

FV

Coupon Type

Coupon Rate

Expired Time

Credit Rating

YTM

99006C9A9

Corp Bond

IBM 5 years bond

20150102

USD

5

1000

100

Fixed Coupon Rate

6%

20

AAA

10.00%

99003X9B4

US Treasury

IBM 10 years bond

20150103

USD

10

1000

200

Fixed Coupon Rate

5%

30

AAA

10.00%

99006B9C7

Corp Bond

IBM 20 years bond

20150104

USD

20

1000

300

Fixed Coupon Rate

7%

40

AAA

10.00%

99000Q9D8

US Treasury

IBM 30 years bond

20150105

USD

30

1000

400

Fixed Coupon Rate

8%

50

AAA

10.00%

99004X9Z0

Corp Bond

MSFT 5 years bond

20150106

USD

5

1000

500

Fixed Coupon Rate

9%

20

AA+

10.00%

99004T9L0

Corp Bond

MSFT 10 years bond

20150107

USD

10

1000

600

Fixed Coupon Rate

10%

30

AA+

10.00%

99005B9C8

Corp Bond

MSFT 20 years bond

20150108

USD

20

1000

700

Fixed Coupon Rate

5%

40

AA+

10.00%

99002M9U7

US Treasury

MSFT 30 years bond

20150109

USD

30

1000

800

Fixed Coupon Rate

6%

50

AA+

10.00%

99006E9Y3

Corp Bond

APPLE 5 years bond

20150110

USD

5

1000

900

Fixed Coupon Rate

9%

20

AA-

10.00%

99005F9B1

US Treasury

APPLE 10 years bond

20150111

USD

10

1000

###

Fixed Coupon Rate

8%

30

AA-

10.00%

99006D9R0

Corp Bond

APPLE 20 years bond

20150112

USD

20

1000

100

Fixed Coupon Rate

7%

40

AA-

10.00%

99006D9M1

Corp Bond

APPLE 30 years bond

20150113

USD

30

1000

200

Fixed Coupon Rate

10%

50

AA-

10.00%

99006G9T9

US Treasury

GOOGLE 5 years bond

20150114

USD

5

1000

300

Fixed Coupon Rate

5%

20

BBB

10.00%

99004M9W1

Corp Bond

GOOGLE 10 years bond

20150115

USD

10

1000

400

Fixed Coupon Rate

6%

30

BBB

10.00%

99004R9Y6

Corp Bond

GOOGLE 20 years bond

20150116

USD

20

1000

500

Fixed Coupon Rate

7%

40

BBB

10.00%

99006G9B8

Corp Bond

GOOGLE 30 years bond

20150117

USD

30

1000

600

Fixed Coupon Rate

8%

50

BBB

10.00%

99006E9V9

Corp Bond

CITI 5 years bond

20150118

USD

5

1000

700

Fixed Coupon Rate

9%

20

BB+

10.00%

99004U9H6

US Treasury

CITI 10 years bond

20150119

USD

10

1000

800

Fixed Coupon Rate

6%

30

BB+

10.00%

99006C9G6

Corp Bond

CITI 20 years bond

20150120

USD

20

1000

900

Fixed Coupon Rate

5%

40

BB+

10.00%

99006F9Q7

Corp Bond

CITI 30 years bond

20150121

USD

30

1000

###

Fixed Coupon Rate

10%

50

BB+

10.00%

Table 2: Bondtemplate

 

 

Bond Present Value (current price)

1.      Suppose all the Bonds are fixed coupon rate.

2.      Credit Rating: AAA/AA+/AA-/BBB/BB, from high tolow.

3.      Bond price valuation: Follow the standardvaluation formula.

http://www.zenwealth.com/businessfinanceonline/BV/BondPrice.html

 

 

 

 

 

JMS Topic & Queue

Destination Description

 

Type

Destination Name

Simulator  broadcast sell/buy requests

Topic

EBOND.intern.topic.backend

 

 

Backend trading service send trading result to front end systems

(Backend service -> Frontend Java Servers)

Queue

(Every front end system has a dedicated queue, the name is just like below format)

EBOND.intern.queue.team1

EBOND. intern.queue.team2

EBOND. intern.queue.team3

EBOND. intern.queue.team4

EBOND. intern.queue.team5

EBOND. intern.queue.team6

 

 

Front end systems send buy/sell request to back end trading service

(Frontend Java Server -> Backend Service)

Queue

 

EBOND.intern.queue.backend

 

 

Table 3: Topic, Queue

 

Appendix

SVN repository:

svn://vm-f0d4-512b/Intern2015  user: soeid password: same as user

Each team can create a folder under above link.

 

JMS (Tibco EMS broker)

vm-e177-70ed.nam.nsroot.net:18603

 

EBOND.intern.topic.backend

EBOND.intern.queue.team1

EBOND. intern.queue.team2

EBOND. intern.queue.team3

EBOND. intern.queue.team4

EBOND. intern.queue.team5

EBOND. intern.queue.team6

EBOND.intern.queue.backend

 

(You need to include jms.jar and Tibco ems packages in yourclasspath)

 

Oracle DB

All teams share the same oracle database schema.

Each team can create different tables.

 

DRIVER_NAME="oracle.jdbc.driver.OracleDriver";

DB_URL="jdbc:oracle:thin:@fxdspmwdb1d.nam.nsroot.net:2523:DSPDBD5";

DB_USER="DSP_DBO";

DB_PASSWORD="dsp24dbo";

 

 

Please don’t touch other tables that used by some otherapplications.

(You need to include class12.jar Oracle client dirver inyour classpath)

 

0 0
原创粉丝点击