aboutsummaryrefslogtreecommitdiffstats
path: root/python/Dawn/static
diff options
context:
space:
mode:
Diffstat (limited to 'python/Dawn/static')
-rw-r--r--python/Dawn/static/LMCG.pngbin50746 -> 0 bytes
-rw-r--r--python/Dawn/static/dawn.css5
-rw-r--r--python/Dawn/static/dawn.js194
-rwxr-xr-xpython/Dawn/static/favicon.icobin5430 -> 0 bytes
-rw-r--r--python/Dawn/static/utils.js26
-rw-r--r--python/Dawn/static/wire.js46
6 files changed, 0 insertions, 271 deletions
diff --git a/python/Dawn/static/LMCG.png b/python/Dawn/static/LMCG.png
deleted file mode 100644
index ec1c5292..00000000
--- a/python/Dawn/static/LMCG.png
+++ /dev/null
Binary files differ
diff --git a/python/Dawn/static/dawn.css b/python/Dawn/static/dawn.css
deleted file mode 100644
index cac2a4e2..00000000
--- a/python/Dawn/static/dawn.css
+++ /dev/null
@@ -1,5 +0,0 @@
-body {
- max-width:1500px;
- margin: 0 auto;
- padding-top: 70px;
-} \ No newline at end of file
diff --git a/python/Dawn/static/dawn.js b/python/Dawn/static/dawn.js
deleted file mode 100644
index ac972e24..00000000
--- a/python/Dawn/static/dawn.js
+++ /dev/null
@@ -1,194 +0,0 @@
-var index_list = [];
-var bbg_map = {'CDX': ["IG", "HY"], 'ITRX': ["EUR", "XOVER"]};
-var series_map = {'CDX': ["24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35"],
- 'ITRX': ["24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34"]};
-var index_tenor = ["3Y", "5Y", "7Y", "10Y"];
-for(var begin_index in bbg_map){
- for(var index_type of bbg_map[begin_index]){
- for(var series of series_map[begin_index]){
- for(var tenor of index_tenor){
- index_list.push(`${begin_index} ${index_type} CDSI S${series} ${tenor}`);
- }
- }
- }
-};
-
-$(function() {
- $('#security_desc').attr('list', 'index_list');
- var security_desc = document.getElementById('security_desc');
- if (security_desc) {
- security_desc.addEventListener('change', (event) => {
- fetch(`../../_ajax?bbg_id=${encodeURIComponent(event.target.value)}&` +
- `trade_date=${$('#trade_date').val()}`)
- .then(data => data.json())
- .then(data => {
- $('#fixed_rate').val(data['coupon']/100);
- $('#security_id').val(data['redcode']);
- $('#maturity').val(data['maturity']);
- });
- if (event.target.value.startsWith("ITRX")) {
- $('#currency').val("EUR");
- } else{
- $('#currency').val("USD");
- }
- });
- }
- $('#folder').change(function() {
- if ($('#swap_type').val() == 'CD_INDEX') {
- switch ($(this).val()) {
- case 'IGOPTDEL':
- case 'HYOPTDEL':
- $('#portfolio').val('OPTIONS');
- break;
- case 'SER_HYCURVE':
- case 'SER_ITRXCURVE':
- case 'SER_IGCURVE':
- case 'XCURVE':
- $('#portfolio').val('CURVE');
- break;
- case 'HYEQY':
- case 'HYMEZ':
- case 'HYSNR':
- case 'IGEQY':
- case 'IGMEZ':
- case 'IGSNR':
- case 'XOEQY':
- case 'XOMEZ':
- case 'BSPK':
- $('#portfolio').val('TRANCHE');
- $('#swap_type').val('CD_INDEX_TRANCHE');
- $('#swap_type').change();
- break;
- case 'HYINX':
- case 'IGINX':
- case 'XOINX':
- case 'EUINX':
- $('#portfolio').val('TRANCHE');
- break;
- case 'HEDGE_CLO':
- $('#portfolio').val('CLO');
- break;
- case 'HEDGE_MAC':
- $('#portfolio').val('HEDGE_MAC');
- break;
- case 'HEDGE_CSO':
- $('#portfolio').val('STRUCTURED');
- break;
- case 'HEDGE_MBS':
- case 'MBSCDS':
- $('#portfolio').val('MORTGAGES');
- break;
- }
- }
- var strat = $(this).val();
- if (strat.startsWith('CRT')) {
- $('#asset_class').val('CRT');
- } else if (strat.includes('MTG')) {
- $('#asset_class').val('Subprime');
- } else if (strat.includes('CLO')) {
- $('#asset_class').val('CLO');
- } else {
- $('#asset_class').val('CSO');
- }
- });
- $('#swap_type').change(function() {
- var to_hide, to_show;
- const hide = (arr) => arr.forEach(id => {
- document.getElementById(id)
- .parentElement
- .parentElement
- .style.display = 'none';
- });
- const show = (arr) => arr.forEach(id => {
- document.getElementById(id)
- .parentElement
- .parentElement
- .style.display = 'block';
- });
- switch ($(this).val()) {
- case 'CD_BASKET_TRANCHE':
- case 'CD_INDEX_TRANCHE':
- case 'BESPOKE':
- show(['orig_attach', 'orig_detach', 'initial_margin_percentage',
- 'index_ref', 'corr_attach', 'corr_detach']);
- hide(['clearing_facility', 'account_code']);
- $('#clearing_facility').val('');
- $('#portfolio').val('TRANCHE');
- break;
- case 'CD_INDEX':
- hide(['orig_attach', 'orig_detach', 'initial_margin_percentage',
- 'index_ref', 'corr_attach', 'corr_detach']);
- show(['clearing_facility', 'account_code']);
- $('#clearing_facility').val('ICE-CREDIT');
- $('#folder').change();
- break;
- case 'ABS_CDS':
- hike(['orig_attach', 'orig_detach',
- 'index_ref', 'corr_attach', 'corr_detach',
- 'clearing_facility']);
- show(['initial_margin_percentage']);
- $('#clearing_facility').val('');
- $('#portfolio').val('MORTGAGES');
- break;
- case 'SWAPTION':
- hide(['fixed_rate', 'index_ref', 'security_desc']);
- $('#portfolio').val('IR');
- $('#settlement_type').val('Cash');
- break;
- case 'CD_INDEX_OPTION':
- show(['fixed_rate', 'index_ref', 'security_desc']);
- $('#portfolio').val('OPTIONS');
- $('#settlement_type').val('Delivery');
- break;
- }
- });
- $('#partial_termination').change(
- function() {
- if( $(this).prop('checked') ) {
- $('#termination_amount').parent().parent().css('display', 'block');
- } else {
- $('#termination_amount').val('');
- $('#termination_amount').parent().parent().css('display', 'none');
- }
- }
- );
- $('#partial_termination').change();
- $('#swap_type').change();
- var datalist = $('#index_list');
- index_list.forEach(item => {
- var option = document.createElement('option');
- option.value = item;
- datalist.append(option);
- });
- $('#fund').change(
- function() {
- if (window.location.pathname.includes('future') ||
- window.location.pathname.includes('spot')) {
- return;
- }
- switch ($(this).val()) {
- case 'SERCGMAST':
- $('#custodian').val('BAC');
- $('#cashaccount').val('V0NSCLMAMB');
- break;
- case 'BOWDST':
- $('#custodian').val('BONY');
- $('#cashaccount').val('BPMG10240000');
- $('#account_code').val('GS');
- break;
- case 'BRINKER':
- $('#custodian').val('BBH');
- $('#cashaccount').val('4023461');
- break;
- }
- });
- $('#fund').change();
- //change default value to Following
- $('#payment_rolldate').val('Following');
- $('#upfront').attr('data-toggle', 'tooltip');
- $('#upfront').attr('title', 'This is Cash Amount on the bloomberg ticket, i.e. the net amount we receive.');
- $('#upfront').tooltip();
- $('#spot_rate').attr('data-toggle', 'tooltip');
- $('#spot_rate').attr('title', 'Spot rate must be entered with pairs ordered by dominance. EUR > GBP > USD > CAD > CHF > YEN');
- $('#spot_rate').tooltip();
-});
diff --git a/python/Dawn/static/favicon.ico b/python/Dawn/static/favicon.ico
deleted file mode 100755
index bee8bf36..00000000
--- a/python/Dawn/static/favicon.ico
+++ /dev/null
Binary files differ
diff --git a/python/Dawn/static/utils.js b/python/Dawn/static/utils.js
deleted file mode 100644
index befcc442..00000000
--- a/python/Dawn/static/utils.js
+++ /dev/null
@@ -1,26 +0,0 @@
-function $(s) {
- return( document.getElementById(s) );
-}
-
-function encode_dict(d){
- var r = [];
- for(var k in d){
- r.push(encodeURIComponent(k) + '=' + encodeURIComponent(d[k]));
- }
- return r.join('&');
-}
-
-function query(url, params, callback){
- var xhr = new XMLHttpRequest();
- xhr.open('GET', url + '?' + encode_dict(params));
- xhr.onreadystatechange = function() {
- if( xhr.readyState === 4 ) {
- if( xhr.status === 200 ) {
- callback(xhr.responseText);
- } else if ( xhr.status === 400 ) {
- console.log(xhr.responseText);
- }
- }
- };
- xhr.send();
-}
diff --git a/python/Dawn/static/wire.js b/python/Dawn/static/wire.js
deleted file mode 100644
index b2d761c6..00000000
--- a/python/Dawn/static/wire.js
+++ /dev/null
@@ -1,46 +0,0 @@
-var outgoing_count = 0;
-var incoming_count = 0;
-
-function addWire(direction, wire_data) {
- return function() {
- if( this != window.window) {
- this.remove();
- }
- var template = document.getElementById("fragment");
- var clone = document.importNode(template.content, true);
- count = direction == "outgoing" ? ++outgoing_count : ++incoming_count;
-
- clone.querySelectorAll("label").forEach(
- label => label.setAttribute("for",
- direction + "-" + label.getAttribute("for") + "-" + count));
- clone.querySelectorAll(".form-control").forEach(
- elem => {elem.id = direction + "-" + elem.id + "-" + count;
- elem.setAttribute("name",
- direction + "-" + elem.getAttribute("name") + "-" + count);
- });
- clone.getElementById("btn").id = direction + "-btn";
- document.getElementById(direction).appendChild(clone);
- for(var key in wire_data) {
- if( key == "action" ){
- document.getElementById("action").value = wire_data[key];
- } else {
- document.getElementById(direction + "-" + key + "-" + count).value = wire_data[key];
- }
- }
- document.getElementById(direction + "-btn").addEventListener("click", addWire(direction));
- };
-}
-
-$(function() {
- for (let w of outgoing_wires) {
- addWire("outgoing", w)();
- }
- for (let w of incoming_wires) {
- console.log(w);
- addWire("incoming", w)();
- }
- if (outgoing_wires.length == 0 && incoming_wires.length == 0) {
- addWire("outgoing")();
- addWire("incoming")();
- }
-})