Comet Core Operations

Explain Comet V3 supply, borrow, withdraw, repay, and transfer operations with principal accounting.

Updated Jan 28, 2026
One-click install
npx skills add https://github.com/cyotee/compound-V3-comet-skill --skill comet-core-operations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Comet Core Operations
Source: https://github.com/cyotee/compound-V3-comet-skill/tree/main/.opencode/skills/comet-core
Command: npx skills add https://github.com/cyotee/compound-V3-comet-skill --skill comet-core-operations

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps users understand and implement Comet V3 core user operations (supply, withdraw, borrow, repay, transfer, supplyTo, withdrawFrom), and clarifies how a single signed principal tracks all positions.

Core Features & Use Cases

  • Core operations overview: explain supply base tokens, supply collateral, withdraw, and transfer, and how they update user principals and global totals.
  • Use Case: walk through supplying USDC and borrowing against it, or transferring base tokens between accounts while maintaining correct accounting.
  • Edge Scenarios: cover repay vs supply, crossing from borrow to supply, collateral checks, and rebalancing when balances change.

Quick Start

Use the Comet Core skill to understand the interaction between supply, borrow, and principal value, and to work through a concrete example of supplying USDC and then withdrawing or borrowing.

Frequently Asked Questions about Comet Core Operations

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

FAQPage Schema
How does principal accounting work in Comet V3 for supply and borrow operations?

Comet V3 core operations handle both single asset supply and borrow interactions, allowing users to supply USDC, borrow against supplied collateral, withdraw base tokens, and execute transfers while maintaining correct principal accounting across accounts.

What happens when a Comet V3 borrow position crosses over into supply?

When a Comet V3 borrow position crosses over into supply, the signed principal flips polarity, transitioning the user from a borrower to a supplier while maintaining continuous accounting without requiring separate transactions or position resets.

What is the difference between repay and supply in Comet V3 core operations?

In Comet V3 core operations, repay specifically reduces an existing borrow principal toward zero, while supply adds positive balance, meaning repay functions cannot push a principal positive but supply operations can cross from borrow to supply.

How do collateralization checks work when withdrawing or borrowing in Comet V3?

Collateralization checks in Comet V3 validate that user collateral remains sufficient after withdrawals or borrows, triggering rebalancing when asset balances change to ensure positions stay solvent across single and cross-asset interactions.

Can I transfer base tokens between accounts while maintaining Comet V3 accounting?

Yes, Comet V3 supports transferring base tokens between accounts via transfer and transferTo operations, automatically updating the signed principals for both sender and receiver to maintain accurate global accounting totals.