cfmm-from-payoff

Generate a complete CFMM specification from a target payoff via interactive questioning.

4|1|Updated Jan 22, 2025
One-click install
npx skills add https://github.com/wvs-finance/ThetaSwap-core --skill cfmm-from-payoff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cfmm-from-payoff
Source: https://github.com/wvs-finance/ThetaSwap-core/tree/main/skills/cfmm-from-payoff
Command: npx skills add https://github.com/wvs-finance/ThetaSwap-core --skill cfmm-from-payoff

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the complex process of deriving a complete Constant Function Market Maker (CFMM) specification directly from a user-defined target payoff, ensuring mathematical rigor and adherence to established financial engineering principles.

Core Features & Use Cases

  • Interactive Derivation: Guides users through a series of mandatory questions to define the CFMM's properties, reserves, trading function, and fee structure based on foundational academic papers.
  • Mathematical Rigor: Ensures all derivations are grounded in the "Geometry of Constant Function Market Makers" and related works, producing verifiable LaTeX specifications.
  • Use Case: A DeFi protocol needs to launch a new AMM. Instead of manually coding and risking subtle mathematical errors, they use this Skill to interactively define the AMM's behavior based on a desired payoff profile, generating a precise mathematical specification for smart contract development.

Quick Start

Use the cfmm-from-payoff skill to derive a CFMM specification starting from the payoff max(S-K, 0).

Frequently Asked Questions about cfmm-from-payoff

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I derive a CFMM specification from a target payoff function?

To derive a CFMM specification from a target payoff, you interactively define the AMM's properties, reserves, trading function, and fee structure. This process uses convexity checks and foundational financial principles to ensure mathematical rigor.

What is the process for defining AMM reserves and trading functions from a desired payoff profile?

Defining AMM reserves involves interactive questioning guided by the "Geometry of Constant Function Market Makers" framework. It requires verifying convexity and selecting a framework to mathematically derive the trading function matching your payoff.

Can I generate a LaTeX specification for type-driven smart contract development from a DeFi payoff?

Yes, deriving a CFMM from a target payoff culminates in a formal LaTeX specification. This specification documents the trading function, reserves, and fee structure for type-driven DeFi smart contract development.

How are fee structures integrated when designing a Constant Function Market Maker from a payoff?

Fee structure integration occurs during the interactive derivation process after defining the core trading function. The methodology ensures fees are mathematically consistent with the chosen CFMM framework and target payoff profile.

What mathematical prerequisites are needed to derive a CFMM from a target payoff?

Deriving a CFMM requires understanding convexity checks and the "Geometry of Constant Function Market Makers" academic framework. You need a target payoff function, such as max(S-K, 0), to start the interactive derivation.

Why does my AMM derivation require a convexity check on the payoff function?

A convexity check ensures the target payoff function can be replicated by a valid CFMM trading function. This mathematical validation guarantees the derived reserves and trading rules adhere to established financial engineering principles.