Fixed Income logo

Fixed Income

Community
agiprolabs
fixed-income

[STUB] Bond pricing, yield curves, duration and convexity analysis, and DeFi lending rate modeling

Overview

Publisheragiprolabs
Repositoryclaude-trading-skills
Skill namefixed-income
Stars
434
Forks
85
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by agiprolabs on GitHub. Read the source before you install it.

Installation

Install the Fixed Income AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/fixed-income
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git /tmp/claude-trading-skills
mkdir -p .claude/skills
cp -r /tmp/claude-trading-skills/skills/fixed-income .claude/skills/fixed-income
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Fixed Income in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Fixed Income on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Fixed Income is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Fixed Income

Status: STUB — This skill provides a basic bond calculator and an overview of planned capabilities. Full implementation is awaiting community contribution.

Fixed income analysis bridges traditional bond mathematics with DeFi lending rate modeling. Bond pricing fundamentals — present value of cash flows, yield curves, duration, and convexity — translate directly to analyzing DeFi lending protocols where depositors earn variable or fixed rates on crypto assets.

On Solana, lending protocols like Marginfi, Kamino, and Solend offer variable-rate lending/borrowing. Understanding term structure and rate dynamics helps optimize yield farming strategies and compare opportunities across protocols.

This skill is informational and analytical only. It does not provide financial advice or trading recommendations.


Current Capabilities

This stub includes a working bond calculator with price, yield-to-maturity, duration, and convexity computations. See scripts/bond_calculator.py for the implementation.

python
def bond_price(
    face: float, coupon_rate: float, ytm: float, periods: int, freq: int = 2
) -> float:
    """Calculate bond price as present value of all cash flows.

    Args:
        face: Face (par) value of the bond.
        coupon_rate: Annual coupon rate (decimal, e.g., 0.05 for 5%).
        ytm: Yield to maturity (annual, decimal).
        periods: Number of coupon periods remaining.
        freq: Coupon frequency per year (2 = semi-annual).

    Returns:
        Bond price (dirty price).
    """
    coupon = face * coupon_rate / freq
    y = ytm / freq
    pv_coupons = sum(coupon / (1 + y) ** t for t in range(1, periods + 1))
    pv_face = face / (1 + y) ** periods
    return pv_coupons + pv_face

Run the demo:

bash
python scripts/bond_calculator.py --demo

Planned Capabilities

When fully implemented, this skill will cover:

Bond Pricing

ConceptDescription
Clean/Dirty PricePrice excluding/including accrued interest
Accrued InterestInterest earned since last coupon date
Day Count Conventions30/360, ACT/360, ACT/365, ACT/ACT
Zero-Coupon BondsDiscount bonds with no periodic coupons

Yield Measures

Yield MeasureUse Case
Yield to Maturity (YTM)Total return if held to maturity
Current YieldAnnual coupon / price
Yield to CallReturn if called at first call date
Spread to BenchmarkCredit risk premium over risk-free rate

Duration and Convexity

MetricMeasures
Macaulay DurationWeighted average time to cash flows
Modified DurationPrice sensitivity to yield changes
Effective DurationDuration for bonds with embedded options
ConvexitySecond-order price sensitivity
Dollar Duration (DV01)Dollar change per 1bp yield move

Yield Curve Construction

MethodDescription
BootstrapExtract spot rates from par bond prices
Nelson-SiegelParametric model with level, slope, curvature
Nelson-Siegel-SvenssonExtended model with additional curvature term
Cubic SplineNon-parametric interpolation

DeFi Lending Rate Analysis

ProtocolChainType
MarginfiSolanaVariable rate
KaminoSolanaVariable rate
SolendSolanaVariable rate
AaveEthereum/MultiVariable + stable rate
CompoundEthereumVariable rate

Planned DeFi features:

  • Lending rate time series analysis
  • Supply/borrow APY comparison across protocols
  • Utilization rate impact on lending rates
  • Fixed vs variable rate comparison (when fixed-rate protocols available)
  • Rate arbitrage opportunity detection

Prerequisites

bash
# For full implementation
uv pip install numpy scipy

# For visualization
uv pip install matplotlib

The included scripts/bond_calculator.py uses only the Python standard library and runs without any dependencies.


Use Cases

Yield Farming Comparison

Compare DeFi lending rates across protocols using fixed income analytics. Annualize variable rates, compute effective yields accounting for compounding frequency, and identify the most capital-efficient opportunities.

Lending Rate Analysis

Track lending rates over time to understand rate dynamics. Identify periods of rate compression (low utilization) vs rate expansion (high utilization) to time deposits optimally.

Rate Arbitrage

Borrow at lower rates on one protocol and lend at higher rates on another. Duration and convexity concepts help assess the risk of rate changes during the arbitrage holding period.

Risk Assessment

Use duration to estimate how lending positions change in value as rates move. Higher duration means greater sensitivity to rate changes.


Quick Reference: Bond Pricing Formulas

Bond price (present value of cash flows):

P = Σ [C / (1+y)^t] + F / (1+y)^n
    t=1..n

Where:
  C = periodic coupon payment = Face * coupon_rate / frequency
  y = periodic yield = YTM / frequency
  F = face value
  n = total number of periods

Macaulay Duration:

D_mac = (1/P) * Σ [t * C / (1+y)^t] + (n * F) / ((1+y)^n * P)

Modified Duration:

D_mod = D_mac / (1 + y)

Convexity:

Convexity = (1/P) * Σ [t*(t+1) * C / (1+y)^(t+2)] + [n*(n+1)*F] / [(1+y)^(n+2) * P]

Price change approximation:

ΔP/P ≈ -D_mod * Δy + 0.5 * Convexity * (Δy)²

Files

FileDescription
references/planned_features.mdPlanned features, bond formulas, DeFi protocols, and implementation priorities
scripts/bond_calculator.pyBond price, YTM, duration, and convexity calculator

Contributing

This skill is a stub awaiting full implementation. To contribute:

  1. Implement yield curve bootstrapping from market data
  2. Add Nelson-Siegel yield curve fitting
  3. Build DeFi lending rate data fetcher (Marginfi, Kamino APIs)
  4. Add day count convention support for accurate accrued interest
  5. Create rate comparison dashboard across protocols

See references/planned_features.md for the full feature list and implementation priorities.


This skill provides analytical tools and mathematical models for informational purposes only. It does not constitute financial advice. Fixed income and DeFi lending involve risk of loss.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Fixed Income AI skill do?

[STUB] Bond pricing, yield curves, duration and convexity analysis, and DeFi lending rate modeling

Why use Fixed Income on TypingMind?

Because you install it once and use it with any model. Fixed Income is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Fixed Income in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/fixed-income. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Fixed Income?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Fixed Income?

As many as you like. As long as a model supports skills, you can use Fixed Income with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Fixed Income AI skill free?

Yes. It is published on GitHub by agiprolabs under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