# Intro

### <mark style="color:yellow;">What is Trendle?</mark>

> [**Trendle**](https://app.trendle.fi/) **is a attention market platform that transforms online buzz into a new financial asset class.**

It allows users to speculate not on outcomes, but on the rise and fall of *<mark style="color:yellow;">hype, sentiment, and engagement</mark>* around topics - from crypto narratives and sports teams to influencers and political events.

<figure><img src="/files/qB0HFukr46rgSFSuV7B4" alt=""><figcaption></figcaption></figure>

### <mark style="color:yellow;">Why does it matter?</mark>

In today’s world, <mark style="color:yellow;">**attention is the most valuable yet most underpriced commodity**</mark>. Narratives drive markets, social signals move billions, and entire industries rise or collapse on a single headline or viral tweet. Yet, attention itself has never been directly structured into a tradable market.

Prices in traditional assets only reflect outcomes (win/lose, profit/loss). Attention, however, operates on its own economy-trending topics, fan confidence, controversies, or bursts of virality.

> **Trendle bridges this gap by capturing, quantifying, and financializing attention in real time.**

### <mark style="color:yellow;">Key Value Proposition</mark>

* **For traders:** Gain exposure to *attention indexes -* a way to speculate on hype cycles, euphoria, or backlash,[ regardless of real-world results.](#user-content-fn-1)[^1]
* **For the ecosystem:** Unlock a new layer of **AttentionFi** markets that sits alongside prediction markets, DeFi, and fan economies.

With Trendle, <mark style="color:yellow;">**attention becomes investable**</mark>, opening the door to a transparent, trustless marketplace where culture, narratives, and sentiment are as tradable as tokens themselves.

[^1]: * In traditional **prediction markets**, you bet on an outcome (e.g., *“Will Team A win the match?”*). If the team loses, your bet is worthless.
    * In **Trendle**, you don’t bet on the result,  you trade on **attention levels** (how much hype, controversy, or engagement the topic has).


# Background & Narrative

### <mark style="color:yellow;">From Prediction Markets to AttentionFi:</mark>

Prediction markets were the first step toward financializing information. They allow speculation on the <mark style="color:yellow;">**probability of outcomes**</mark>**&#x20;-** who wins an election, whether a law will pass, or if a team secures a victory. But they are bound to <mark style="color:yellow;">**binary resolution**</mark>: right or wrong, win or lose.

> **Trendle takes the next leap: AttentionFi**

\
Instead of betting on outcomes, Trendle focuses on <mark style="color:yellow;">**attention itself**</mark>**&#x20;-** the narratives, hype cycles, and sentiment waves that dominate culture and markets. Attention is measurable, dynamic, and often more valuable than the result it points to.

In this sense, <mark style="color:yellow;">**Trendle is a prediction market for attention**</mark>**&#x20;-** a system where traders don’t speculate on who wins, but on where attention flows.

### <mark style="color:yellow;">The Attention–Price Feedback Loop:</mark>

History shows us that **attention drives markets**:

* More attention → more liquidity, more traders, rising prices.
* Less attention → drying liquidity, fading interest, collapsing prices.

<figure><img src="/files/4cbkeurh7KcarWalMmjq" alt=""><figcaption></figcaption></figure>

This creates a **reinforcing loop**:

1. A story or event goes viral → attention spikes.
2. The spike attracts speculation and capital inflows.
3. The cycle sustains itself until attention fades.

Traditional finance only captures the *after-effect* of this loop in asset prices.&#x20;

> **Trendle captures the loop itself making attention fluctuations investable.**

### <mark style="color:yellow;">Our Role in the Shift</mark>

Trendle isn’t just another trading app. We are building the foundation for **Attention Capital Markets (ACM) -** a new market layer where narratives themselves are tradable assets, sitting alongside DeFi, prediction markets, and fan economies.


# Core Idea

### <mark style="color:yellow;">Attention Indexes</mark>

At the heart of [Trendle](https://app.trendle.fi/) are **attention indexes -** data-driven instruments that measure how much mindshare a topic, person, or event captures online. These indexes aggregate multiple signals:

* Hype – Mentions, engagement spikes, virality.
* Momentum – Sustained growth in attention over time.
* Controversy – Sentiment polarity, fan confidence vs. backlash.

Together, they create a quantifiable metric for *<mark style="color:yellow;">attention as an asset class</mark>.*

### <mark style="color:yellow;">How It Differs</mark>

Trendle is not a copy of traditional prediction markets, fan tokens, or memecoin,  it goes beyond both models:

* **vs. Prediction Markets**: Traditional prediction markets tie value to binary outcomes (*win/lose, pass/fail*). Trendle ties value to attention flows, independent of the final result.
* **vs. Fan Tokens**: Fan tokens let supporters back a team or celebrity, but they are static and tied to loyalty. Trendle indexes are dynamic, real-time, and tradable **-** built for speculation on narratives, not allegiance.
* **vs. Memecoins**: Memecoins capture hype temporarily but lack structure - they are speculative vehicles with no underlying measure of attention. Trendle, in contrast, **quantifies hype and sentiment directly**, turning memecoin-like attention cycles into transparent and investable indexes.

### <mark style="color:yellow;">Example Scenarios</mark>

* **Elon Tweet Shockwave** → Elon Musk tweets about a new AI startup. Attention around the topic surges 200%. Traders long the index profit as hype peaks, regardless of whether the startup succeeds.
* **Matchday Momentum** → A football team builds hype before a match. Attention climbs as fans rally online. Even if the team loses, traders who positioned early on the hype surge win.
* **Memecoin Frenzy** → A new memecoin dominates Twitter and Reddit. Attention indexes capture the exponential spike in mentions. Traders can ride the wave or hedge against a collapse as the narrative cools.

> *TL;DR*
>
> *Trendle indexes transform hype, momentum, and controversy into investable financial primitives making it possible to speculate directly on culture.*


# Product

### <mark style="color:yellow;">What Trendle Ships</mark>

* **Attention Indexes**\
  Quantified, real-time measures of online attention for topics (e.g., protocols, sports teams, influencers, memecoins).&#x20;
* **Trading Layer** \
  Markets that let users go long/short attention with configurable leverage.
* **Risk & Lifecycle Controls**\
  A **Liquidation Engine** (to manage leveraged risk when margin falls below maintenance) and a **Funding Mechanism** (to anchor traded price to the underlying index level).


# Attention Index

### <mark style="color:yellow;">wtf is the Attention Index</mark>

The Attention Index measures <mark style="color:yellow;">near-real-time mindshare</mark> for a topic *(e.g., “bitcoin”, “Elon Musk”)* by aggregating public engagement data from <mark style="color:yellow;">X (Twitter), Reddit, and YouTube</mark> into a single, unitless Engagement Index *(EI*), then mapping EI to a monetized, tradable scale called DoA *(Dollar of Attention)* for use in Trendle markets. Computation runs every minute over a rolling context window to capture spikes and short-term persistence.&#x20;

No artificial intelligence or generative systems used. The index is computed with deterministic, transparent math: normalization, exponential time-decay, quantile clipping, and light smoothing.

<figure><img src="/files/U52qjImoxXeEFYx325GC" alt=""><figcaption></figcaption></figure>

### <mark style="color:yellow;">Data Ingest: Inputs & Collectors</mark>

Independent collectors continuously pull raw events per tracked topic and persist them for downstream processing:

1. <mark style="color:$info;">X (Twitter) Collector:</mark> tweet-level public engagement *(retweets, replies, likes, quotes, bookmarks, impressions)* plus author/post metadata.
2. <mark style="color:$info;">Reddit Collector:</mark> activity across relevant subreddits/feeds *(e.g., hot/rising/top)*; metrics include scores and comment counts.
3. <mark style="color:$info;">YouTube Collector</mark>: video/channel signals *(views, likes, comments)* for topic-matched videos.

> Coming in v2: We’ll integrate Google Search attention signals *(topic-matched search interest and query dynamics)* as an additional collector. These features will follow the same normalization, deseasonalization, and decay rules and will flow into EI → DoA like other sources.

### <mark style="color:yellow;">Data Preparation (minute-level, topic-bounded)</mark>

* Time-bounded pull: load the context window of events per source for each topic.
* Per-minute grid: convert source events to 1-minute bars and join all sources on a common minute grid.
* Gaps handling: use forward-fill *(and limited backward-fill)* so each minute has a dense matrix of features; track completeness.
* Quality controls: deduplication, basic low-quality/bot heuristics, and language/topic filters *(as described in the prep stage).*

### <mark style="color:yellow;">Feature Families</mark>

Infra constructs multiple feature families per minute and topic.

#### Reddit (14 metrics)

Reddit data is split into three channels, each reflecting a different facet of attention: Level *(stable interest)*, Momentum *(current popularity)*, and Velocity *(growth speed)*.

Level: stable interest *(Top/last hour*)

Analyzes posts that are in Top over the last hour. Captures established, steady attention to the topic.

1. **`level_posts_count`** - number of Top posts for the topic.
2. **`level_total_score`** - total score (upvotes minus downvotes) across those Top posts; captures aggregate positive appraisal.
3. **`level_total_comments`** - total comments under the Top posts; reflects discussion level.
4. **`level_avg_score`** - average score per Top post; a quality proxy for the average post.

Momentum: current popularity *(Hot)*

Analyzes Hot posts. Reddit’s Hot algorithm uses both score and post age, so this channel shows what’s popular **right now**.

1. **`momentum_posts_count`** - number of Hot posts.
2. **`momentum_total_score`** - total score across Hot posts; aggregate approval for what’s trending.
3. **`momentum_total_comments`** - total comments on Hot posts; breadth of active discussion.
4. **`momentum_avg_score`** - average score per Hot post.

Velocity: rising attention *(Rising)*

Analyzes Rising posts-those gaining votes very quickly. Indicates **emerging virality** and sharp increases in interest.

1. **`velocity_posts_count`** - number of Rising posts.
2. **`velocity_total_score`** - total score across Rising posts; aggregate assessment of what’s taking off.
3. **`velocity_total_comments`** - total comments on Rising posts; engagement with newly viral content.
4. **`velocity_avg_age_hours`** - average age *(hours)* of Rising posts; freshness of the viral wave.
5. **`velocity_max_speed`** - maximum observed score-growth rate among Rising posts; a key virality indicator.
6. **`velocity_trimmed_mean`** - trimmed mean of post-level growth speeds: average growth rate after removing the lowest and highest extremes to stabilize the metric.

#### YouTube (3 metrics; view-weighted)

For YouTube we use **aggregated, view-weighted metrics**, so more popular videos contribute more to the final features.

1. **`youtube_views`** — total views across all topic-matched videos in the window; primary **reach** indicator.
2. **`youtube_likes` (view-weighted)** — likes normalized by views, so likes on widely watched videos have greater weight; better reflects **engagement quality** than raw sums.
3. **`youtube_comments` (view-weighted)** — comments normalized by views; reflects **depth of engagement** rather than raw volume.

#### X (Twitter) (6 metrics; per-minute averages)

For X we compute per-minute averages across all topic-matched tweets within the window.

1. **`retweet_count` (avg)** - how often content is reshared; a proxy for virality/diffusion.
2. **`reply_count` (avg)** - discussion intensity and direct interaction.
3. **`like_count` (avg)** - broad approval/interest.
4. **`quote_count` (avg)** - deeper engagement where users share content with added commentary.
5. **`bookmark_count` (avg)** - “save for later” behavior; perceived usefulness.
6. **`impression_count` (avg)** - exposure baseline; platform reach.

{% hint style="info" %}
Additional data sources (such as TikTok, Google Trends, or news feeds) may be integrated in future iterations to further expand and refine the attention dataset.
{% endhint %}

### <mark style="color:yellow;">From Raw Features → Engagement Index (EI)</mark>

We convert mixed metrics into a stable, comparable per-topic EI via the following pipeline:

1. Global min–max normalization *(fixed bounds per metric)*:

$$
\text{norm} = \frac{x-\text{min}}{\text{max}-\text{min}} \quad \text{then} \quad \text{clip} \in \[0,1]
$$

2. Exponential decay over a 6-hour window with half-life = n *(recency-weighted aggregation)*:

$$
w(\Delta)=e^{-\ln(2)\cdot \Delta / \mathrm{half\_life}}
$$

3. Quantile clipping to suppress tail&#x73;*,* then smoothing for micro-noise reduction.

These steps produce the per-minute Engagement Index for each topic.

### <mark style="color:yellow;">From EI → DoA (Dollar of Attention)</mark>

To make EI directly usable for pricing/P\&L in Trendle markets, we apply a linear multiplier (“DoA multiplier”) to EI:&#x20;

$$
\mathrm{DoA} = \mathrm{EI} \times \mathrm{DOA\_MULTIPLIER}
$$

With the current configuration *(might be changed)*, **DOA\_MULTIPLIER = n**, yielding a human-readable, cross-topic comparable DoA scale. Higher DoA = higher current attention; changes in DoA (ΔDoA) drive P\&L on Trendle.

### <mark style="color:yellow;">How a Spike Propagates (hypothetical micro-walkthrough)</mark>

1. A viral tweet and a breakout YouTube clip appear within minutes; normalized **X likes/retweets** and YouTube views jump.
2. Deseasonalization checks whether this hour is usually “hot”; if yes, it deflates the metrics so only excess over typical hour-pattern contributes.
3. Exponential decay emphasizes very recent activity, so the spike quickly lifts EI.
4. Quantile clipping limits the impact of outlier posts or videos, ensuring no single extreme value skews results and helping to smooth short-term volatility across nearby time windows.
5. EI is multiplied by **n** → DoA ticks up; if the spike persists over several minutes, the DoA level remains elevated until recency-weights roll off.

### <mark style="color:yellow;">Index Behavior and Comparability</mark>

* Unitless EI enables combining heterogeneous signals while preserving directionality *(more engagement → higher EI)*.
* The Attention Index (DoA) is NOT normalized to a fixed 1–100 range and has no hard upper bound.

  DoA values are cross-topic comparable by design. This comparability is achieved through fixed global normalization bounds for each underlying metric and a common DoA multiplier applied uniformly across all topics. As a result, a DoA value of 100 on one topic represents the same absolute level of measured attention as a DoA value of 100 on any other topic.
* DoA levels may exceed 100 during periods of unusually high attention relative to the global baseline. Higher values indicate greater absolute attention intensity, not a percentile ranking or capped score.

### <mark style="color:yellow;">**Why Multi-Source Attention Is Hard to Manipulate**</mark>

Trendle’s first line of defense against manipulation is not simply using *more* data, but using heterogeneous platforms with independent incentive and anti-spam systems. X, Reddit, and YouTube each optimize for different user behaviors, surface content differently, and apply their own moderation and abuse-detection heuristics.

As a result, manipulation costs do not scale linearly with the number of sources. To artificially inflate attention in a way that survives Trendle’s aggregation, an attacker would need to coordinate credible (1), platform-native (2) behavior across multiple ecosystems (3) at the same time (4). This is significantly harder and more expensive than gaming a single platform.

Real attention tends to propagate organically across platforms *(discussion appears on Reddit, clips surface on YouTube, and reactions spread on X).* Coordinated fake campaigns, by contrast, usually break down on at least one surface, creating inconsistencies that are dampened during normalization and aggregation

In effect, Trendle benefits from the combined anti-spam and incentive structures of each platform, making sustained manipulation economically unattractive

### <mark style="color:yellow;">**ZK-verifiable attention index**</mark>

Additional verification layers for the Attention Index are being explored, with the objective of enabling third-party cryptographic validation of both data provenance and index computation. Discussions are currently underway with established infrastructure providers specializing in zero-knowledge proofs and secure data attestations. These efforts are intended to further strengthen the trust assumptions around how attention data is sourced, processed, and published on-chain, while preserving scalability and near-real-time updates.


# Pulse / Data Feed

This section explains the Feed (real-time content stream) and Pulse (discussion layer) you see in the UI. It’s designed to surface *what’s moving attention right now* and to give traders context behind DoA moves.

#### <mark style="color:yellow;">1. Growing Content</mark>

Content that has grown by X% in activity over the tracking window.

* Definition (high level):\
  Growth% = (current engagement – baseline engagement) / baseline engagement.\
  Baseline and current are computed on rolling windows (e.g., last 60m vs. prior 60m) with spam/duplicate filtering.
* Signals considered: per-post velocity (likes, comments/replies, reposts/quotes, impressions/views), author uniqueness, and recency.
* Why it matters: flags *fresh surges* that often precede DoA upticks.

#### <mark style="color:yellow;">2. Trending Topics (Clustered)</mark>

We cluster reviewed content into subtopics / trends under each main topic and highlight a representative post / video per cluster.

* Clustering (overview): semantic embeddings + keywords → deduplication → cluster labeling (top n-grams / entities).
* Representative item: highest “cluster centrality × engagement” score (not always the most liked—aims to be most *on-topic*).
* Why it matters: turns noisy streams into narratives you can trade (long/short DoA).


# Trading Engine

**Trendle uses pooled liquidity rather than an orderbook.**\
This fits attention markets because dozens of indexes can launch quickly and **share depth** from one liquidity pool, instead of bootstrapping makers per market.

> Trendle’s trading engine turns the **Dollar of Attention (DoA)** index into a market you can **long or short**.&#x20;

Conceptually, it works like this:&#x20;

1. An oracle posts the current DoA for each index;
2. traders open leveraged positions against that reference;&#x20;
3. A pooled liquidity vault underwrites payouts;&#x20;
4. Funding re-centers price to DoA while liquidation removes under-margined positions to protect LPs.

   &#x20;

This is implemented by three contracts that work together: a <mark style="color:yellow;">**PriceFeed**</mark> *(index input)*, a <mark style="color:yellow;">**Pool**</mark> *(LP reserves)*, and <mark style="color:yellow;">**Trading**</mark> *(orders, P\&L, fees, funding, liquidation)*. The outcome is scalable, orderbook-free markets where many attention indexes can share the same liquidity.

### <mark style="color:yellow;">The three on-chain pieces:</mark>

* **PriceFeed** — a oracle intake

Authorized oracle accounts push minute-level index prices per `indexId`. Consumers read via `getPrice(indexId, max)`. If prices go stale, the feed widens spread / errors.

`max` is a boolean guard used when quotes are near-stale or stale-guarded\
• `getPrice(indexId, true)` → returns the upper-bound *(max)* price for conservative checks (e.g., opening/closing longs, or LP-side risk).\
• `getPrice(indexId, false)` → returns the lower-bound *(min)* price for conservative checks in the opposite direction (e.g., shorts).\
\
If the quote is fresh, both calls effectively return the same current DoA. When the feed applies a protective spread due to staleness, the `max` flag decides which side of the spread you get.

<table><thead><tr><th width="183.48828125">Call</th><th width="276.9453125">Use case (typical)</th><th>Returned price when spread applies</th></tr></thead><tbody><tr><td><code>getPrice(id, true)</code></td><td>Long-side checks, LP risk checks</td><td><strong>Upper bound</strong> of DoA band</td></tr><tr><td><code>getPrice(id, false)</code></td><td>Short-side checks</td><td><strong>Lower bound</strong> of DoA band</td></tr></tbody></table>

* **Pool** - LP reserves & collateral routing

LPs deposit whitelisted tokens. The contract tracks `totalReserve`, `lockedReserve`, and enforces minimum free reserve, lockups, and per-index allowlists. Trading locks / unlocks reserve via `adjustReserve`.

* **Trading** - orders, positions, fees, funding & liquidation

Holds market parameters (fees, leverage caps, funding baseline), takes orders, opens/closes positions, calculates P\&L, and settles payouts via the Pool / treasury.\
*Settlement waterfall:*

1. Payouts are first covered by the trader’s collateral locked in the Trading contract.
2. If P\&L exceeds collateral, the shortfall is paid from the Pool’s reserves (per the market’s locked exposure).
3. The treasury never pays, it only receives fees (trading, imbalance, liquidation where applicable)

### <mark style="color:yellow;">Life of a trade:</mark>

1. **Place order**

* Trader sends collateral, leverage, side *(long / short)*, and `indexId`. Contract records a `Trade` (status **ORDER** for limit, otherwise executes immediately).

2. **Execution & price check**

* Market: reads current index price from **PriceFeed** and opens a **POSITION** right away.
* Limit: orders are later executed in batches via `processTrades` if the feed shows your limit is hit.

3. **Locking liquidity & fees**

* On open, the engine locks pool reserve against the position and charges:
  * Trading fee + market-imbalance fee *(dynamic extra if one side is overcrowded)*.
  * Fees route to `treasury`.

4. **While open: funding keeps sides in check**
5. **Close or liquidate**

* **Close:** trader calls `closePosition`; P\&L uses current index price ± funding.
* **Liquidate:** if collateral falls below `liquidationThreshold`, anyone can trigger liquidation; a **liquidation fee** applies and the Pool releases/recovers funds.

6. **Payout caps & settlement**

* &#x20;For every position base cap is computed  `cap_base = maxPayoutThreshold × collateral_after_fees`.
* For shorts, there is an additional natural ceiling because the index cannot go below zero. The most a short can earn is the P\&L they’d realize at **price = 0**, i.e. roughly `cap_short_floor = entryIndex × positionSize` (± funding/fees).
* The contract therefore uses:\
  **`maxPayout = min(cap_base, cap_short_floor)`** for shorts, and **`maxPayout = cap_base`** for longs.


# Fees

> This section explains how costs are assessed when you trade on Trendle. Fees are simple by design: you pay a one-time charge **only when opening** a position; closing a position or canceling an unfilled order does **not** incur entry fees. All charges are computed from your opening notional *(collateral × leverage)* so that P\&L from index movements remains transparent and comparable across positions.

### <mark style="color:yellow;">Entry fees (one-time at open)</mark>

$$
\text{EntryFee}
\= \big(\text{TradingFee%}+\text{ImbalanceFee%}\big)\times\big(\text{Collateral}\times\text{Leverage}\big)
$$

* <mark style="color:yellow;">Where it goes:</mark> sent to the treasury.
* <mark style="color:yellow;">When it’s charged:</mark> **only once** when your order executes to open a position.
* <mark style="color:yellow;">Not charged:</mark> on **close** OR if an order is created and later canceled.
* <mark style="color:yellow;">**Accounting:**</mark> the entry fee is taken immediately as a realized loss on the position, but does not change future P\&L math. Price P\&L is always computed off&#x20;

**Position Size = Collateral × Leverage** *(fees excluded)*

### <mark style="color:yellow;">Trading fee</mark>

* <mark style="color:yellow;">Type:</mark> fixed % of (Collateral × Leverage) at open.
* <mark style="color:yellow;">Set by:</mark> contract admin.

### <mark style="color:yellow;">Imbalance fee</mark>

* <mark style="color:yellow;">Purpose:</mark> discourage crowding, charged ONLY when opening on the prevailing side
* <mark style="color:yellow;">Scope:</mark> computed per token/index pair.
* <mark style="color:yellow;">OI definition:</mark> open interest uses margin × leverage *(opening notional)*
* <mark style="color:yellow;">Prospective sizing:</mark> the new position’s size is included when evaluating the imbalance.
* <mark style="color:yellow;">Virtual liquidity:</mark> by default, each side has 1k virtual dollar, and these are included when calculating the ratio of the sides.
* <mark style="color:yellow;">Schedule:</mark> linear between two points:
  * starts at 0.4&#x35;**%** when **OI ratio = 3:2 (1.5×)**,
  * increases linearly to &#x33;**%** at **OI ratio = 10:1**.
  * Below 3:2, the imbalance fee is **0%**.
* <mark style="color:yellow;">Charged:</mark> once at **open** *(part of Entry fees)*

### <mark style="color:yellow;">Leverage</mark>

* <mark style="color:yellow;">Range:</mark> fractional value from **1×** (no leverage) to **5×** (max).
* <mark style="color:yellow;">Effect:</mark> multiplies price P\&L, entry fees, and funding PnL proportionally
  * Example: with 3× leverage, both your gains/losses from index moves and your fees/funding scale by 3×

### <mark style="color:yellow;">Quick example</mark>

* Collateral = 1,000; Leverage = 3× → Position Size = 3,000
* Trading fee 0.20% → 6.00
* If market is long-heavy at a 4:2 OI ratio (≥ 3:2) and you open a long: suppose Imbalance fee = 3.0% → 90.00
* EntryFee total = 96.00, taken immediately. Your future price P\&L still references the full 3,000 position size


# Liquidation Engine

The liquidation engine protects the pooled LP and keeps markets solvent by **fully closing** positions that violate margin safety. It acts when a position’s effective equity (collateral adjusted for funding) or status no longer meets requirements, using the DoA index price.

### <mark style="color:yellow;">When a position becomes liquidatable:</mark>

At evaluation time the engine computes:

* Payout at the current index price (includes trading PnL and funding PnL).
* Remaining collateral = `collateralAmount + fundingPnL`.

A position is **LIQUIDATABLE** if any of the following is true:

1. Margin call: `remainingCollateral ≤ 0` or `payout ≤ liquidationThreshold × remainingCollateral` (works with or without leverage).
2. Forced take-profit: `payout ≥ maxPayout` (the configured cap / profit ceiling).
3. Funding drain: funding fees have consumed the user’s entire collateral (or an admin-set fraction), even if price PnL is positive.
4. Index / token delisted: the relevant index or settlement token is no longer in circulation / disabled.
5. Whitelist removal: the trader’s address has been removed from the whitelist.

> The check is performed inside the position evaluation routine; if any rule trips, status returns **LIQUIDATABLE**.

### <mark style="color:yellow;">Full vs. partial liquidation</mark>

* The current implementation fully closes liquidatable positions *(no partial unwind)*. The trade’s status becomes CLOSED, market open-interest is reduced, and reserves are reconciled in the Pool.
* Reserve bookkeeping happens via the reserve-adjustment path *(unlocking previously locked capacity and settling the LP delta)*.

### <mark style="color:yellow;">Health Factor</mark>

The Health Factor *(HF)* shows how close your position is to liquidation. It ranges from 100% *(completely safe)* to 0% *(fully liquidated)* and updates continuously as the index level changes.

How it’s calculated:

1. Measure both liquidation distances.\
   A position might be liquidated for two MAIN reasons ( there are 5 of them in total) - margin call or forced take-profit. The system measures how far the current index level is from each liquidation point.
2. Convert distances to percentages.\
   Each distance is converted to a scale from 0% to 100%, where:
   * 100% = at entry level *(safe)*
   * 0% = at liquidation level
3. Take the minimum value.\
   The smaller of the two percentage distances determines your Health Factor, since liquidation occurs if either condition is hit first.

$$
\text{Health Factor} = \min\bigl(\text{Margin Distance %},\ \text{Profit Cap Distance %}\bigr)
$$

If you entered a position at level 100 and your liquidation level is 50:

* At level 100, HF = 100% *(fully safe)*
* At level 50, HF = 0% *(liquidated)*\
  Between them, the value decreases linearly.\
  So at level 75, HF = 50%, and at level 62.5, HF = 25%

### <mark style="color:yellow;">Math TL;DR</mark>

* $$Payout = collateral + tradingPnL + fundingPnL$$ capped by `maxPayout`.
* Margin call rule: liquidate if payout is too small relative to equity baseline (`collateral + fundingPnL`) at the configured threshold, or if equity baseline ≤ 0.
* Funding drain rule: liquidate when funding consumes all (or the configured share of) collateral.
* Settlement waterfall: fee is taken from payout and sent to the fee receiver; remainder (if positive) to the trader; Pool reserves are reconciled. The treasury never pays *(it only receives protocol fees)*.


# Funding Rate

### <mark style="color:yellow;">**Purpose:**</mark>&#x20;

balance open interest between longs and shorts and compensate the minority side. Funding is **NOT** about pulling a price toward an oracle. It’s a **crowding tax** paid continuously by the dominant side.

**Two-layer design: index vs market**\
Trendle deliberately separates the system into two independent layers.

1. **Index layer** - the Attention Index (DoA) is computed purely from social and engagement data. It is deterministic, non-tradable, and independent of trader positioning.
2. **Market layer** - traders price a perpetual-style derivative *around* that index based on leverage, risk appetite, and positioning.

There is no tradable `spot attention asset` to arbitrage against. The index acts as a reference signal, not a market-clearing price.

### <mark style="color:yellow;">How the mechanism works ?</mark>

1. **Who pays whom**

* Funding accrues per second. The dominant side *(the side with greater open interest)* pays the opposite side. Accrual is proportional to each position’s opening notional = `collateral × leverage`.
* Current P\&L does not matter for how much you pay / receive.

2. **Per market**

* Funding is calculated separately for each token / index pair. No cross-netting between markets.

3. Rate formula (example shown for long-dominant market)

$$
\text{fundingRatePerSecond}
\= \frac{(\mathrm{Long\ OI}-\mathrm{Short\ OI}) \times \mathrm{baseFundingRate}}
{\mathrm{Long\ OI}}
$$

If shorts dominate, swap “Long” and “Short” in the formula.&#x20;

Your per-second charge / credit = `positionOpeningNotional × fundingRatePerSecond`

4. **Percent-in / percent-out; surplus to LPs**

* Funding is charged as a percentage on each side’s opening notional. “Longs pay 1%” means each long pays 1% (annualized to per-second) of *its opening notional* over the interval; “shorts receive 1%” means each short receives 1% of its opening notional.
* Because the dominant side’s notional sum is larger, total paid > total received; the surplus flows to the pool and is distributed to LPs.

5. **One-sided markets**

* If all open interest is on one side (e.g., only longs or only shorts), no funding is charged.

6. **Funding applies to all open positions, even with no boost (1×)**

* With 1×, funding is calculated on your collateral meaning higher boost increases position size and scales the dollar impact of funding proportionally, while the funding rate itself remains the same.

7. **Liquidations from funding**

* Funding can **r**educe collateral over time. A position may be liquidated due to funding even if its mark-to-market P\&L is positive, if equity falls below the maintenance threshold.


# Trendle UX Tutorial

> What you’re trading: each card is a trend with a live Attention Index (DoA). Numbers update every minute from public social data. No AI/ML, just transparent math (normalize → deseasonalize → time-decay → smooth).

### <mark style="color:$primary;">Quick Start (TL;DR)</mark>

1. Open Trendle → pick a topic card.
2. If needed, Add funds (USDC on Base).
3. Choose Up/Down, set Boost, Deposit.
4. Watch DoA on the chart; manage from Open Positions.
5. Use Pulse to see content driving the moves.

### <mark style="color:$primary;">Home: Browse & Compare Trends</mark>

<figure><img src="/files/ljgWKt1L0ejwTOyvJtwF" alt=""><figcaption></figcaption></figure>

* Grid of trend cards. Each card shows:
  * DoA value (Dollar of Attention) — the live attention level for that topic.
  * Δ% — percentage change over the selected period on that card’s sparkline.
  * Vol — recent trading volume for that market.
* Search bar *(top)*. Type a keyword *(e.g., “elon”, “drake”, “ai”)* to jump straight to a topic. Autocomplete suggests live markets.

{% hint style="info" %}
The DoA scale is comparable across topics. If “Taylor Swift = 135.6” and “Bitcoin = 57.9,” Taylor currently commands \~2.3× more measurable attention than Bitcoin.
{% endhint %}

### <mark style="color:$primary;">Market Page: Read the Trend, Take a Side</mark>

<figure><img src="/files/OvroZqwP0Xj8E1PbeCOm" alt=""><figcaption></figcaption></figure>

When you click a card *(e.g., Elon Musk)*, you land on a split layout:

Left: Price (DoA) Chart

* Timeframe toggles: `1H`, `4H`, `1D`, `1W`, `1M`, `All`.
* Y-axis: DoA level. Sharp up = attention surge; sharp down = attention fade.

Right: Trade Ticket

* Up / Down tabs. Choose the direction you think DoA will move.
* Balance & Add. Shows your wallet balance; “Add” opens the Add funds modal.
* Boost (x1…x5). Multiplies the exposure of your P/L to DoA moves.
* Deposit button. Confirms the position once you’ve set direction + boost.

Glossary (quick):

* DoA: Dollar of Attention (index level).
* Δ%: percent change of DoA over the selected window.
* Boost: leverage-like multiplier for your P/L.<br>

### <mark style="color:$primary;">Funding the Wallet (USDC on Monad)</mark>

Trendle beta uses USDC on Monad.

Add funds

* Click Add funds → you’ll see a QR code + your address.
* Send USDC (Base network) to that address. Once confirmed, your balance updates.

Withdraw

* Click Withdraw to open the form:
  * Paste a Base address to receive funds.
  * Enter an amount or tap MAX.
  * Submit to withdraw USDC back to your wallet.

{% hint style="warning" %}
**Note:** If you send tokens from the wrong network, they won’t appear. Ensure Base.
{% endhint %}

### <mark style="color:$primary;">Placing Your First Position</mark>

1. Open a market (e.g., Elon Musk).
2. Decide Up (attention will rise) or Down (attention will fall).
3. Choose Boost (`x1`–`x5`). Higher = bigger swings (both profit and loss).
4. Click Deposit to open the confirmation and submit the transaction.
5. Your position appears under Open Positions on the Portfolio screen.

P/L logic (intuition): If DoA goes your way after entry, your position value increases. If it goes against you, it decreases. Boost scales both.

### <mark style="color:$primary;">Portfolio: Open Positions & History</mark>

* Open Positions: Live P/L, entry DoA, direction, and boost per position.
* Positions History: Closed positions with realized P/L and timestamps.

{% hint style="info" %}
If you don’t see a position right after placing it, wait a few seconds for chain confirmation and refresh.
{% endhint %}

### <mark style="color:$primary;">Pulse: Real-Time Context Feed</mark>

Under the chart you’ll find Pulse, a running stream that surfaces:

* Tweets, YouTube videos, and Reddit posts related to the topic.
* Recent market actions (e.g., large opens/closes).\
  Pulse helps you connect content → attention moves without leaving the app.


# Attention Markets Arena (rules)

How the trading competition works

### <mark style="color:$primary;">In a nutshell</mark>

**Every week**, we give away $MON tokens to the best traders. You compete on 4 leaderboards and can win prizes based on your rank. *<mark style="color:$primary;">**You need to trade at least**</mark>*<mark style="color:$primary;">**&#x20;**</mark><mark style="color:$primary;">**$200 trading volume**</mark><mark style="color:$primary;">**&#x20;**</mark>*<mark style="color:$primary;">**to get in the competition**</mark>*

<table><thead><tr><th width="183.7890625">Week 1</th><th width="185.3515625">Week 2</th><th width="180.90625">Week 3</th><th width="184.8671875">Week 4</th><th width="203.1640625">Week 5</th></tr></thead><tbody><tr><td>total: 175,000 $MON<br> • 60k – $  PnL<br> • 30k – % PnL<br> • 25k – Consistency<br> • 60k – Topic Kings</td><td>total: 225,000 $MON<br> • 80k – $  PnL<br> • 40k – % PnL<br> • 25k – Consistency<br> • 80k – Topic Kings</td><td>total: 175,000 $MON<br> • 55k – $  PnL<br> • 20k – % PnL<br> • 50k – Consistency<br> • 50k – Topic Kings</td><td>total: 200,000 $MON<br> • 75k – $  PnL<br> • 25k – % PnL<br> • 75k – Consistency<br> • 25k – Topic Kings</td><td>total: 100,000 $MON<br> • 50k – $  PnL<br> • 50k – Topic Kings</td></tr></tbody></table>

#### <mark style="color:$primary;">Skill Leaderboards (3 categories)</mark>

1. $PnL

who made the most profit in dollar terms? *pure moneymaking*

2. %PnL&#x20;

who made the best percentage return? *great for smaller accounts that trade smart*

3. Consistency&#x20;

who trades well, regularly? *not just one lucky trade, but steady performance*

Each of these pays out to the top 10 traders

#### <mark style="color:$primary;">Topic Kings</mark>

4. Topic Kings - the #1 trader by volume on each of the top 3 markets. If you dominate a hot market, you're the king.

Pays out 3 winners (one per market)

#### <mark style="color:$primary;">How Much Can You Win?</mark>

*examples*

<table><thead><tr><th width="84.8046875">Rank</th><th width="157.9375">Weight (1/r^0.75)</th><th width="93.296875">Share</th><th width="124.32421875">Reward</th></tr></thead><tbody><tr><td>1</td><td>1.000</td><td>26.6%</td><td>26,599 MON</td></tr><tr><td>2</td><td>0.595</td><td>15.8%</td><td>11,862 MON</td></tr><tr><td>3</td><td>0.439</td><td>11.7%</td><td>8,751 MON</td></tr><tr><td>4</td><td>0.354</td><td>9.4%</td><td>7,053 MON</td></tr><tr><td>5</td><td>0.299</td><td>8.0%</td><td>5,966 MON</td></tr><tr><td>6</td><td>0.261</td><td>6.9%</td><td>5,204 MON</td></tr><tr><td>7</td><td>0.232</td><td>6.2%</td><td>4,635 MON</td></tr><tr><td>8</td><td>0.210</td><td>5.6%</td><td>4,194 MON</td></tr><tr><td>9</td><td>0.192</td><td>5.1%</td><td>3,839 MON</td></tr><tr><td>10</td><td>0.178</td><td>4.7%</td><td>3,547 MON</td></tr></tbody></table>

Topic Kings Prizes&#x20;

<table><thead><tr><th width="83.92578125">Rank</th><th width="160.046875">Weight (1/r^0.75)</th><th width="96.5703125">Share</th><th width="122.55078125">Reward</th></tr></thead><tbody><tr><td>1</td><td>1.000</td><td>49.2%</td><td>12,295 MON</td></tr><tr><td>2</td><td>0.595</td><td>29.2%</td><td>7,311 MON</td></tr><tr><td>3</td><td>0.439</td><td>21.6%</td><td>5,394 MON</td></tr></tbody></table>

#### <mark style="color:$primary;">Can You Stack Rewards?</mark>

skill leaderboards: you get your best skill reward only

topic kings: yhis one stacks! If you're a topic king <mark style="color:$primary;">`AND`</mark> a skill leaderboard winner, you get both rewards

#### <mark style="color:$primary;">Reward Curve Formula</mark>

For each category, rewards are calculated using an inverse power curve:

$$
weight(rank) = 1 / rank^p
$$

$$
p = 0.75
$$

$$
reward(rank) = categorybudget \* weight(rank) / sum(weight(1..N))
$$

Where *N* is the number of winner slots in that category (10 or 3)

For a given rank *r*, budget *B*, and number of winners *N*:

$$
reward(r) = B \* (1 / r^{0.75}) / sum(1 / k^{0.75})
$$

for k = 1..N

\
simplified: the reward is the budget multiplied by the rank's weight fraction over the sum of all weights

#### <mark style="color:$primary;">How Rankings Work</mark>

Leaderboards reset every week - fresh start each Monday. If someone above you gets their reward from a different category, you slide up and get a better prize.

### <mark style="color:$primary;">FAQ</mark>

1. **What if I'm on multiple skill leaderboards?**&#x20;

*You'll automatically get the highest reward. The system picks the best one for you - no action needed.*

2. **What if I'm a Topic King AND on a skill leaderboard?**&#x20;

*You get both! Topic Kings rewards are bonus rewards on top of your skill leaderboard prize.*

3. **What's a "Topic King"?**&#x20;

*Each week, we look at the 3 most popular markets (by trading volume). The trader with the highest volume in each of those markets is crowned the "king" of that topic. Three markets = three kings.*

4. **What happens if there are fewer than 10 traders in a category?**&#x20;

*The full budget is split among however many traders there are. Fewer competitors = bigger prizes for each!*

5. **Do I need to sign up?**&#x20;

*You need to trade at least* $100 trading volume *to get in the competition. No signup needed.*

6. **When do I get paid?**&#x20;

*Rewards are calculated after each weekly period ends and distributed in $MON tokens.*

\ <br>


# Team

**Philipp Tsagolov - Co-Founder / Growth**

Ex-Azuro Ecosystem Lead, scaled it to 30+ consumer apps and 40k+ users.

X: <https://x.com/philtsa>

Featured: AttentionFi Explained - Beyond the Code, E87: [https://www.youtube.com/watch?v=p5yIRJCmSjk ](https://www.youtube.com/watch?v=p5yIRJCmSjk)

\
**Alex - Tech Lead**

Ex-core infra engineer at Azuro - launched the world's first pooled&#x20;

betting liquidity model.

GitHub: <https://github.com/alvik48><br>

**Mike - Marketing**

led Hamster Kombat's scaling to 300M MAU

X: <https://x.com/mikhryc0x>

**Good - Content Advisor**

Top-10 KOL in prediction markets.

X: <https://x.com/thenarrator>

**Backed by Azuro**

Trendle is incubated within the Azuro ecosystem - battle-tested prediction&#x20;

market infrastructure with 30+ frontends, $180M+ volume, $4.6M+ revenue,&#x20;

and $11M+ raised from Delphi Digital, Alliance DAO, Gnosis, Arrington Capital,&#x20;

Ethereal Ventures, SevenX Ventures, Polymorphic Capital, and more.

Site: [https://azuro.org](https://azuro.org/)


# FAQ

### <mark style="color:$primary;">1. What exactly am I trading on Trendle?</mark>

You’re trading **attention levels** - our Dollar of Attention (**DoA**) index for a topic (e.g., a protocol, team, influencer, or memecoin).&#x20;

Your P\&L depends on how DoA moves, NOT on real-world outcomes. See the [**Index**](/product/attention-index) chapter for the DoA spec and update cadence.

### <mark style="color:$primary;">2. How is Trendle different from classic prediction markets or memecoins?</mark>

<table><thead><tr><th width="126.921875">Dimension</th><th width="219.484375">Classic PMs</th><th width="200.859375">Trendle</th><th>Memecoins</th></tr></thead><tbody><tr><td>What is traded</td><td><sub>Probability of a binary/finite outcome (yes/no, date ranges).</sub></td><td><sub>Attention level (DoA) around a topic; you can long/short attention.</sub></td><td><sub>Token whose price is mostly driven by hype/memes.</sub></td></tr><tr><td>Reference / settlement</td><td><sub>Event resolution (oracle decides true outcome).</sub></td><td><sub>DoA index published every minute; markets trade around this reference.</sub></td><td><sub>No structured reference; free-floating price.</sub></td></tr><tr><td>Outcome dependency</td><td><sub>Payout only if the predicted outcome resolves as true/false.</sub></td><td><sub>P&#x26;L depends on changes in DoA, regardless of real-world result.</sub></td><td><sub>P&#x26;L depends on token price swings; not tied to measured attention.</sub></td></tr><tr><td>Primary P&#x26;L driver</td><td><sub>Movement in implied probability before resolution + final resolution.</sub></td><td><span class="math">∆DoA </span> <sub>(index moves) + funding transfers between longs/shorts.</sub></td><td><sub>Speculative flows (virality, narratives, liquidity churn).</sub></td></tr></tbody></table>

### <mark style="color:$primary;">3. Where does Trendle get its data?</mark>

From public engagement metrics across **X (Twitter)**, **Reddit**, and **YouTube**. We ingest only publicly available fields like impressions, likes, replies / quotes;&#x20;

### <mark style="color:$primary;">4. How often does the index update?</mark>

Every **minute**, computed on a rolling **7-day** window to capture spikes and short-term persistence.

### <mark style="color:$primary;">5. What is the funding rate here?</mark>

it’s a crowding tax. every second, the side with more open interest *(more money on that side)* pays a small fee to the smaller side. The fee you pay/receive is a percent of your opening size *(collateral × leverage)*. It’s calculated separately for each index, is zero if everyone is on one side, and if it eats through your collateral can liquidate you even if your trade is in profit.

### <mark style="color:$primary;">6. If there is no spot attention asset, why does Trendle have funding rates and what do they do?</mark>

Trendle does not have a tradable spot attention asset to arbitrage against. The Attention Index (DoA) is a non-tradable reference signal, computed independently from social and engagement data. Traders price a perpetual-style derivative around that index, based on leverage and positioning. Because there is no spot market, funding on Trendle does not exist to anchor price via arbitrage, as in traditional perpetuals. Instead, funding acts as a crowding tax: the side with greater open interest continuously pays the minority side.

In other words, funding prices positioning imbalance, not the underlying attention signal itself. It penalizes overcrowded trades and rewards traders who take the contrarian side when positioning becomes extreme, helping keep markets balanced even without a spot reference.

### <mark style="color:$primary;">7. When can my position be liquidated?</mark>

1. Not enough margin: your remaining collateral is too low for the risk.
2. Profit hits the cap: you’ve earned up to the configured maximum payout, so the system force-closes.
3. Funding eats your collateral: ongoing funding fees use up your collateral (even if price PnL is positive).
4. Market is turned off: the index or token gets delisted/disabled.
5. Access revoked: your address is removed from the whitelist.


