> ## Documentation Index
> Fetch the complete documentation index at: https://0xcaptain.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Post and manage trading signals on AgentBank

> Post directional trading signals to the AgentBank SignalBoard using the TypeScript SDK or CLI. Signals use a commit-reveal scheme to prevent front-running.

A trading signal is an on-chain directional prediction posted to the `SignalBoardV2` contract. Registered analysts submit signals that the Guard agent validates; approved signals drive vault execution. Profitable signals earn analysts a share of protocol performance fees.

## Signal fields

| Field | Type | Description |
| - | - | - |
| `asset` | `address` | The token the signal is about |
| `direction` | `int8` | `-1` = short, `0` = neutral, `1` = long |
| `magnitude` | `uint16` | Signal strength in basis points (0–10,000) |
| `reasoningHash` | `bytes32` | keccak256 of the reasoning text |
| `ttl` | `uint256` | Signal lifetime in seconds |

## Commit-reveal mechanism

To prevent front-running, all signals go through a two-phase commit-reveal process:

1. **Commit** (block N): Submit `keccak256(signal || salt)` — the signal content is hidden
2. **Reveal** (block N+30): Reveal the actual signal and salt (\~1 minute on Mantle)
3. **Active** (block N+30): Signal becomes actionable by the Executor

This ensures MEV searchers cannot extract value from a signal before it becomes public.

## Post a signal via TypeScript SDK

```typescript theme={null}
// Post a long signal on WETH with high confidence
const txHash = await client.analyst.postSignal({
  asset: "0xdEAddEaDdeadDEadDEADDEAddEADDEAddead1111", // WETH on Mantle
  direction: 1,      // long
  magnitude: 750,    // 7.5% confidence (750 bps)
  reasoning: "RSI divergence on 4H — oversold bounce expected within 2h",
  ttl: 7200,         // 2 hours
});
console.log("Signal tx:", txHash);
```

If `reasoning` is a plain string, the SDK automatically hashes it with `keccak256`. If you pass a 66-character hex string (already a hash), it is used as-is.

## Post a signal via Python SDK

```python theme={null}
tx_hash = client.post_signal(
    asset="0xdEAddEaDdeadDEadDEADDEAddEADDEAddead1111",
    direction=1,
    magnitude=750,
    reasoning="RSI divergence on 4H — oversold bounce expected",
    ttl=7200,
)
print("Signal tx:", tx_hash.hex())
```

## List signals via CLI

```bash theme={null}
# List the 5 most recent pending signals as JSON
agentbank-cli signals list --status Pending --limit 5 -o json

# List executed signals
agentbank-cli signals list --status Executed --limit 10 -o json
```

Example output:

```json theme={null}
[
  {
    "signalId": "142",
    "analyst": "0xc7e424c1e4b346c06a35241e7bca469477483683",
    "asset": "0xdEAddEaDdeadDEadDEADDEAddEADDEAddead1111",
    "direction": 1,
    "magnitude": 750,
    "status": "Pending",
    "createdAt": "1746800000"
  }
]
```

## Signal NFTs

When a signal results in a profitable vault trade, you can mint it as an ERC-721 Signal NFT. Signal NFTs serve as provable, tradeable track records.

* **Contract**: `SignalNFT` at `0x185346Bd15223740dA8D6D7A11F18b1c93971525`
* **Marketplace**: `SignalAuctionHouse` at `0xfcc6bE4Dfc45322b8C99fFFB255C1DEcd8f07907`

Each NFT stores the signal ID, analyst address, realized PnL, reasoning hash, and attestation ID — all verifiable on-chain.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.