# Table of Contents - [Liquidation Engine | Trendle Docs](#liquidation-engine-trendle-docs) - [Funding Rate | Trendle Docs](#funding-rate-trendle-docs) - [Intro | Trendle Docs](#intro-trendle-docs) - [Core Idea | Trendle Docs](#core-idea-trendle-docs) - [Background & Narrative | Trendle Docs](#background-narrative-trendle-docs) - [Product | Trendle Docs](#product-trendle-docs) - [Pulse / Data Feed | Trendle Docs](#pulse-data-feed-trendle-docs) - [Fees | Trendle Docs](#fees-trendle-docs) - [FAQ | Trendle Docs](#faq-trendle-docs) - [Trading Engine | Trendle Docs](#trading-engine-trendle-docs) - [Trendle UX Tutorial | Trendle Docs](#trendle-ux-tutorial-trendle-docs) - [Attention Index | Trendle Docs](#attention-index-trendle-docs) --- # Liquidation Engine | Trendle Docs 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. ### [](https://docs.trendle.fi/product/liquidation-engine#when-a-position-becomes-liquidatable) When a position becomes liquidatable: 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**. ### [](https://docs.trendle.fi/product/liquidation-engine#full-vs.-partial-liquidation) Full vs. partial liquidation * 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)_. ### [](https://docs.trendle.fi/product/liquidation-engine#health-factor) Health Factor 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. Health Factor\=min⁡(Margin Distance %, Profit Cap Distance %)\\text{Health Factor} = \\min\\bigl(\\text{Margin Distance \\%},\\ \\text{Profit Cap Distance \\%}\\bigr) Health Factor\=min(Margin Distance %, Profit Cap Distance %) 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% ### [](https://docs.trendle.fi/product/liquidation-engine#math-tl-dr) Math TL;DR * Payout\=collateral+tradingPnL+fundingPnLPayout = collateral + tradingPnL + fundingPnLPayout\=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)_. [PreviousFees](https://docs.trendle.fi/product/trading-engine/fees) [NextFunding Rate](https://docs.trendle.fi/product/funding-rate) Last updated 1 month ago * [When a position becomes liquidatable:](https://docs.trendle.fi/product/liquidation-engine#when-a-position-becomes-liquidatable) * [Full vs. partial liquidation](https://docs.trendle.fi/product/liquidation-engine#full-vs.-partial-liquidation) * [Health Factor](https://docs.trendle.fi/product/liquidation-engine#health-factor) * [Math TL;DR](https://docs.trendle.fi/product/liquidation-engine#math-tl-dr) --- # Funding Rate | Trendle Docs ### [](https://docs.trendle.fi/product/funding-rate#purpose) **Purpose:** 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. ### [](https://docs.trendle.fi/product/funding-rate#how-the-mechanism-works) How the mechanism works ? 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. 1. **Per market** * Funding is calculated separately for each token / index pair. No cross-netting between markets. 1. Rate formula (example shown for long-dominant market) fundingRatePerSecond\=(Long OI−Short OI)×baseFundingRateLong OI \\text{fundingRatePerSecond} = \\frac{(\\mathrm{Long\\ OI}-\\mathrm{Short\\ OI}) \\times \\mathrm{baseFundingRate}} {\\mathrm{Long\\ OI}} fundingRatePerSecond\=Long OI(Long OI−Short OI)×baseFundingRate​ If shorts dominate, swap “Long” and “Short” in the formula. Your per-second charge / credit = `positionOpeningNotional × fundingRatePerSecond` 1. **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. 1. **One-sided markets** * If all open interest is on one side (e.g., only longs or only shorts), no funding is charged. 1. **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. [PreviousLiquidation Engine](https://docs.trendle.fi/product/liquidation-engine) [NextTrendle UX Tutorial](https://docs.trendle.fi/trendle-ux-tutorial) Last updated 1 month ago * [Purpose:](https://docs.trendle.fi/product/funding-rate#purpose) * [How the mechanism works ?](https://docs.trendle.fi/product/funding-rate#how-the-mechanism-works) --- # Intro | Trendle Docs ![Page cover](https://docs.trendle.fi/~gitbook/image?url=https%3A%2F%2F1803377385-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FkH0nb6TCkpspOXW3VFkP%252Fuploads%252FUCUjn5GZzfSrMzh4hEpC%252Fog-image%2520%283%29.png%3Falt%3Dmedia%26token%3Df5ca6402-9f94-4715-944f-4c12368dd2f8&width=1248&dpr=4&quality=100&sign=2aef2310&sv=2) ### [](https://docs.trendle.fi/#what-is-trendle) What is Trendle? > [**Trendle**](https://app.trendle.fi/) > **is a prediction market platform that transforms online attention into a new financial asset class.** It allows users to speculate not on outcomes, but on the rise and fall of _hype, sentiment, and engagement_ around topics - from crypto narratives and sports teams to influencers and political events. ![](https://docs.trendle.fi/~gitbook/image?url=https%3A%2F%2F1803377385-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FkH0nb6TCkpspOXW3VFkP%252Fuploads%252FuivZLVgqwtB1906faD1t%252FFrame%25202131331327%2520%288%29.png%3Falt%3Dmedia%26token%3D17489b61-1af0-47fb-8b73-1ecda288ccc5&width=768&dpr=4&quality=100&sign=8496330&sv=2) [Trendle](https://app.trendle.fi/) operates at the intersection of social and attention data analysis and decentralized liquidity infrastructure: * [Trendle](https://app.trendle.fi/) (Markets, Liquidity & Execution Layer) Trendle runs the markets around Azuro’s index: pooled liquidity, position lifecycle, execution/settlement, fees, funding rate, and the liquidation engine, plus the full trader UX, dashboards, and APIs. * [Azuro Protocol](https://azuro.org/) (Attention Data & Index Provider) Azuro computes and publishes the attention index used by Trendle (the DoA/attention level for each tracked topic). The index aggregates public signals from platforms like X (Twitter), Reddit, YouTube (optionally Google) into a single tradable reference. * Attention Indexes (The Tradable Assets) Markets trade around the Azuro index so users can treat attention like an asset: • Hedge on Hype - position against overvalued trends. • Early on Narratives - capture value at the start of attention surges. • Speculate on Sentiment Shifts - profit from backlash or fading hype. ### [](https://docs.trendle.fi/#why-does-it-matter) Why does it matter? In today’s world, **attention is the most valuable yet most underpriced commodity**. 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.** ### [](https://docs.trendle.fi/#key-value-proposition) Key Value Proposition * **For traders:** Gain exposure to _attention indexes -_ a way to speculate on hype cycles, euphoria, or backlash, regardless of real-world results. * **For the ecosystem:** Unlock a new layer of **AttentionFi** markets that sits alongside prediction markets, DeFi, and fan economies. With Trendle, **attention becomes investable**, opening the door to a transparent, trustless marketplace where culture, narratives, and sentiment are as tradable as tokens themselves. [NextBackground & Narrative](https://docs.trendle.fi/background-and-narrative) Last updated 1 month ago * [What is Trendle?](https://docs.trendle.fi/#what-is-trendle) * [Why does it matter?](https://docs.trendle.fi/#why-does-it-matter) * [Key Value Proposition](https://docs.trendle.fi/#key-value-proposition) --- # Core Idea | Trendle Docs ### [](https://docs.trendle.fi/core-idea#attention-indexes) Attention Indexes 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 _attention as an asset class__._ ### [](https://docs.trendle.fi/core-idea#how-it-differs) How It Differs 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. ### [](https://docs.trendle.fi/core-idea#example-scenarios) Example Scenarios * **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._ [PreviousBackground & Narrative](https://docs.trendle.fi/background-and-narrative) [NextProduct](https://docs.trendle.fi/product) Last updated 1 month ago * [Attention Indexes](https://docs.trendle.fi/core-idea#attention-indexes) * [How It Differs](https://docs.trendle.fi/core-idea#how-it-differs) * [Example Scenarios](https://docs.trendle.fi/core-idea#example-scenarios) --- # Background & Narrative | Trendle Docs ### [](https://docs.trendle.fi/background-and-narrative#from-prediction-markets-to-attentionfi) From Prediction Markets to AttentionFi: Prediction markets were the first step toward financializing information. They allow speculation on the **probability of outcomes** **-** who wins an election, whether a law will pass, or if a team secures a victory. But they are bound to **binary resolution**: right or wrong, win or lose. > **Trendle takes the next leap: AttentionFi** Instead of betting on outcomes, Trendle focuses on **attention itself** **-** 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, **Trendle is a prediction market for attention** **-** a system where traders don’t speculate on who wins, but on where attention flows. ### [](https://docs.trendle.fi/background-and-narrative#the-attention-price-feedback-loop) The Attention–Price Feedback Loop: History shows us that **attention drives markets**: * More attention → more liquidity, more traders, rising prices. * Less attention → drying liquidity, fading interest, collapsing prices. ![](https://docs.trendle.fi/~gitbook/image?url=https%3A%2F%2F1803377385-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FkH0nb6TCkpspOXW3VFkP%252Fuploads%252Fjgo9KNCBrdKur4g1Gp7O%252FFrame%252028%2520%289%29.png%3Falt%3Dmedia%26token%3Da997d620-170d-4f3c-bc21-80e8b599c9be&width=768&dpr=4&quality=100&sign=77ad628&sv=2) 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. > **Trendle captures the loop itself making attention fluctuations investable.** ### [](https://docs.trendle.fi/background-and-narrative#our-role-in-the-shift) Our Role in the Shift Backed by Azuro, Trendle isn’t just another trading app. It is 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. [PreviousIntro](https://docs.trendle.fi/) [NextCore Idea](https://docs.trendle.fi/core-idea) Last updated 1 month ago * [From Prediction Markets to AttentionFi:](https://docs.trendle.fi/background-and-narrative#from-prediction-markets-to-attentionfi) * [The Attention–Price Feedback Loop:](https://docs.trendle.fi/background-and-narrative#the-attention-price-feedback-loop) * [Our Role in the Shift](https://docs.trendle.fi/background-and-narrative#our-role-in-the-shift) --- # Product | Trendle Docs ### [](https://docs.trendle.fi/product#what-trendle-ships) What Trendle Ships * **Attention Indexes** Quantified, real-time measures of online attention for topics (e.g., protocols, sports teams, influencers, memecoins). * **Trading Layer** Markets that let users go long/short attention with configurable leverage. Azuro provides the decentralized prediction-market infrastructure and pooled liquidity; Trendle supplies the index feed and UX. * **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). [PreviousCore Idea](https://docs.trendle.fi/core-idea) [NextAttention Index](https://docs.trendle.fi/product/attention-index) Last updated 2 months ago --- # Pulse / Data Feed | Trendle Docs 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. #### [](https://docs.trendle.fi/product/pulse-data-feed#id-1.-growing-content) 1\. Growing Content 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. #### [](https://docs.trendle.fi/product/pulse-data-feed#id-2.-trending-topics-clustered) 2\. Trending Topics (Clustered) 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). [PreviousAttention Index](https://docs.trendle.fi/product/attention-index) [NextTrading Engine](https://docs.trendle.fi/product/trading-engine) Last updated 1 month ago --- # Fees | Trendle Docs > 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. ### [](https://docs.trendle.fi/product/trading-engine/fees#entry-fees-one-time-at-open) Entry fees (one-time at open) EntryFee\=(TradingFee%+ImbalanceFee%)×(Collateral×Leverage)\\text{EntryFee} = \\big(\\text{TradingFee\\%}+\\text{ImbalanceFee\\%}\\big)\\times\\big(\\text{Collateral}\\times\\text{Leverage}\\big)EntryFee\=(TradingFee%+ImbalanceFee%)×(Collateral×Leverage) * Where it goes: sent to the treasury. * When it’s charged: **only once** when your order executes to open a position. * Not charged: on **close** OR if an order is created and later canceled. * **Accounting:** 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 **Position Size = Collateral × Leverage** _(fees excluded)_ ### [](https://docs.trendle.fi/product/trading-engine/fees#trading-fee) Trading fee * Type: fixed % of (Collateral × Leverage) at open. * Set by: contract admin. * value: 0.20% ### [](https://docs.trendle.fi/product/trading-engine/fees#imbalance-fee) Imbalance fee * Purpose: discourage crowding, charged ONLY when opening on the prevailing side * Scope: computed per token/index pair. * OI definition: open interest uses margin × leverage _(opening notional)_ * Prospective sizing: the new position’s size is included when evaluating the imbalance. * Virtual liquidity: by default, each side has 1k virtual dollar, and these are included when calculating the ratio of the sides. * Schedule: linear between two points: * starts at 0.45**%** when **OI ratio = 3:2 (1.5×)**, * increases linearly to 3**%** at **OI ratio = 10:1**. * Below 3:2, the imbalance fee is **0%**. * Charged: once at **open** _(part of Entry fees)_ ### [](https://docs.trendle.fi/product/trading-engine/fees#leverage) Leverage * Range: fractional value from **1×** (no leverage) to **5×** (max). * Effect: 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× ### [](https://docs.trendle.fi/product/trading-engine/fees#quick-example) Quick example * 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 [PreviousTrading Engine](https://docs.trendle.fi/product/trading-engine) [NextLiquidation Engine](https://docs.trendle.fi/product/liquidation-engine) Last updated 1 month ago * [Entry fees (one-time at open)](https://docs.trendle.fi/product/trading-engine/fees#entry-fees-one-time-at-open) * [Trading fee](https://docs.trendle.fi/product/trading-engine/fees#trading-fee) * [Imbalance fee](https://docs.trendle.fi/product/trading-engine/fees#imbalance-fee) * [Leverage](https://docs.trendle.fi/product/trading-engine/fees#leverage) * [Quick example](https://docs.trendle.fi/product/trading-engine/fees#quick-example) --- # FAQ | Trendle Docs ### [](https://docs.trendle.fi/faq#id-1.-what-exactly-am-i-trading-on-trendle) 1\. What exactly am I trading on Trendle? You’re trading **attention levels** - our Dollar of Attention (**DoA**) index for a topic (e.g., a protocol, team, influencer, or memecoin). Your P&L depends on how DoA moves, NOT on real-world outcomes. See the [**Index**](https://docs.trendle.fi/product/attention-index) chapter for the DoA spec and update cadence. ### [](https://docs.trendle.fi/faq#id-2.-how-is-trendle-different-from-classic-prediction-markets-or-memecoins) 2\. How is Trendle different from classic prediction markets or memecoins? Dimension Classic PMs Trendle Memecoins What is traded Probability of a binary/finite outcome (yes/no, date ranges). Attention level (DoA) around a topic; you can long/short attention. Token whose price is mostly driven by hype/memes. Reference / settlement Event resolution (oracle decides true outcome). DoA index published every minute; markets trade around this reference. No structured reference; free-floating price. Outcome dependency Payout only if the predicted outcome resolves as true/false. P&L depends on changes in DoA, regardless of real-world result. P&L depends on token price swings; not tied to measured attention. Primary P&L driver Movement in implied probability before resolution + final resolution. ∆DoA∆DoA ∆DoA (index moves) + funding transfers between longs/shorts. Speculative flows (virality, narratives, liquidity churn). ### [](https://docs.trendle.fi/faq#id-3.-where-does-trendle-get-its-data) 3\. Where does Trendle get its data? From public engagement metrics across **X (Twitter)**, **Reddit**, and **YouTube**. We ingest only publicly available fields like impressions, likes, replies / quotes; ### [](https://docs.trendle.fi/faq#id-4.-how-often-does-the-index-update) 4\. How often does the index update? Every **minute**, computed on a rolling **7-day** window to capture spikes and short-term persistence. ### [](https://docs.trendle.fi/faq#id-5.-what-is-the-funding-rate-here) 5\. What is the funding rate here? 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. ### [](https://docs.trendle.fi/faq#id-6.-when-can-my-position-be-liquidated) 6\. When can my position be liquidated? 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. ### [](https://docs.trendle.fi/faq#id-7.-can-i-provide-liquidity) 7\. Can I provide liquidity? Liquidity is provided through the **Azuro** layer; see [Azuro’s LP docs](https://gem.azuro.org/knowledge-hub/how-azuro-works/liquidity-tree#adding-liquidity) for roles, risks, and economics. [PreviousTrendle UX Tutorial](https://docs.trendle.fi/trendle-ux-tutorial) Last updated 1 month ago * [1\. What exactly am I trading on Trendle?](https://docs.trendle.fi/faq#id-1.-what-exactly-am-i-trading-on-trendle) * [2\. How is Trendle different from classic prediction markets or memecoins?](https://docs.trendle.fi/faq#id-2.-how-is-trendle-different-from-classic-prediction-markets-or-memecoins) * [3\. Where does Trendle get its data?](https://docs.trendle.fi/faq#id-3.-where-does-trendle-get-its-data) * [4\. How often does the index update?](https://docs.trendle.fi/faq#id-4.-how-often-does-the-index-update) * [5\. What is the funding rate here?](https://docs.trendle.fi/faq#id-5.-what-is-the-funding-rate-here) * [6\. When can my position be liquidated?](https://docs.trendle.fi/faq#id-6.-when-can-my-position-be-liquidated) * [7\. Can I provide liquidity?](https://docs.trendle.fi/faq#id-7.-can-i-provide-liquidity) --- # Trading Engine | Trendle Docs **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**. Conceptually, it works like this: 1. An oracle posts the current DoA for each index; 2. traders open leveraged positions against that reference; 3. A pooled liquidity vault underwrites payouts; 4. Funding re-centers price to DoA while liquidation removes under-margined positions to protect LPs. This is implemented by three contracts that work together: a **PriceFeed** _(index input)_, a **Pool** _(LP reserves)_, and **Trading** _(orders, P&L, fees, funding, liquidation)_. The outcome is scalable, orderbook-free markets where many attention indexes can share the same liquidity. ### [](https://docs.trendle.fi/product/trading-engine#the-three-on-chain-pieces) The three on-chain pieces: * **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. Call Use case (typical) Returned price when spread applies `getPrice(id, true)` Long-side checks, LP risk checks **Upper bound** of DoA band `getPrice(id, false)` Short-side checks **Lower bound** of DoA band * **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) ### [](https://docs.trendle.fi/product/trading-engine#life-of-a-trade) Life of a trade: 1. **Place order** * Trader sends collateral, leverage, side _(long / short)_, and `indexId`. Contract records a `Trade` (status **ORDER** for limit, otherwise executes immediately). 1. **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. 1. **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`. 1. **While open: funding keeps sides in check** 2. **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. 1. **Payout caps & settlement** * 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. [PreviousPulse / Data Feed](https://docs.trendle.fi/product/pulse-data-feed) [NextFees](https://docs.trendle.fi/product/trading-engine/fees) Last updated 1 month ago * [The three on-chain pieces:](https://docs.trendle.fi/product/trading-engine#the-three-on-chain-pieces) * [Life of a trade:](https://docs.trendle.fi/product/trading-engine#life-of-a-trade) --- # Trendle UX Tutorial | Trendle Docs > 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). Index is built on Azuro data/index rails. ### [](https://docs.trendle.fi/trendle-ux-tutorial#quick-start-tl-dr) Quick Start (TL;DR) 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. ### [](https://docs.trendle.fi/trendle-ux-tutorial#home-browse-and-compare-trends) Home: Browse & Compare Trends ![](https://docs.trendle.fi/~gitbook/image?url=https%3A%2F%2F1803377385-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FkH0nb6TCkpspOXW3VFkP%252Fuploads%252FNesHwuv42xk4JaC9EGiJ%252Fimage.png%3Falt%3Dmedia%26token%3D42d7c67e-0753-422c-9932-25a87a9d049f&width=768&dpr=4&quality=100&sign=7695d1fd&sv=2) * 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. 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. ### [](https://docs.trendle.fi/trendle-ux-tutorial#market-page-read-the-trend-take-a-side) Market Page: Read the Trend, Take a Side ![](https://docs.trendle.fi/~gitbook/image?url=https%3A%2F%2F1803377385-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FkH0nb6TCkpspOXW3VFkP%252Fuploads%252FdzGikhXMX5EzLVgRTH1Y%252Fimage.png%3Falt%3Dmedia%26token%3D2386f5c3-b7dc-415f-9e4f-8554c51771c0&width=768&dpr=4&quality=100&sign=6b6236ff&sv=2) 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. ### [](https://docs.trendle.fi/trendle-ux-tutorial#funding-the-wallet-usdc-on-base) Funding the Wallet (USDC on Base) Trendle beta uses USDC on Base. 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. **Note:** If you send tokens from the wrong network, they won’t appear. Ensure Base. ### [](https://docs.trendle.fi/trendle-ux-tutorial#placing-your-first-position) Placing Your First Position 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. ### [](https://docs.trendle.fi/trendle-ux-tutorial#portfolio-open-positions-and-history) Portfolio: Open Positions & History * Open Positions: Live P/L, entry DoA, direction, and boost per position. * Positions History: Closed positions with realized P/L and timestamps. If you don’t see a position right after placing it, wait a few seconds for chain confirmation and refresh. ### [](https://docs.trendle.fi/trendle-ux-tutorial#pulse-real-time-context-feed) Pulse: Real-Time Context Feed 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. [PreviousFunding Rate](https://docs.trendle.fi/product/funding-rate) [NextFAQ](https://docs.trendle.fi/faq) Last updated 1 month ago * [Quick Start (TL;DR)](https://docs.trendle.fi/trendle-ux-tutorial#quick-start-tl-dr) * [Home: Browse & Compare Trends](https://docs.trendle.fi/trendle-ux-tutorial#home-browse-and-compare-trends) * [Market Page: Read the Trend, Take a Side](https://docs.trendle.fi/trendle-ux-tutorial#market-page-read-the-trend-take-a-side) * [Funding the Wallet (USDC on Base)](https://docs.trendle.fi/trendle-ux-tutorial#funding-the-wallet-usdc-on-base) * [Placing Your First Position](https://docs.trendle.fi/trendle-ux-tutorial#placing-your-first-position) * [Portfolio: Open Positions & History](https://docs.trendle.fi/trendle-ux-tutorial#portfolio-open-positions-and-history) * [Pulse: Real-Time Context Feed](https://docs.trendle.fi/trendle-ux-tutorial#pulse-real-time-context-feed) --- # Attention Index | Trendle Docs ### [](https://docs.trendle.fi/product/attention-index#wtf-is-the-attention-index) wtf is the Attention Index The Attention Index measures near-real-time mindshare for a topic _(e.g., “bitcoin”, “Elon Musk”)_ by aggregating public engagement data from X (Twitter), Reddit, and YouTube 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. Built on Azuro’s indexing and data infrastructure. No artificial intelligence or generative systems used. The index is computed with deterministic, transparent math: normalization, exponential time-decay, quantile clipping, and light smoothing. ![](https://docs.trendle.fi/~gitbook/image?url=https%3A%2F%2F1803377385-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FkH0nb6TCkpspOXW3VFkP%252Fuploads%252F8gqtgN5VDwCmh71Hs106%252FFrame%25202131331328%2520%281%29.png%3Falt%3Dmedia%26token%3Db691f125-156b-437f-ba41-1b79f3e526fa&width=768&dpr=4&quality=100&sign=ef8cd684&sv=2) ### [](https://docs.trendle.fi/product/attention-index#data-ingest-inputs-and-collectors) Data Ingest: Inputs & Collectors Independent collectors continuously pull raw events per tracked topic and persist them for downstream processing: 1. X (Twitter) Collector: tweet-level public engagement _(retweets, replies, likes, quotes, bookmarks, impressions)_ plus author/post metadata. 2. Reddit Collector: activity across relevant subreddits/feeds _(e.g., hot/rising/top)_; metrics include scores and comment counts. 3. YouTube Collector: 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. ### [](https://docs.trendle.fi/product/attention-index#data-preparation-minute-level-topic-bounded) Data Preparation (minute-level, topic-bounded) * 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)._ ### [](https://docs.trendle.fi/product/attention-index#feature-families) Feature Families Azuro's infra constructs multiple feature families per minute and topic. #### [](https://docs.trendle.fi/product/attention-index#reddit-14-metrics) 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. #### [](https://docs.trendle.fi/product/attention-index#youtube-3-metrics-view-weighted) 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. #### [](https://docs.trendle.fi/product/attention-index#x-twitter-6-metrics-per-minute-averages) 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. 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. ### [](https://docs.trendle.fi/product/attention-index#from-raw-features-engagement-index-ei) From Raw Features → Engagement Index (EI) Azuro's infra converts mixed metrics into a stable, comparable per-topic EI via the following pipeline: 1. Global min–max normalization _(fixed bounds per metric)_: norm\=x−minmax−minthenclip∈\[0,1\] \\text{norm} = \\frac{x-\\text{min}}{\\text{max}-\\text{min}} \\quad \\text{then} \\quad \\text{clip} \\in \[0,1\] norm\=max−minx−min​thenclip∈\[0,1\] 1. Exponential decay over a 6-hour window with half-life = n _(recency-weighted aggregation)_: w(Δ)\=e−ln⁡(2)⋅Δ/half\_lifew(\\Delta)=e^{-\\ln(2)\\cdot \\Delta / \\mathrm{half\\\_life}} w(Δ)\=e−ln(2)⋅Δ/half\_life 1. Quantile clipping to suppress tails_,_ then smoothing for micro-noise reduction. These steps produce the per-minute Engagement Index for each topic. ### [](https://docs.trendle.fi/product/attention-index#from-ei-doa-dollar-of-attention) From EI → DoA (Dollar of Attention) To make EI directly usable for pricing/P&L in Trendle markets, Azuro's infra applies a linear multiplier (“DoA multiplier”) to EI: DoA\=EI×DOA\_MULTIPLIER\\mathrm{DoA} = \\mathrm{EI} \\times \\mathrm{DOA\\\_MULTIPLIER}DoA\=EI×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. ### [](https://docs.trendle.fi/product/attention-index#how-a-spike-propagates-hypothetical-micro-walkthrough) How a Spike Propagates (hypothetical micro-walkthrough) 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. ### [](https://docs.trendle.fi/product/attention-index#index-behavior-comparability-and-stability) Index Behavior, Comparability, and Stability * Unitless EI enables combining heterogeneous signals while preserving directionality _(more engagement → higher EI)_. * Cross-topic comparability is achieved via fixed global bounds per metric and the common DoA multiplier, so a DoA of 100 on topic A is directly comparable to a DoA of 100 on topic B. * Stability comes from trimmed/robust aggregations, decay + smoothing, and dense per-minute grids with controlled fills. [PreviousProduct](https://docs.trendle.fi/product) [NextPulse / Data Feed](https://docs.trendle.fi/product/pulse-data-feed) Last updated 27 days ago * [wtf is the Attention Index](https://docs.trendle.fi/product/attention-index#wtf-is-the-attention-index) * [Data Ingest: Inputs & Collectors](https://docs.trendle.fi/product/attention-index#data-ingest-inputs-and-collectors) * [Data Preparation (minute-level, topic-bounded)](https://docs.trendle.fi/product/attention-index#data-preparation-minute-level-topic-bounded) * [Feature Families](https://docs.trendle.fi/product/attention-index#feature-families) * [From Raw Features → Engagement Index (EI)](https://docs.trendle.fi/product/attention-index#from-raw-features-engagement-index-ei) * [From EI → DoA (Dollar of Attention)](https://docs.trendle.fi/product/attention-index#from-ei-doa-dollar-of-attention) * [How a Spike Propagates (hypothetical micro-walkthrough)](https://docs.trendle.fi/product/attention-index#how-a-spike-propagates-hypothetical-micro-walkthrough) * [Index Behavior, Comparability, and Stability](https://docs.trendle.fi/product/attention-index#index-behavior-comparability-and-stability) ---