Introducing the StreamSwap Protocol, a protocol for time-based token swaps.
Unlike instant token swaps that occur in an AMM pool, StreamSwap facilitates token swaps over a fixed period of time. This presents a new opportunity for the Cosmos ecosystem and DeFi in general, which has yet to be fully realized.
In this article, we delve into the key features of the StreamSwap Protocol and explore how stakeholders, including Streamers (those who create a stream) and Subscribers (those who participate), can interact with the protocol and engage in community-driven price discovery and token launches.
Let’s get right to it!
In StreamSwap, two stakeholders. People that create streams and people that Subscribe to streams.
Streamers create streams by locking a fixed number of tokens (TOKEN 1 or T1, say FLIX) to be exchanged for an accepted token (TOKEN 2 or T2, say OSMO) over a predetermined time period (say 1hrs).
Once a stream is created, T1 (FLIX) cannot be added or removed until the end of the Streaming Phase.
Below are the two phases of a Stream:
a) Bootstrapping Phase
b) Streaming Phase
This phase takes place between the stream's creation and its start time.
During this phase, Subscribers can deposit or withdraw their T2 (OSMO) tokens at any point in time.
No swapping occurs during the Bootstrapping Phase.
Subscribers receive shares for subscribing (depositing) with T2 (OSMO) and get shares deducted when withdrawing T2 (OSMO) tokens.
This phase begins at the stream's start time and lasts until the end time. Here, streaming duration is the time period from the start time to the end time.
Along with the Bootstrapping Phase, even during the Streaming Phase, T2 (OSMO) can be deposited / withdrawn by Subscribers.
Token swaps happen linearly over the entire stream duration.
T1 (FLIX) is streamed to Subscribers, and T2 (OSMO) is streamed to the stream creator, who locked T1 (FLIX).
Subscribers can add or withdraw their T2 (OSMO) tokens at any point during this phase.
At the end of the Streaming Phase is when price discovery happens.
The final price of locked T1 (FLIX) is determined by the total T2 (OSMO) received by the end of the stream. Below are computations for reference:
Stream Average Price (SP) = Total T2 (OSMO) Received by the Streamer / Total T1 (FLIX) Streamed by the Streamer
Individual Subscriber Average Purchase Price (AP) = Total Spent T2 (OSMO) by the subscriber / Total Redeemable T1 (FLIX) by the subscriber
Stream’s Average Price (SP) refers to the average price of T1 (FLIX) tokens in the stream.
The Stream's Average Price represents the overall average cost of T1 (FLIX) tokens for all subscribers in the stream.
It is calculated as the total T2 (OSMO) tokens received divided by the total T1 (FLIX) tokens streamed.
Stream’s Current Price (CP) refers to the current price of the T1 (FLIX) token in the stream, valued in T2 (OSMO) tokens
It fluctuates as the streaming phase progresses and subscribers deposit or withdraw T2 (OSMO) tokens.
The Stream's Current Price helps subscribers decide when to deposit or withdraw T2 (OSMO) tokens to optimize their average purchase price.
Subscriber's Average Purchase Price (AP)
This is the average price a specific subscriber has acquired the T1 (FLIX) tokens for.
It is calculated as the total spent T2 (OSMO) divided by the total redeemable T1 (FLIX) tokens.
The Subscriber's Average Purchase Price helps the subscriber assess their individual performance in the StreamSwap.
Both T1 (FLIX) and T2 (OSMO) tokens can be redeemed at the end of the stream since tokens keep getting spent over the duration of the stream.
Subscribers can redeem T1 (FLIX) based on their accumulation throughout the Streaming Phase
Total shares are a subscription with T2 (OSMO) based on the time at which they subscribed to the stream.
StreamSwap Protocol: A decentralized platform enabling time-based token swaps for fair price discovery over a fixed-period of time (or) fixed-duration.
Stream: A time-bound setup for exchanging tokens T1 and T2, written as
T1/T2 created by a Streamer. The first launch will have
FLIX as the
T1 token and
OSMO as the
Streamer: The creator of a stream who locks a fixed amount of T1 tokens for swapping.
Subscriber: A user who deposits T2 tokens to participate in the stream's token swap.
T1 Token: The token locked by the Streamer for the swap.
T2 Token: The token deposited/used by Subscribers for the swap.
Stream Duration: The time-period between the stream start time and stream end time
Bootstrapping Phase: The initial phase where subscribers deposit T2 tokens without any swapping.
Streaming Phase: The time-based token swapping period between Streamer and Subscribers.
Price Discovery: The process of determining the final price of T1 tokens based on T2 tokens received.
Redeeming Tokens: The act of claiming swapped tokens by Streamer and Subscribers after the stream ends.
Key metrics to track are divided into 2 parts. For the
stream and for the user’s
subscription (visible in the UI):
Important metrics to track with respect to a stream are listed as follows (visible in the UI):
Stream ID: A unique identifier for each created stream.
Locked tokens: Total tokens locked for streaming.
Remaining tokens: Tokens left from the initial Locked tokens.
Spent tokens: Total tokens used for subscription, acquiring streamed tokens.
Shares: Proportionate shares minted for stream subscribers.
Current Price: Present price of the streamed token, valued in the subscription token.
Average Price: Average price at which subscribers received the streamed token.
Important metrics for individual user subscription (visible in the UI):
Deposited tokens: Total tokens used for subscription by a specific subscriber.
Spent tokens: Total tokens spent to accumulate streamed tokens.
Unspent tokens: Tokens not yet spent, to be used during the StreamSwap streaming phase.
Avg. Purchase Price: Average price at which the subscriber received streamed tokens. (If lower than Stream Avg. Price, the subscriber performed better than most)
Redeemable tokens: Share of streamed tokens ready for redemption after the Streaming Phase ends.
Compared to LBPv1, StreamSwap offers several advantages:
No collateral token required: StreamSwap eliminates the need for a collateral token, simplifying the process for users.
Distinct primary and secondary markets: StreamSwap separates the primary market from the secondary market, providing more flexibility and control to users.
MEV resistance: StreamSwap is resistant to Miner Extractable Value (MEV) because transactions occur between blocks, as opposed to when the block is produced.
Initially designed for community-driven price discovery and fair launches, StreamSwap has the potential to expand its applications in the future.
Further update in no specific order include:
Threshold limits for subscriptions
The protocol could facilitate high-value swaps for community pool diversification, enable OTC deals without affecting the AMM pool, and more
Artists & Creators can utilize StreamSwap to discover the price of their NFT collections using StreamSwap
Have varied stream rate (with incline and decline curves)
Integrations with existing AMM Pools
Exploring organizational models of a collective/DAO
StreamSwap offers an innovative and user-friendly solution for time-based token swaps, ensuring fairness and transparency in the process.
The protocol's unique features, such as streaming every second i.e. lazy accounting, swaps over a period of time, the Bootstrapping & Streaming phases, provide an engaging and exciting experience for Streamers and Subscribers alike.
As StreamSwap continues to evolve, it will likely unlock new possibilities for its users, from community-driven price discovery to high-value swaps and beyond.
Follow us for juicy streams - https://twitter.com/StreamSwap_io
Join the conversation - https://t.me/StreamSwap_io