# Céos skill

Céos is USDC without selling your HYPE, on Elysium (chain 99901, gas in HYPE): borrowers lock HYPE and borrow USDC
for 7, 30 or 90 days at a fixed rate known on day one, with loan sizes set by the live depth of the market; lenders lend
USDC at a fixed rate and receive notes (an ERC-20 per term and maturity, one note per USDC owed at maturity). Every order
joins the auction of its term that closes at 00:00 UTC and clears at one rate.

## Read
- GET https://www.ceos.credit/api/rates: last clearing rate per term, history, tonight's indicative rate (basis points per year)
- GET https://www.ceos.credit/api/auctions?term=30d: tonight's aggregated book, close, maturity, indicative clearing
- GET https://www.ceos.credit/api/feed: HyperCore HYPE mid, Elysium v4 pool price, the guarded feed and its status (0 = usable)
- GET https://www.ceos.credit/api/depth: depth-aware limits now (pool room to the liquidation floor, Hyperliquid bids above it, the largest
  loan, the room left in each of tonight's auctions), in USDC owed at maturity
- GET https://www.ceos.credit/api/quote?amount=1000&term=30d&rate=6: collateral needed, fee, owed at the maximum, liquidation price, and
  depth { fits, limit, maxAmount } for that bid
- GET https://www.ceos.credit/api/loan?term=30d&id=12: one loan's debt, collateral, loan-to-value, liquidatable
- MCP (keyless, streamable HTTP, JSON): https://www.ceos.credit/mcp, tools rates, auction, feed, depth, quote_borrow, quote_lend, loan,
  offer_calldata, bid_calldata, repay_calldata, redeem_calldata, clear
- SDK: import * as Ceos from "https://www.ceos.credit/sdk/ceos.js"

## Rules (written in the contracts)
- Rates: 0.05 % grid, 0.05 % to 50 % per year. Interest is simple, ACT/365: owed = principal x (1 + rate x days / 365).
- Clearing: over every order rate, the largest min(USDC offered at minimums <= r, USDC asked at maximums >= r) is the
  volume; the rates reaching it form [r_lo, r_hi]; the clearing rate is floor((r_lo + r_hi) / 2). Offers fill from the
  lowest minimum up, bids from the highest maximum down, the crossing level pro rata. Every fill is at the clearing rate.
- A bid posts HYPE covering amount x (1 + maxRate x days / 365) at 50 % loan-to-value.
- Depth limit (enforced by the app, the API, the MCP calldata and the SDK's bidWithinDepth): a bid's debt at its maximum
  rate is at most one liquidation pass (the USDC the Elysium v4 HYPE/USDC pool pays for the HYPE it takes down to
  3 % under the guarded price) and at most the room left in its auction tonight. See /api/depth for the rule.
- Origination fee 0.3 % of the principal. Repaying early pays the same fixed amount.
- Liquidation: anyone, at 70 % loan-to-value or from maturity unpaid; sells through the v4 HYPE/USDC pool within
  3 % of the guarded price; the caller gets 5 % of the HYPE sold.
- Notes redeem 1:1 from maturity while the cohort's cash covers them, else pro rata once its loans are closed.
- Orders placed during UTC day d-1 join auction d (closes d x 86400). Cancel any time before the close.

## Act (the agent signs with its own wallet; Céos holds no key)
1. Lend: approve USDC to the market, then offer(amount6, level) where level = rate_bps / 5.
2. Borrow: check depth.fits in /api/quote (or call bid_calldata, which returns calldata only within the limit), then
   bid(amount6, level, 0) with the HYPE collateral as msg.value.
3. After 00:00 UTC: claim(id) (the nightly job usually does it for everyone).
4. Repay: approve USDC, repay(id, amount). Redeem notes from maturity: redeem(day, notes6).
Use the *_calldata MCP tools to get exact transactions. Gas: bid twice the base fee, priority fee 0.
