> ## Documentation Index
> Fetch the complete documentation index at: https://docs.darkpool.fun/llms.txt
> Use this file to discover all available pages before exploring further.

# predict_facade

> Attribution events alongside cross-package predict::* calls.

A thin adapter that emits DarkPool attribution events alongside the underlying `predict::*` call. The pattern is **"TypeScript PTB places the Predict call, then immediately places our `attribute_*` call in the same PTB."** This avoids any Move-level dependency on Predict's branch-pinned types.

## Events emitted

```move theme={"system"}
public struct BinaryMintAttributed has copy, drop {
    actor_addr: address,
    actor_agent_id: vector<u8>,    // empty if human
    predict_manager_id: ID,
    oracle_id: vector<u8>,
    expiry_ms: u64,
    strike: u64,
    is_up: bool,
    quantity: u64,
    seal_policy_id: ID,
}

public struct RangeMintAttributed has copy, drop { ... }
public struct PLPSupplied has copy, drop { ... }
public struct PLPWithdrawn has copy, drop { ... }
public struct PositionRedeemed has copy, drop { ... }
```

## Entry functions

```move theme={"system"}
public entry fun attribute_binary_mint(...);
public entry fun attribute_range_mint(...);
public entry fun attribute_plp_supply(...);
public entry fun attribute_plp_withdraw(...);
public entry fun attribute_redeem(...);
```

Each reads no state. It just emits the event.

## Wired in

* **Resolver settlement PTB** (`buildAtomicSettlementPTB`) to `attribute_redeem` per redeemed position.
* **`scripts/supply-plp.ts`** to `attribute_plp_supply` after `predict::supply`.

## Not wired in (republish-era follow-up)

* Frontend mints (`buildPredictMintPTB`).
* Agent-service mints.
* No indexer stream consumes facade events directly today. The indexer reads `predict::PositionMinted` / `PositionRedeemed` instead.

## Tests

`tests/predict_facade_tests.move`: each `attribute_*` function emits exactly one event.
