Introducing StreamSwap - protocol for time-based token swaps powering community-driven token launches

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!

Mechanism

1) Stream Creation

  1. In StreamSwap, two stakeholders. People that create streams and people that Subscribe to streams.

  2. 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).

  3. Once a stream is created, T1 (FLIX) cannot be added or removed until the end of the Streaming Phase.

StreamSwap Stream creation & configuration details
StreamSwap Stream creation & configuration details

2) Phases of a Stream

Below are the two phases of a Stream:

a) Bootstrapping Phase
b) Streaming Phase

Phases of a StreamSwap Stream
Phases of a StreamSwap Stream

a) Bootstrapping Phase

  1. This phase takes place between the stream's creation and its start time.

  2. During this phase, Subscribers can deposit or withdraw their T2 (OSMO) tokens at any point in time.

  3. No swapping occurs during the Bootstrapping Phase.

  4. Subscribers receive shares for subscribing (depositing) with T2 (OSMO) and get shares deducted when withdrawing T2 (OSMO) tokens.

StreamSwap during the Bootstrapping Phase
StreamSwap during the Bootstrapping Phase

b) Streaming Phase

  1. 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.

  2. Along with the Bootstrapping Phase, even during the Streaming Phase, T2 (OSMO) can be deposited / withdrawn by Subscribers.

  3. Token swaps happen linearly over the entire stream duration.

  4. T1 (FLIX) is streamed to Subscribers, and T2 (OSMO) is streamed to the stream creator, who locked T1 (FLIX).

  5. Subscribers can add or withdraw their T2 (OSMO) tokens at any point during this phase.

  6. At the end of the Streaming Phase is when price discovery happens.

Streaming Phase when tokens are being swapped every second. In the above example, 100K FLIX are streamed (Redeemable T1) for 200K OSMO (Received T2)
Streaming Phase when tokens are being swapped every second. In the above example, 100K FLIX are streamed (Redeemable T1) for 200K OSMO (Received T2)

3) Price Discovery

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
State of tokens after the Streaming Phase ends which results in price discovery after the entire duration from the start of the Bootstrapping Phase up until the end of the Streaming Phase
State of tokens after the Streaming Phase ends which results in price discovery after the entire duration from the start of the Bootstrapping Phase up until the end of the Streaming Phase
  1. Stream’s Average Price (SP) refers to the average price of T1 (FLIX) tokens in the stream.

    1. The Stream's Average Price represents the overall average cost of T1 (FLIX) tokens for all subscribers in the stream.

    2. It is calculated as the total T2 (OSMO) tokens received divided by the total T1 (FLIX) tokens streamed.

  2. Stream’s Current Price (CP) refers to the current price of the T1 (FLIX) token in the stream, valued in T2 (OSMO) tokens

    1. It fluctuates as the streaming phase progresses and subscribers deposit or withdraw T2 (OSMO) tokens.

    2. The Stream's Current Price helps subscribers decide when to deposit or withdraw T2 (OSMO) tokens to optimize their average purchase price.

  3. Subscriber's Average Purchase Price (AP)

    1. This is the average price a specific subscriber has acquired the T1 (FLIX) tokens for.

    2. It is calculated as the total spent T2 (OSMO) divided by the total redeemable T1 (FLIX) tokens.

    3. The Subscriber's Average Purchase Price helps the subscriber assess their individual performance in the StreamSwap.

4) Redeeming Tokens

After the Streaming Phase ends
After the Streaming Phase ends
  1. 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.

  2. Subscribers can redeem T1 (FLIX) based on their accumulation throughout the Streaming Phase

  3. Total shares are a subscription with T2 (OSMO) based on the time at which they subscribed to the stream.

Example of a user's participation with 6000 OSMO to receive 12000 FLIX at the end of the streaming phase
Example of a user's participation with 6000 OSMO to receive 12000 FLIX at the end of the streaming phase

Key Terminology

  1. StreamSwap Protocol: A decentralized platform enabling time-based token swaps for fair price discovery over a fixed-period of time (or) fixed-duration.

  2. 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 T2 token.

  3. Streamer: The creator of a stream who locks a fixed amount of T1 tokens for swapping.

  4. Subscriber: A user who deposits T2 tokens to participate in the stream's token swap.

  5. T1 Token: The token locked by the Streamer for the swap.

  6. T2 Token: The token deposited/used by Subscribers for the swap.

  7. Stream Duration: The time-period between the stream start time and stream end time

  8. Bootstrapping Phase: The initial phase where subscribers deposit T2 tokens without any swapping.

  9. Streaming Phase: The time-based token swapping period between Streamer and Subscribers.

  10. Price Discovery: The process of determining the final price of T1 tokens based on T2 tokens received.

  11. Redeeming Tokens: The act of claiming swapped tokens by Streamer and Subscribers after the stream ends.

Metrics to Follow

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):

  1. Stream ID: A unique identifier for each created stream.

  2. Locked tokens: Total tokens locked for streaming.

  3. Remaining tokens: Tokens left from the initial Locked tokens.

  4. Spent tokens: Total tokens used for subscription, acquiring streamed tokens.

  5. Shares: Proportionate shares minted for stream subscribers.

  6. Current Price: Present price of the streamed token, valued in the subscription token.

  7. Average Price: Average price at which subscribers received the streamed token.

The UI of a sample pool with stream details at the top and the Subscriber details to the right
The UI of a sample pool with stream details at the top and the Subscriber details to the right

Important metrics for individual user subscription (visible in the UI):

  1. Deposited tokens: Total tokens used for subscription by a specific subscriber.

  2. Spent tokens: Total tokens spent to accumulate streamed tokens.

  3. Unspent tokens: Tokens not yet spent, to be used during the StreamSwap streaming phase.

  4. Avg. Purchase Price: Average price at which the subscriber received streamed tokens. (If lower than Stream Avg. Price, the subscriber performed better than most)

  5. Redeemable tokens: Share of streamed tokens ready for redemption after the Streaming Phase ends.

Key Differentiators between LBPv1 & StreamSwap

Compared to LBPv1, StreamSwap offers several advantages:

  1. No collateral token required: StreamSwap eliminates the need for a collateral token, simplifying the process for users.

  2. Distinct primary and secondary markets: StreamSwap separates the primary market from the secondary market, providing more flexibility and control to users.

  3. MEV resistance: StreamSwap is resistant to Miner Extractable Value (MEV) because transactions occur between blocks, as opposed to when the block is produced.

Future Possibilities

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

To wrap it up!

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.


StreamSwap on the web!

Follow us for juicy streams - https://twitter.com/StreamSwap_io

Join the conversation - https://t.me/StreamSwap_io

Subscribe to StreamSwap Protocol
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.