# Opora skill

Opora is a pre-market for points and upcoming tokens on Elysium (chain 99901, gas in HYPE). Sellers post USDC collateral, buyers pay USDC, and one escrow contract holds both until the token exists. Then the market is bound to the token's address and a ratio (after a public 24 hour timelock), the seller delivers inside a 48 hour window, or the buyer takes the payment back plus the seller's collateral. A market voided or not bound by its date refunds both sides.

## Read
- `GET /api/markets`: every market, its terms, phase and book (price levels in USDC per unit).
- `GET /api/markets/{slug}`: one market. Slugs: `montra-s2`, `ascend-points`.
- `GET /api/points/{wallet}`: Montra Season 2 points of a wallet.
- `GET /api/chain`: Elysium block, base fee, HYPE price, Montra season totals.
- MCP: `POST /api/mcp` (JSON-RPC). Tools `list_markets`, `get_book`, `quote_fill`, `get_points`.

## Write (from a wallet, with the SDK)
```js
import { Opora } from "/sdk/opora.mjs"; // served by this site, needs viem 2
const opora = new Opora({ wallet, escrow });
await opora.postOffer({ market: 0, side: "sell", price: "0.0044", amount: 250000, minFill: 10000 });
await opora.fill({ offerId, amount });
await opora.cancelOffer(offerId);
await opora.deliver([tradeId]);      // seller, once bound, inside the window
await opora.claimDefault([tradeId]); // anyone, after the window
await opora.refund([tradeId]);       // anyone, voided or unbound past its date
```
ABI: `/sdk/abi.json`. USDC on Elysium: `0xb47c4C8F73F009CC0C0d3f92B388d13E293F0B65` (6 decimals). Prices are USDC base units per unit; quantities are whole units; the ratio is token base units per unit.

## Rules to respect
- Collateral for a sell = ceil(qty x price x collateralBps / 10000). Payment for a buy = qty x price.
- Fills must be at least the offer's minimum fill, except the last remainder.
- No new offers or fills while a proposal is pending. Cancels always work.
- Gas: Elysium charges the priority fee; send priority 0 and a max fee of twice the base fee.
