πŸ› οΈTechnical Details

Sigil Pools are smart contracts that hold pooled investor funds, which can be allocated and managed by the pool owner. The funds held within a Sigil Pool collectively belong to the pool's investors, w

Pool Tokens

Pool tokens are ERC20 compliant tokens created by a pool contract. They represent a share in their respective Sigil Pools and can be burnt by their owners to receive their equivalent value in ETH. Pool tokens can be minted to an investor's wallet based on the value that the investor provides to a pool. The usage of pool tokens is restricted to the pool they originate from. For example, pool tokens received from depositing into Pool A only represent a share in Pool A and cannot be used in any capacity with Pool B.

To simplify Sigil Pools, pool tokens have a representative ETH price. The price of a pool token represents a single share in a pool. Pool tokens can be fractionalized, and investors are not required to own whole pool tokens to hold a share in a pool. The price of a pool token can be found using the formula below, where TvTv is the token value/price, PvPv is the pool value in ETH, and TaTa is the amount of a pool's pool tokens in existence.

Tv=Pv/TaTv = Pv /Ta

The expected amount of pool tokens a user will receive upon deposit, and the expected amount of ETH a user will receive on withdrawal can be estimated by considering a pool token's price. As pool tokens are simply representations of a share, their usage as an estimation tool may not provide entirely accurate results. The value that a user gains on withdrawals and deposits depends on many factors, which are discussed below.

Deposits and Withdrawals

When a user deposits ETH into a Sigil Pool, their ETH is converted into the assets allocated by the pool manager. If a pool manager allocates their pool to hold 50% WBTC and 50% LINK, any deposits will be converted into these assets proportionate to the assets' share of the pool's value, not inclusive of the deposited ETH. The inverse of this concept applies to withdrawals. Upon withdrawal, the user will receive an amount of each asset held by the pool, proportional to the withdrawn share, converted into ETH. If a user were to withdraw an amount of pool tokens equaling a 50% share of the example pool from earlier, they would receive 50% of the pool's WBTC and 50% of the pool's LINK converted to ETH.

Upon the creation of a Sigil Pool, the initial pool token price is 0.01 ETH. Whenever an initial ETH deposit is made into a new pool, the depositor receives an amount of pool tokens minted to their address proportionate to their investment. This rule remains the same throughout the life of a pool, regardless of the pool token price. The pool tokens gained from a deposit will always be proportional to a deposit's value and a pool's asset value compared to the number of shares in existence. A formula for estimating the pool tokens received upon deposit can be seen below, where TrTr is the amount of pool tokens received, PvPv is the value/price of a single pool token in ETH, and DvDv is the ETH value of a deposit.

Tr=Dv/TvTr = Dv/Tv

This formula is merely an estimate; users will likely receive fewer pool tokens than estimated. This is because the pool tokens received by a depositor are based on the value of a deposit after accounting for pool fees, transaction fees, and value losses upon swapping the deposited ETH into pool allocated assets.

Many of the elements in the above paragraphs also apply to withdrawals. As shares in a pool are represented by pool tokens, and since pool tokens have a representative ETH value, the gained value from a withdrawal can be calculated using the formula below. ErEr is the ETH received, TvTv is the value/price of each pool token, and TwTw is the amount of tokens withdrawn. Again, the amount of ETH received will be lower than the result of this formula, as withdrawals are subject to fees and slippage when swapping assets.

Er=Tvβˆ—TwEr = Tv*Tw

Deposits and withdrawals can be processed by a pool through an order; withdrawals can also be processed through an instant withdrawal. An instant withdrawal is necessary for pools, since the processing of orders requires an active pool manager. If withdrawals could only happen through orders, this could trap user funds within a pool. There are only two differences between an instant withdrawal and a withdrawal order. A withdrawal order requires a pool manager to process it, and an instant withdrawal does not. With an instant withdrawal, a user can set the slippage of any pool asset swaps that occur, whereas a manager sets the slippage of a withdrawal order.

Orders

Sigil Pools use an order system to process a pool's withdrawals and deposits. Instead of a user processing their withdrawal or deposit transaction instantly, deposits and withdrawals are bundled together and processed by the pool owner when they choose to do so.

