Flamingo Litepaper
Version 1.5
January 2021

Introduction

Flamingo is an interoperable, full-stack decentralized finance protocol built on the Neo blockchain. Flamingo is comprised of five main components, including Wrapper - a crosschain asset gateway, Swap - an on-chain liquidity provider, Vault - a one-stop asset manager, Perp - an AMM-based perpetual contract trading platform, and also DAO - a decentralized governance mechanism. FLM is the governance token of Flamingo and will be 100% distributed to the community based on participation.
The Flamingo project is incubated by Neo Global Development* (NGD), underscoring Neo's vision to build the Smart Economy, of which decentralized finance is a crucial component. NGD will facilitate the early-stage development of the Flamingo project, and the governance mechanism will gradually transit from Proof-of-Authority (POA) to DAO. The Flamingo project will eventually run by the community.
*Neo Global Development (NGD) is the execution arm under Neo Foundation.

Key Modules

Wrapper

Wrapper is a crosschain asset gateway for Bitcoin*, Ethereum, Neo, Ontology Network, and Cosmos-SDK based blockchains. Users can wrap tokens such as NEO**, ONTd*** and value-pegged assets from Flamincome (nWBTC, nwETH, nUSDT, and etc.) on the Neo blockchain as NEP-5 tokens (nNEO, pONTd, pnWBTC, pnwETH, pnUSDT, and etc.). Wrapped NEP-5 tokens can also be redeemed back for native tokens. More tokens will be added to the list as the project develops.
*Native BTC will be supported at a later stage. **Since NEO is currently UTXO-based, users would need to wrap NEO to NEP-5 token in Wrapper to be better utilized. ***ONTd is the wrapped version of ONT on Wing Finance.

Swap

Swap is Flamingo's on-chain Auto Market Maker (AMM), providing liquidity to wrapped assets (as listed above), FLM, and other NEP-5 based tokens. Swap adopts the Constant Product Market Maker (CPMM) model, which was popularized in many AMM-based DEXs, such as Uniswap. CPMMs are based on the function
xy=kx*y=k
, which establishes a range of prices for two tokens according to the available quantities (liquidity) of each token. Within Swap, users can trade token pairs (included in a whitelist at the early stage) or provide liquidity to a chosen liquidity pool by depositing tokens to provide equal liquidity on both sides of the trading pair.
Liquidity Pool
LP Token
Trading
Trading Router
A liquidity pool is composed of a pair of NEP-5 tokens. Users can establish a new liquidity pool to deposit two types of NEP-5 tokens to supply liquidity or choose an existing pool to deposit equal fiat value liquidity on both sides of the trading pair. Consequently, liquidity providers can get an LP token corresponding to their deposited assets.
LP tokens represent liquidity providers' right to redeem their assets and earn passive income via trading fees, proportional to their contributions to the pool. 100% of the trading fees in Swap will be distributed to liquidity providers, which means the amount of the underlying token that can be redeemed by each LP token increases. LP tokens will be burned when liquidity providers withdraw their liquidity, and they can get back their deposited NEP-5 token pairs.
During the early stage, users can trade any token pair in Swap. Upon choosing a token and quantity to trade, users will be matched with the price and quantity of the target token (decided by the liquidity pool status). Instead of using a traditional buy/sell order book, both sides of the trade are pre-funded by on-chain liquidity pools in Swap. The current trading fee is set at 0.3%.
When a user wants to trade A to C without sufficient liquidity in the pool, or the relevant pool has not yet been established, the trading router will automatically search for an optimal trading route to execute the trade.

Vault

