LFT
data(date)
Fetch the LFT indicative rates for the given reference date from ANBIMA.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
date
|
DateScalar
|
The reference date for fetching the data. |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: DataFrame containing the following columns: - ReferenceDate: The reference date for the data. - BondType: The type of bond. - MaturityDate: The maturity date of the LFT bond. - IndicativeRate: The Anbima indicative rate for the LFT bond. - Price: The price of the LFT bond. |
Examples:
>>> from pyield import lft
>>> lft.data("23-08-2024")
ReferenceDate BondType MaturityDate IndicativeRate Price
0 2024-08-23 LFT 2024-09-01 0.000272 15252.158852
1 2024-08-23 LFT 2025-03-01 -0.000418 15255.605864
2 2024-08-23 LFT 2025-09-01 -0.00023 15255.819395
3 2024-08-23 LFT 2026-03-01 0.000075 15250.526859
4 2024-08-23 LFT 2026-09-01 0.000114 15248.757596
5 2024-08-23 LFT 2027-03-01 0.000669 15226.824838
6 2024-08-23 LFT 2027-09-01 0.000948 15208.842417
7 2024-08-23 LFT 2028-03-01 0.001172 15189.853347
8 2024-08-23 LFT 2028-09-01 0.001328 15171.352348
9 2024-08-23 LFT 2029-03-01 0.001491 15150.700781
10 2024-08-23 LFT 2029-09-01 0.001587 15131.894737
11 2024-08-23 LFT 2030-03-01 0.001591 15119.952213
12 2024-08-23 LFT 2030-06-01 0.001641 15109.717943
13 2024-08-23 LFT 2030-09-01 0.001687 15099.285393
Source code in pyield/tn/lft.py
premium(lft_rate, di_rate)
Calculate the premium of the LFT bond over the DI Futures rate.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
lft_rate
|
float
|
The annualized trading rate over the selic rate for the bond. |
required |
di_rate
|
float
|
The DI Futures annualized yield rate (interpolated to the same maturity as the LFT). |
required |
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The premium of the LFT bond over the DI Futures rate. |
Examples:
Calculate the premium of a LFT in 28/04/2025
>>> from pyield import lft
>>> lft_rate = 0.001124 # 0.1124%
>>> di_rate = 0.13967670224373396 # 13.967670224373396%
>>> lft.premium(lft_rate, di_rate)
1.008594331960501
Source code in pyield/tn/lft.py
quotation(settlement, maturity, rate)
Calculate the quotation of a LFT bond using Anbima rules.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
settlement
|
DateScalar
|
The settlement date of the bond. |
required |
maturity
|
DateScalar
|
The maturity date of the bond. |
required |
rate
|
float
|
The annualized yield rate of the bond |
required |
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The quotation of the bond. |
Examples:
Calculate the quotation of a LFT bond with a 0.02 yield rate:
>>> from pyield import lft
>>> lft.quotation(
... settlement="24-07-2024",
... maturity="01-09-2030",
... rate=0.001717, # 0.1717%
... )
98.9645