Finance...yDirect(3)

πŸ’– Finance...yDirect(3) πŸ’–

okay bestie, welcome to this page from the User Contributed Perl Documentation section. It’s giving β€œniche finance module but make it cute,” and it’s all about Finance::Quote::TreasuryDirect. Let’s get into it ✨


πŸ’– NAME πŸ’–

Finance::Quote::TreasuryDirect β€” Obtain bond quotes from Treasury Direct. That’s literally the whole mission, and it ate πŸ’…


✨ SYNOPSIS ✨

        use Finance::Quote;

        $q = Finance::Quote->new;

        %info = $q->fetch('treasurydirect', '912810QT8');

πŸ¦‹ DESCRIPTION πŸ¦‹

So this module obtains individual bond quotes by CUSIP number from treasurydirect.gov. Main character energy for bond data, honestly 🫢

Prices come from the XML form of the FedInvest daily price file. Only securities in that file are available, which is to say marketable Treasury bills, notes and bonds. Agency, municipal and corporate CUSIPs are not in that file and return an errormsg of 'no match'. Not them being left on read 😭

Prices are quoted per 100 of face value. Slay, standard units πŸ’Έ


πŸŽ€ LABELS RETURNED πŸŽ€

Information available from Treasury Direct may include the following labels, bestie:

  • method
  • source
  • symbol
  • rate
  • maturity
  • bid
  • ask
  • eod
  • price
  • date
  • isodate
  • currency

bid is the file’s SELL column, what an investor receives, and ask is its BUY column, what an investor pays. Economics but make it fashion πŸ’…

Only the prices the file actually quoted are returned. Some securities, mostly bills, are quoted on one side only, and the unquoted label is then absent rather than zero. eod is published after the close, so it is absent from a file fetched during the trading day. No fake zeros here, we don’t do that πŸ™ˆ

price is the mean of the bid and the ask where both are quoted, and otherwise whichever of the end of day price, the bid or the ask is available, in that order. For a one-sided security that makes the price depend on which day the fetch lands on β€” the quoted side from a day in progress, the close from a completed one β€” a difference of about a cent. Tiny but iconic ⭐

rate is the coupon as a percentage. Bills are discount instruments and carry no coupon, so theirs is 0.000%. Zero coupon, zero drama πŸ“


🌈 SEE ALSO 🌈

  • treasurydirect.gov
  • Finance::Quote

mwah πŸ’‹ this lil page is perl v5.32.1, dated 2026-10-26, and the footer cutie is Finance...yDirect(3). bye bestie, go fetch those quotes 🫢✨

πŸ“¦ where this page comes from