Vault is Flamingo's one-stop asset manager, integrating asset staking/mining, and collateralized stable coin issuance. FLM will be released and users can claim the distributed FLM by will.
Vault has two main functions:
Staking of NEP-5 Tokens
Minting of FUSD (not implemented)
Users will receive FLM after staking whitelisted NEP-5 tokens (wrapped tokens and LP tokens) into Vault.
Users holding whitelisted LP tokens can mint stablecoin FUSD by using staked LP tokens as collaterals and receive FLM.
Vault will be launched in 3 phases:
Phase 1
Phase 2
Phase 3
09/30/2020-10/05/2020
During this "Mint Rush" period, 50,000,000 FLM will be distributed to users staking whitelisted wrapped tokens into Vault.
09/25/2020-09/30/2020
During this "Mint Rush 2" period, FLM will be distributed to users staking whitelisted wrapped tokens into Vault as scheduled in the following Tokenomics section.
10/05/2020 onwards
Together with the launch of Swap, users can stake whitelisted LP tokens to receive FLM.
FUSD (not implemented)
FUSD
FUSD is a collateral-backed synthetic stablecoin in Flamingo, pegged to the price of USD.
Minting of FUSD
LP token stakers can mint FUSD against their staked LP tokens while maintaining the actual collateralization ratio above the liquidation collateralization ratio. The minted FUSD can then be utilized by the user at will.
Burning of FUSD
FUSD holders can burn their minted FUSD to unlock their collaterals.
Target Collateralization Ratio (Target C-Ratio)
The target C-Ratios of different LP tokens vary by their risk profiles and are subject to change for risk management purposes.
Liquidation Collateralization Ratio ( Liquidation C-Ratio)
The user's collaterals will be subject to liquidation if the actual C-Ratio is below the liquidation C-Ratio. There will be a 3-day (tentative) leniency period for users to manage their portfolio so that their actual C-Ratio returns above the liquidation C-Ratio.
Liquidation
At the event of liquidation, use's staked assets will only be liquidated by the amount needed to restore the liquidation C-Ratio, and the user needs to pay a 10% liquidation fee to the liquidator.
FLM from Minting FUSD
Users will receive FLM in proportion to the amount of FUSD minted. Distributed FLM can only be claimed by users when their actual collateralization ratio is above the target collateralization ratio for their collaterals.

Perp

1. Introduction

Perp is a vAMM-based perpetual contract trading protocol for virtually any underlying assets with infinite liquidity. Similar to Swap, traders can trade perpetual contracts using the same Constant Product Market Maker model with up to 5x (for now) long or short leverage after depositing margins. A funding payment mechanism is introduced to ensure the market price with the vAMM converges with the external price. Insurance Fund is also set up to ensure the stable and sustainable operation of Perp.
vAMM
Perp utilized a “virtual AMM” to introduce infinite liquidity with no impermanent loss. As all pools are virtual, no liquidity provider is needed for vAMMs. The vAMM itself can act as an independent settlement market, any profit and loss are directly settled with a liquidation process in place.
A funding payment mechanism is also introduced to ensure the market prices in the vAMM always converge to the external index prices.
K-value
Similar to AMMs (such as Swap), Perp uses a constant function of x * y = k for asset exchanges. The team will set the initial K-value based on trading volume estimations to ensure a smooth and stable trading experience, K will be adjusted accordingly to internal transaction volume and external volatility changes. Noted that vAMM is a novel concept, the proper k-value function will be improved on the go.

2. How to trade

Margin
Perp traders first need to add a certain amount of margin before opening any position.
  • Traders can add margin at any time.
  • Traders can reduce existing margins without affecting currency positions (and thus increasing the leverage) as long as they are not over-leveraged.
Position Opening
Based on the margins deposited and the chosen leverage, the trader will be able to open long or short positions. For example, if a trader deposits a margin of $100, and chooses a 5x leverage in either long and short, the trader will have a $500 position minus transaction fees in the vAMM.
Trades need to use the full margin amount to open positions, and the maximum leverage is 5x.
Position Adjustment
Opening a short position will effectively reduce the leverage of the current long position, and vice versa.
For example, a trader deposited a $100 margin and opened a 2x long position (position size $200). He then opened another 5x short position in the same vAMM. At this point, his net position became 3x short (position size $300). He could open new positions with a maximum of 5x long leverage or 2x short leverage.
Transaction Fee
0.1% of all transaction value will be charged as transaction fees and deposited into the Insurance Fund.

3. Funding

The funding payment mechanism is in place for market prices in the vAMM to converge to the external index prices. It also incentivizes arbitrageurs to bring the trading price within the vAMM as close as possible to the underlying index price.
Funding Rate
Definitions: Market Price: Latest trade price in the vAMM Index Price: Latest average price in external index markets TWAP_Market 1H: The average Market Price over the past 1 hour TWAP_Index 1H: The average Index Price over the past 1 hour
The funding payment mechanism is built upon a funding rate function. The funding fees will vary in response to the changing demand of longs and shorts, as compared to the external markets, and thus stabilizing the market price within a reasonable range around the index price.
We use the following funding rate functions for Perp:
Funding Rate (long) =(TWAP_Market1H-TWAP_Index1H)/24
Funding Rate (short) =(TWAP_Index 1H-TWAP_Market1H)24
The funding rate is calculated as the hourly difference between the TWAP (Time-weighted average price) between the market price and the index price.
When the market price is higher than the index price, the funding rate becomes positive for long traders, which incentives short traders and lowers the market price. On the other hand, when the market price is lower than the index price, the funding rate becomes positive for short traders, hence encouraging longs and increasing the market price.
Funding Payment
Funding Fees = Position size * Funding Rate
The funding fee is calculated every hour, and accumulated as part of the unrealized PnL. There is no upper or lower cap on the amount of funding fees.
Funding payment receivers will receive 50% of the funding payment collected, while the other 50% goes to the Insurance Fund.
Funding payment from net positions will be paid (or earned) by the Insurance Fund.

