Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added cl/__init__.py
Empty file.
105 changes: 105 additions & 0 deletions cl/hackathon/BulkAnnotateSolution.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
solution_id,trade_group,trade_ids,llm,prompt
GptBulkAnnotate,Preview,,gpt-4o-02,"You are a financial expert for interest rate swaps, and you understand trader messages well.
You analyse the messages from the perspective of the Bank.
You will be provided with a trade entry and a list with parameter descriptions.
Every parameter description is a dictionary the parameter 'name' and 'description' keys.
For every parameter in the list of parameter descriptions try to find this parameter in the trade entry.
If you can not find the parameter then skip it.
Otherwise tag the value of the parameter in the text. Do not worry about the format.

parameters beginning 'pay' mean that the BANK is paying.
parameters beginning 'rec' mean that the CLIENT is receiving.
The trade text might be from the client's perspective, but you are smart enough to get the tags correct.

Parameter descriptions:
'''
[
{{
'name': 'effective_date',
'description': 'Effective date of the trade'
}},
{{
'name': 'maturity_date',
'description': 'Maturity date of the trade'
}},
{{
'name': 'tenor_years',
'description': 'Tenor in years, usually formatted like Xy, common values are 1,2,5,10.'
}},
{{
'name': 'pay_leg_notional',
'description': 'Pay leg notional amount, Do not tag currency. It might use abbreviations like k, m, b. If Notional is given then use it as pay_leg_notional.'
}},
{{
'name': 'pay_leg_ccy',
'description': 'Pay leg payment currency in 3-letter ISO-4217 format, for example USD or it could be a symbol like £. The currency is specified in 'We buy', 'We pay', 'Long', 'clients receive' or 'client receives'. Note this is not the currency for 'clients pay' or 'client pays'.'
}},
{{
'name': 'pay_leg_freq_months',
'description': 'Pay leg payment frequency in months, for example 3.'
}},
{{
'name': 'pay_leg_basis',
'description': 'The day count basis specified in 'Pay', for example act/360. This is not the currency, do not get confused.'
}},
{{
'name': 'pay_leg_float_index',
'description': 'Pay leg floating interest rate index as specified, e.g., 3m Term SOFR, or just SOFR. use the full term if given.'
}},
{{
'name': 'pay_leg_float_spread_bp',
'description': 'Receive leg spread in basis points, for example 30 (omit for a fixed leg, 0 or omit if not specified).'
}},
{{
'name': 'pay_leg_fixed_rate_pct',
'description': 'Pay leg fixed rate in percent, for example 3.45% (include the % sign in tag).'
}},
{{
'name': 'rec_leg_notional',
'description': 'Receive leg notional amount. Do not tag currency. It might use abbreviations like k, m, b. If Notional is given then use it as pay_leg_notional.'
}},
{{
'name': 'rec_leg_ccy',
'description': 'Receive leg payment currency in 3-letter ISO-4217 format, for example USD or it could be a symbol like £. The currency is specified in 'We sell', 'We receive', 'Short', 'clients pay' or 'client pay'. Note this is not the currency for 'clients receive' or 'client receives'. If it is not clear the subject then look for the subject from the previous sentence.'
}},
{{
'name': 'rec_leg_freq_months',
'description': 'Receive leg payment frequency in months, for example 3.'
}},
{{
'name': 'rec_leg_basis',
'description': 'Receive leg day count basis as specified, for example act/360. Note this is not currency so the output shouldn't be in 3-letter ISO-4217 format.'
}},
{{
'name': 'rec_leg_float_index',
'description': 'Receive leg floating interest rate index as specified, e.g., 3m Term SOFR, or just SOFR. use the full term if given.'
}},
{{
'name': 'rec_leg_float_spread_bp',
'description': 'Receive leg spread in basis points, for example 30 (omit for a fixed leg, 0 or omit if not specified).'
}},
{{
'name': 'rec_leg_fixed_rate_pct',
'description': 'Receive leg fixed rate, for example 3.45%. Usually a expressed as a percent (include the % sign in tag) (omit for a floating leg).'
}}
]
'''

Trade entry:
'''
{input_text}
'''

You must return the original trade entry text with the addition of xml like annotations.
The annotations should use the filed names above.
Not all fields will be present.

For example:
Sell 2y SOFR swap at 2.5%
Becomes:
Sell <tenor_years>2y</tenor_years> <pay_leg_float_index>SOFR</pay_leg_float_index> swap at <pay_leg_fixed_rate_pct>2.5%</pay_leg_fixed_rate_pct>

You must not change the text between the tags.
Do not reformat dates, fix typos or change any of the words in any way.
"

4 changes: 2 additions & 2 deletions cl/hackathon/HackathonInput.csv
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
trade_group,trade_id,entry_text
Preview,1,Sell 10y SOFR swap at 3.45%
Preview,2,"Notional: 10m
Bank pays: 6M Term SOFR, semi-annual, act/360
Bank receives: 3.45%, semi-annual, 30/360
Client pays: 6M Term SOFR, semi-annual, act/360
Client receives: 3.45%, semi-annual, 30/360
Start date: 10 November 2009
Tenor: 5y"
Preview,3,"USDEUR cross currency swap (fixed/fixed), 10 y maturity
Expand Down
Loading