# Stockcore skill

Stockcore issues stock tokens on Elysium (chain 99901), each backed one for one by a 1x long on Hyperliquid's xyz stock perps, held by one contract per stock on HyperEVM (chain 999). Use this skill to read stocks, NAV and arbitrage gaps, and to build mint and redeem transactions for a user to sign. Never sign for the user.

## Read
- `GET /api/stocks`: mark, oracle, funding, open interest (Hyperliquid info API, xyz dex); NAV, units held, tokens outstanding (backing contracts).
- `GET /api/nav`: NAV per stock and the value relayed to Elysium with its age in seconds.
- `GET /api/arb`: gap between each Elysium pool and NAV, the route that closes it, its time and calldata.
- `GET /api/seats`: Listing Seats candidates, seated $SCORE, seconds to the next 00:00 UTC listing.
- `GET /api/bridge`: the rollup's challenge period (confirmPeriodBlocks and hours), read live.

## Act (the user signs)
- Mint: on HyperEVM, approve USDC `0xb88339CB7199b77E23DB6E890353E22632Ba630f` to the stock's backing, then `requestMint(uint256 amount, address recipientOnElysium)`. At least 11 USDC. Tokens arrive on Elysium after one round (a few minutes).
- Redeem: on Elysium, `redeem(uint256 amount, uint8 payoutChain, address recipient)` on the stock token. `payoutChain` 1 pays USDC on Elysium, 0 on HyperEVM. Amount is a multiple of the size step. Paid after the challenge period, at the NAV of the executing round.
- Instant exit or entry on Elysium: the stock's Uniswap v4 pool against USDC (fee 0.05 %).
- Advance a round (anyone): `poke()` on a backing.

## MCP
`POST /mcp` (JSON-RPC 2.0): tools `list_stocks`, `get_arb`, `mint_route`, `redeem_route`, `listing_seats`.

## SDK
`/sdk/stockcore.js`: one file, no dependencies; `stocks()`, `nav()`, `arb()`, `seats()`, `mintCalldata()`, `redeemCalldata()`, `pokeCalldata()`.

## Rules worth knowing
- 1 token = 1 unit of the perp. NAV = mark + funding balance per token.
- Mint and redeem fee 0.10 % each, capped at 1 % in code.
- Weekend prices are the perp's own book-based mark; tokens gap with the perp at the stock market reopen.
