> For the complete documentation index, see [llms.txt](https://limelight-1.gitbook.io/limelight-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://limelight-1.gitbook.io/limelight-docs/developers/smart-contracts.md).

# Smart Contracts

Limelight's on-chain logic is a set of **Move modules** on Movement. Move's resource model means outcome shares and collateral are handled as typed resources rather than freely transferable balances — share resources are managed by the market module, not transferred peer-to-peer.

{% hint style="info" %}
**Illustrative, not an authoritative ABI.** The module layout below shows responsibilities and shape. Request current addresses and entry/view signatures from the Limelight team before building against them.
{% endhint %}

## Core Modules (Move)

<table><thead><tr><th width="250">Module</th><th>Responsibility</th></tr></thead><tbody><tr><td><code>market_factory</code></td><td>Deploys/initializes new markets with configurable parameters. Maintains a registry of all markets.</td></tr><tr><td><code>lslmsr_engine</code></td><td>Core pricing and liquidity engine. Buy/sell execution, share minting/burning, adaptive-depth (<code>b = α·Q</code>) liquidity.</td></tr><tr><td><code>share_accounting</code></td><td>Tracks outcome-share balances per market as Move resources/objects. Shares are non-transferable between users; the market mints and burns them directly.</td></tr><tr><td><code>oracle_resolver</code></td><td>Reads <strong>Pyth</strong> feeds on-chain for price-market resolution; manages the dispute-window state machine.</td></tr><tr><td><code>fee_treasury</code></td><td>Receives and allocates the 1% protocol fee across ecosystem fund, treasury, points pool, and referral pool.</td></tr><tr><td><code>points_engine</code></td><td>Tracks LP per user per epoch; handles boosts, check-in streaks, and quest bonuses (off-chain accounting reconciled against on-chain volume).</td></tr><tr><td><code>referral_registry</code></td><td>3-tier referral tree, activation checks, and cash-reward distribution.</td></tr><tr><td><code>dispute_handler</code></td><td>Manages dispute bonds, challenge periods, and escalation logic.</td></tr></tbody></table>

## Market Status

A market exposes its status as an enum, illustratively:

```
0 = PENDING       4 = RESOLVED      7 = VOIDED
1 = CANCELLED     5 = CLOSED        8 = VOIDED_CLOSED
2 = ACTIVE        6 = UPDATE_REQUIRED
3 = PAUSED
```

Always re-check status on-chain (via the market's view function) before trading — a cached status from an off-chain API may be stale.

## Notes for Integrators

* **Collateral is a fungible asset.** USDCx is passed/withdrawn via the Move framework's fungible-asset standard — there is no EVM-style `approve`/`allowance` step.
* **Share units == collateral units.** A "whole share" is denominated to match USDCx decimals.
* **Resolution is pull-based.** For price markets, a Pyth update is submitted and read in the resolving transaction. See [Technical Overview](/limelight-docs/developers/technical-overview.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://limelight-1.gitbook.io/limelight-docs/developers/smart-contracts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
