KYM-Finance lets users convert native KDA into an ERC-20 wrapper (wKDA) and then split that wrapped asset into two tradeable pieces:
Principal Token (PT): represents the original principal (redeemable at expiry/maturity period).
Yield Token (YT): represents the future interest / yield stream.
Users can mint PT+YT from wKDA, trade PT and YT independently on a simple mock AMM, claim accumulated yield, or recombine PT+YT to redeem wKDA. Markets are created per wrapped-asset + expiry date (maturity time period) so different expiry buckets can exist in parallel.
Frontend
- Next.js (app router) starter for fast UI development.
- Wagmi + Viem for wallet integration and contract calls.
- Tailwind + DaisyUI for quick, clean components (Deposit, Split, Swap, Redeem).
Smart contracts (Solidity)
- WrappedKDA.sol: wrap native KDA into an ERC-20 (wKDA) so the protocol can work with a standard token interface.
- KadenaPrincipalToken.sol (PT): ERC-20 that represents principal; only the paired YT contract can mint/burn to keep 1:1 accounting. Has an expiry timestamp.
- KadenaYieldToken.sol (YT): ERC-20 that represents yield shares, tracks last-claim times and accrues yield with a simple time-based formula for the MVP; supports mintPY, redeemPY, and claimYield. Uses ReentrancyGuard and SafeERC20 patterns.
- YieldSplitterFactory.sol: deploys and registers PT/YT pairs per (SY, expiry) so markets are discoverable and isolated.
- SimpleAMM.sol: minimal constant-product AMM (0.3% fee) to swap PT ↔ YT and add liquidity. Reads KDA/USD from a DIA oracle for price reference.
Tooling & deployment
- Hardhat + ethers (TypeScript) for compile & deploy scripts.
- OpenZeppelin libs for ERC-20, Ownable, SafeERC20.
- Example deploy flow: deploy WrappedKDA, deploy YieldSplitterFactory, create a market (expiry), then deploy AMM pointing to the new PT/YT pair. Network config and private key stored in env for testnet deploys.
MVP shortcuts & notable choices
- Mock yield: YT uses an on-chain accrual formula and simulated yield reserves so features can be demoed without integrating a lending protocol. Swap in a real yield source later.
- Mock AMM: constant-product AMM is easy to reason about and fast to implement for trading YT/PT during the hackathon.
Dev flow (user perspective)
- Deposit native KDA → receive wKDA.
- Approve wKDA and call mintPY → receive PT + YT.
- Trade PT / YT on the AMM or hold YT to accrue/claim yield.
- Redeem PT+YT (or at expiry) to get back wKDA, then unwrap to native KDA.