As explained earlier, whenever a user deposits into or withdraws from a Sigil Pool, they are swapping from or to ETH into the pool's allocated assets. This, of course, poses a significant gas cost to any user who processes these transactions. Interestingly, the gas cost of a token swap is not dependent on the amount of tokens being swapped; for the most part, the volume of a swap is irrelevant to the gas cost. This means that by pooling, for example, 10 deposits together, the overall cost to process those 10 deposits in a single transaction is approximately 10 times lower than the cost to process them separately. Due to this, it is far more efficient for a pool owner to process deposits and withdrawals, with the exception of instant withdrawals. This does require the pool manager to pay for gas fees, but this cost is offset by the fees they receive for doing so.

An order to a Sigil Pool can be thought of similarly to a limit order on an exchange, but with different execution conditions. An order is an agreement by the user to let a pool transact the funds specified therein. Before a user places an order, they must approve the funds/tokens they wish to transact. Upon placing a deposit order, the ETH paid to the pool smart contract is sent back to the user in the form of WETH. Since the user sets an approval prior to their deposit or withdrawal order, the pool transfers the approved funds from the user's wallet while the pool owner is processing their transaction. This means that funds can be kept, used, or transferred prior to the processing of a user's order.

At any time, a user may cancel their order and receive a refund for any transaction fees paid to the pool. Similarly, a pool owner can cancel any user's order, with the user also being refunded their transaction fees. This system allows pool owners to run exclusive pools. Since pools automatically swap ETH into pool allocated assets upon deposit, if a pool holds a near-limit amount of a token with a maximum wallet limit, further deposits may cause reverts and other errors. This is why pool owners can exercise control over their pool's inflow and outflow. However, it is against a pool owner's best interest to regularly deny orders, as it limits their revenue and incurs gas costs.

Orders rely on the token approval/allowance system present in all ERC20 token smart contracts. If a user has not set a sufficient allowance before their order is processed, the order will be invalid. This also applies to orders where a user has an insufficient balance or those that have passed their deadline. The Sigil Finance dApp requires users to set an allowance before ordering and to have a sufficient balance.

If an order is invalid, it will be removed from the order record upon processing, and any funds allocated to the order by the user will not be transferred. However, the fee that a user pays to the pool for processing their order will be retained by the pool and not refunded.

Fees

There are three different types of fees that a pool investor or pool manager may be subject to. These fees are as follows:

  • Platform Fees

    • 2% of all deposit and withdrawal volume

    • 0.75% of pool asset swap volume

    • 50% of platform fees are provided as yield to $SIGIL stakers

    • 50% of platform fees are provided to the Sigil Finance platform as revenue

    • The 50/50 split between stakers and the platform will be increased in favor of stakers

  • Pool Fees

    • A percentage set by the pool owner upon pool creation

    • Taken from deposits and withdrawals

    • Used to provide revenue to the pool owner

    • Cannot be changed

All fees are taken instantly from a subject transaction. Both platform fees and pool fees are similar in implementation to buy/sell taxes on ERC20 tokens.

Token Swaps

Pool managers can choose which assets pool funds are allocated to by setting a percentage value out of 100 for each pool asset. For example, a manager may set their pool to be made up of 50% WBTC and 50% LINK. Any deposits into the pool that begin as ETH must be converted into these tokens at the proportions they represent within the pool. The inverse is true for withdrawals, where the share value must be extracted from each allocated token.

Whenever a deposit, withdrawal, or change in asset allocation occurs, a token swap, similar to those on a DEX like Uniswap, takes place. Tokens are swapped for different tokens, and Sigil Finance applies a small 0.75% tax to this swap. Like any token swap, swaps on Sigil Finance are subject to price impact and slippage.

For the purpose of this document, price impact refers to the change in a token's price due to liquidity changes during a token swap. Price impact may not cause a swap to lose value, but it can result in fewer output tokens than expected. Pool managers must be especially mindful of price impact when investing in low liquidity assets. Slippage is the permitted amount of value lost from a swap before a transaction reverts. Both of these concepts impact deposits, withdrawals, and reallocations and must be considered by pool investors and managers.

Losing value during a swap on deposit or reallocation will decrease the value of a pool, and consequently, its pool tokens. Losing value during a swap during withdrawal will reduce the amount of ETH that a withdrawer receives.

Slippage and price impact values presented in the Sigil Finance dapp are calculated after platform and pool fees are applied. This means that the slippage value entered by a manager during order processing or asset reallocation, or the value entered by a user upon instant withdrawal, does not need to include value lost from fees. Price impact on Sigil Finance is calculated by finding the market value of an amount of tokens after subtracting platform fees on the swap, and then comparing that to the estimated amount that a user will receive from a swap of these amounts of tokens.

Last updated