4. Liquidation

Liquidation will be triggered once the margin ratio of the user becomes lower than the maintenance margin ratio. The maintenance margin ratio is currently set to 5%.
Definitions: Entry Price: Average price when the position is opened Exit Price: Average price when the position is closed OpenPositionNotionalSize=Positionsize* Entry Price Position Notional = Positionsize * Market Price Unrealized PnL=(Exit Price-Entry Price)*Positionsize+Accumulate Funding Fee
Margin Ratio = (Initial margin + Unrealized PnL)/OpenPositionNotionalSize Liquidation Fee=2.5% *OpenPositionNotionalSize
In the case of insufficient margins for liquidation fee coverage, the Insurance Fund will absorb the loss.
Liquidation can be performed by either the Insurance Fund or an external Keeper (to be implemented in a later phase).

5.Insurance Fund

The Insurance Fund is set up to facilitate the stable operation of the protocol under various circumstances.
Income
Expenditure
Governance
  1. 1.
    Transaction fee: 0.1% of the position size.
  2. 2.
    Liquidation fee:
    If there is no external keeper, the Insurance Fund will be the liquidator and take the liquidation fee; If the liquidator is an external keeper, the Liquidation fee will be equally distributed between the Insurance Fund and the Keeper.
  3. 3.
    Funding fee: 50% of the Funding Fee goes to the Insurance Fund.
  1. 1.
    Liquidation cover: In the case of insufficient margins for liquidation fee coverage, the Insurance Fund will absorb the loss.
  2. 2.
    Funding fee: Unbalanced funding fees will be paid from the Insurance Fund.
Excessive Capital in the Insurance Fund can be distributed to FLM holders via governance proposals.

6. Contingency

Global Liquidation will be triggered when the Insurance Fund depletes. All open positions will be settled with a universal target settlement price and will thus differ from the expected unrealized PnL.

DAO

In the long-term, the governance of Flamingo will be taken over completely by the community in the form of Flamingo Improvement Proposal and Flamingo Configuration Change Proposal. Through DAO, FLM holders can vote for critical topics such as tokenomics, parameter configuration and functionality improvements/changes. Voters will receive FLM for participating in governance.
Metrics that will be governed by DAO include but not limited to:
Wrapper
Swap
Vault
Perp
  • Asset whitelist
  • Potential fee structure
  • Frontend whitelist *
  • Fee structure
*Trading pairs can be created in a permissionless way, and frontend whitelists will be determined by the DAO.)
  • FLM distribution mechanism
  • Staking token whitelist/distribution
  • Stablecoin collateral whitelist/configuration
  • FLM distribution mechanism
  • Fee structure

How it Works

Flamingo is a DeFi protocol cluster integrating multiple modules to provide a comprehensive DeFi infrastructure. Users can participate in Flamingo as different roles respectively or simultaneously as traders, stakers, and liquidity providers.

Project Features

Interoperability

Flamingo is based on Neo, which launched the Poly Network, an interoperability protocol together with Ontology, and Switcheo Network.
Through Poly Network, the Flamingo protocol is connected with various heterogeneous blockchain networks, such as Ethereum to Neo, Ontology, and Cosmos-SDK based blockchains. Users on Flamingo can leverage its interoperability to gain access to more assets within the broader blockchain ecosystem.

Capital Efficiency

Designed as a clustered DeFi protocol, Flamingo innovatively integrates the liquidity pool in Swap and the collateral pool in Vault. In current AMM-based DEXs, liquidity providers' capital efficiency is limited by LP token uses, leading some AMMs to become underutilized and poorly provisioned. High collateralization ratios in synthetic systems also lead to similar issues when users deposit assets to mint synthetic tokens.
Liquidity providers of FLM trading pairs in Swap can stake their LP tokens into the Vault module while minting FUSD at the same time. Under this mechanism, capital efficiency is more than doubled. Furthermore, liquidity providers can continue to use the synthetic stablecoin FUSD as margins for leveraged perpetual trading in Perp. Through these mechanisms, Flamingo promises to deliver unprecedented capital efficiency and liquidity compared to isolated DeFi protocols.

Fair Launch

Flamingo will distribute FLM 100% based on contribution to the platform with 0% pre-mining or team reserve. FLM distribution in the early stage will be determined by the Flamingo Team, and the long term distribution of FLM will be determined by DAO through FLM voting.

FLM Tokenomics

FLM is the governance token of Flamingo and will be 100% distributed to the community based on participation, with no pre-sale, pre-mint or team distribution.

Basic Information

Token Name
Token Standard
Max Supply
FLM
NEP-5
Not Fixed

Distribution

FLM will be 100% distributed to participants based on participation. During the early stage of the Flamingo project, the FLM supply will be distributed to the following use cases, which will be subjected to proposals and changes by the community after DAO launches.
  1. 1.
    Staking of cross-chain assets (only for the first one-week "Mint Rush")
  2. 2.
    Staking of LP tokens obtained by providing liquidity (After"Mint Rush")
  3. 3.
    Minting of FUSD in Vault (not implemented)
  4. 4.
    Depositing of synthetic stablecoin FUSD as margins to trade perpetual contracts
  5. 5.
    Participating in DAO governance

Token Release Schedule

Early Stage

Flamingo has pre-scheduled the release of FLM for the 13 weeks following the platform's launch:
Week 1
Week 2-5
Week 6-9
Week 10-13
50,000,000 FLM will be distributed.
40,000,000 FLM will be distributed.
30,000,000 FLM will be distributed.
30,000,000 FLM will be distributed.

Long-Term

The initial Flamingo team will no longer be in charge of the FLM release schedule after the launch of DAO. The team will instead propose a safe, stable, and sustainable operation plan for the community to consider. Community members who vote for Flamingo governance proposals will receive 10% of newly generated FLM. The projected distribution and release schedules (subject to change based on decisions made by DAO) for FLM in the long term are as followed:

Governance

Introduction

Flamingo aims to incentivize the broader community to participate in the Neo DeFi ecosystem. FLM is the project governance token and FLM holders can participate in governance through voting in DAO. As the project originator, the Flamingo team contributes initial resources and presently governs the initial platform design to actuate the project at its early stage, to facilitate the long-term growth of the project.

Scope of Governance

FLM holders are responsible for governing the Flamingo project, which includes but not limited to: tokenomics, parameter configuration and functionality improvements/changes. Anyone can become a FLM holder and join the community to shape the future of Neo's DeFi ecosystem.
Anyone can submit proposals in DAO and FLM holders are entitled to voting rights for relevant proposals. There are two types of proposals:

Flamingo Improvement Proposal (FIP)

Proposers can submit proposals to improve the overall system design of Flamingo, such as liquidity improvement plans, liquidation mechanism, risk control strategies, and etc.

Flamingo Configuration Change Proposal (FCCP)

FLM holders can decide the most important metrics of Flamingo as well as the release schedule of FLM. Examples of the metrics include but not limited to:
Wrapper
Swap
Vault
Perp
  • Asset whitelist
  • Potential fee structure
  • Frontend whitelist *
  • Fee structure
*Trading pairs can be created in a permissionless way, and frontend whitelists will be determined by the DAO.)
  • FLM distribution mechanism
  • Staking token whitelist/distribution
  • Stablecoin collateral whitelist/configuration
  • FLM distribution mechanism
  • Fee structure

Transitioning from POA to DAO

After the launch of DAO, the governance of Flamingo will be eventually transferred from the Flamingo team to the community. FLM holders are the key stakeholder of the Flamingo project. To develop a sustainable voting community, a tentative amount of 10,000,000 FLM will be distributed to voters.

Roadmap

Future Works

Flamingo aims to become the stepping stone to accelerate Neo's DeFi ecosystem development. Neo’s commitment to DeFi will not stop at Flamingo. From lending to insurance and asset management, the potential is boundless.
Flamingo’s design is still undergoing optimization, with questions ranging from how to introduce more external asset types, to which oracle implementation should be integrated, as well as the open governance mechanism before DAO goes live. As such, we welcome all community participants to proactively initiate proposals to further optimize Flamingo and build a more robust ecosystem.
Last modified 10mo ago