# Welcome to Spin

Spin is a 360° decentralized trading and investments platform built on NEAR Protocol.

## Introducing Spin

[**Spin**](mailto:undefined) is a 360° **decentralized trading and investments platform** built on NEAR Protocol. Spin offers a wide range of products designed to meet the demands of both novice and savvy traders, DeFi investors, and passive income seekers.

In June 2023 Spin also started to build **an institutional-grade derivatives infrastructure** on Polygon zkEVM.

Spin aims to offer DeFi users a CEX-competitive user experience with no compromise on user experience, security, speed, transparency, and trading costs. We combined the best of the CeFi and DeFi worlds to build an advanced 360° decentralized trading platform offering users a wide range of trading and investment instruments including:

* **Spot trading:** Trade on spot using multiple order types, enjoy \~3 times lower trading fees compared to AMM DEXes, instant trade execution speed, and deep liquidity. Start trading 👉[https://trade.spin.fi](https://trade.spin.fi/).
* **Instant swaps:** Use the cheapness, liquidity, and speed of spot trading to make AMM-like instant swaps. Swap 👉<https://trade.spin.fi/swap>.
* **Perpetual Futures**: Perpetuals are a powerful derivatives instrument that allows you to extract yields on any market and use capital more efficiently thanks to up to x10 leverage. Try Spin Perpetuals 👉[https://perp.spin.fi](https://perp.spin.fi/).
* **Automated Investment Products (AIPs)**: AIPs use the Spin infrastructure: Spot, Perpetual Futures, and Options, – to offer users one-button Risk/Reward optimized strategies with a very simple user flow. The first AIP to be released on Spin is the Covered Call and Cash-Secured Put DeFi Option Vaults (DOVs). Invest 👉[https://](https://perp.spin.fi/)[vault.spin.fi](https://vault.spin.fi).

![](https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MdXZ16pgLU14jLP6Urj%2F-Mj-_vo3GoqEA-AUdZvY%2F-Mj07NRBcVO5Gz1TVMo4%2F5m62f1.gif?alt=media\&token=2bb8b6b8-0f48-43db-adaa-358594c35fd9)

## NEAR Protocol Infrastructure Overview

The backbone of the Spin products’ ecosystem is formed by its fully on-chain order book that provides a CEX-competitive experience to Spot and Perpetuals traders and allows for building more complex derivatives and investment products including Power Perpetuals, Floor Perpetuals, Structured Products, and Automated Investment Products (options strategies, basis trading, and more).

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2Fc40I072m1rHu9lrHFLV4%2Fspin__1-01.png?alt=media&amp;token=a40883d6-30fd-46b7-a10e-179d15d1f5a3" alt=""><figcaption></figcaption></figure>

## Background

Founded in June 2021, Spin was the first dApp to offer an on-chain order book solution on NEAR Protocol. In April 2022, Spin pioneered with the first [order book DEX](https://trade.spin.fi/) and in September 2022 launched the first [on-chain Perpetuals](https://perp.spin.fi/) on NEAR Protocol. That makes Spin a trendsetter in the field of derivatives trading within the NEAR ecosystem.

The advantages of the order book model include better user experience compared to AMM, flexible liquidity, easy access for institutional traders, secure and transparent on-chain verification, the opportunity to price different types of instruments, and trading robots’ interoperability.

Spin was founded by a team of derivatives trading oldfags with vast experience in asset management and DeFi who set their primary mission to onboarding CeFi users to DeFi and offering them a CEX-competitive user experience on-chain.

{% hint style="success" %}
**To stay tuned for our news and updates and never miss important announcements, join us on** [**Telegram**](https://t.me/spin_fi_chat)**,** [**Discord**](https://discord.gg/e3jUf3dDZu)**, and** [**Twitter**](https://twitter.com/spin_fi)**!**
{% endhint %}


# Spot Trading

Trade on spot using multiple order types, enjoy \~3 times lower trading fees compared to AMM DEXes, instant trade execution speed, and deep liquidity.

{% hint style="success" %}
**Start trading on Spin 👉** [**https://trade.spin.fi**](https://trade.spin.fi)
{% endhint %}

## Quick Overview

Spot trading on Spin allows you to trade on-chain and retain full control over your funds while enjoying the CEX-competitive user experience.

* The lowest trading fees on NEAR Protocol (trading on Spin is \~3 times cheaper than on AMM DEXes).
* Makers get 50% of taker fees as rebates.
* Multiple order types including Limit, Trigger, and other order types.
* Informative charts, trading history, and order history.
* More accurate pricing (liquidity in the order book is constantly rebalanced to mitigate the risks of potential slippage and inaccurate pricing).

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FU7QmDuQlweuap6Qvi0vP%2Fproduct.jpg?alt=media&amp;token=c0b324a0-d332-4aad-ac9e-1cacd21ecb95" alt=""><figcaption><p>V2 interface of Spin's spot trading section. To be released in Q1 2023.</p></figcaption></figure>

## How to trade on Spot?

To trade on Spin, you need to connect your NEAR-native wallet to Spin. Spin currently supports NEAR Wallet, Sender, MyNearWallet, Nightly, Here Wallet, Opto Wallet, and Meteor Wallet. More wallets to be integrated in the future.

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FR0pCmqvi5zqyjYp0fflm%2F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202022-12-13%2520%25D0%25B2%252016.40.16.png?alt=media&amp;token=16f2462d-a192-4701-b37e-6581dca9e622" alt=""><figcaption></figcaption></figure>

**If you don’t yet have a NEAR wallet, you can create it by performing the following actions:**

1. Visit the Spin app:<https://trade.spin.fi/>
2. Press the *Connect* button in the upper right corner.
3. You will be redirected to <https://wallet.near.org/login>.
4. Create an account. *Don't forget to save the account's secret phrase in a secure place.*
5. Top up your wallet balance. You can bridge assets to NEAR by using Rainbow Bridge or you can deposit NEAR to your wallet from a centralized exchange.

{% hint style="info" %}
Please note that when you connect to Spin for the first time, the contract will ask you to allow it to spend 0.25 NEAR from your wallet. These funds will be used to pay gas fees when you use Spin. This is a classic requirement from most dApps on NEAR Protocol.
{% endhint %}

**Deposits**

To trade on Spin, you first need to deposit money into the spot trading smart contract.

1. Connect your wallet to Spin.
2. Press *Deposit* in the top right corner.
3. Choose the currency and set the amount of crypto to deposit.
4. After the deposit is completed, you will see the deposited tokens on your Spin account balance. You're ready to trade!

**Trading on Spin**

The process of trading on Spin is similar to the process of trading on a centralized exchange, so if you have some experience with CEX trading, the flow will be super easy to navigate.

1. Select the trading pair you want to trade. At the moment, only limit and market orders are available. Soon, we plan to start supporting other order types.
2. If you place a limit order, after filling in all the fields, click the *Limit buy/sell* button, and your order will be placed in the Spin order book. You will be able to see it in the “Orders” section.
3. After the order is settled, your Spin wallet balance will be updated, and you will be able to withdraw assets.

{% hint style="info" %}
All transactions on the platform are carried out from an intermediary account, to which funds are sent when placing or executing an order. If there are not enough funds in the user's wallet to execute a transaction, Spin will request to transfer funds from your NEAR wallet to the balance.

In the future, the Spin team plans to implement an automatic transfer feature to enable one-click trading from a user's wallet.

If the order is executed or canceled, the funds will be placed in the intermediate wallet. To transfer cryptocurrency to your wallet, just click "Withdraw."
{% endhint %}

**Withdrawals**

1. If you want to transfer cryptocurrency to your wallet, just click *Withdraw*. The button is placed in the upper right corner.
2. Chose the token and the amount to withdraw.
3. If you didn't have the withdrawn token on your NEAR wallet before, NEAR protocol will ask you to pay 0.00125 NEAR to create a sub-account for this token.
4. Press *Withdraw* and tokens will be transferred from the exchange account to your NEAR wallet.

## Video Guide

If you prefer watching video guides, feel free to watch this tutorial made by a member of the Spin community ;)

{% embed url="<https://www.youtube.com/watch?v=GWkboBDPKUE>" %}

{% hint style="success" %}
If you faced some issues when trading on Spin or have some improvement suggestions, don’t hesitate to reach out on [**Discord**](https://discord.gg/e3jUf3dDZu). We thoroughly analyze all the feedbacks we receive to build the best DEX in Web3 that will outperform the expectations of our users.
{% endhint %}


# Instant Swaps

Use the cheapness, liquidity, and speed of spot trading to make AMM-like instant swaps.

{% hint style="success" %}
**Start swapping on Spin 👉** [**https://trade.spin.fi/swap**](https://trade.spin.fi/swap)**.**
{% endhint %}

## Quick Overview

**Instant swaps** allow users to quickly exchange one asset for another using a simplified AMM-like interface. When a user swaps one asset for another, a market taker order is instantly executed in the Spin spot order book, and the exchanged token is immediately transferred to the user’s wallet.

Instant swaps through Spin’s order book are **\~3 times cheaper** than swaps on AMM DEXes and usually have more accurate pricing even if larger-size trades are executed.

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FaHqnkhXdK6xyPZKuUmzL%2F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202022-12-14%2520%25D0%25B2%252013.44.19.png?alt=media&amp;token=58a31900-9c73-475c-a246-bce5ab23e65e" alt=""><figcaption></figcaption></figure>

## How to swap on Spin?

{% hint style="info" %}
If you don't yet have a NEAR wallet, please check the wallet creation instructions in the [Spot Trading section](/products/spot-trading#how-to-trade-on-spot).
{% endhint %}

Users, who want to exchange one asset for another without interacting with the order book can use the Instant Swaps feature.

1. Visit <https://trade.spin.fi/swap>.
2. Connect your wallet.
3. Choose the assets you want to exchange.
4. Optionally click on a gear icon and adjust the slippage settings. This parameter represents the possible range of the number of tokens you will receive. For example, if the slippage is set to 1%, the total number of tokens could be 1% lower than the initial amount shown.
5. Click on the *Swap* button and approve the transaction.
6. Funds will be automatically transferred to your wallet.

{% hint style="info" %}
The Instant Swaps feature interacts with the user’s wallet directly, without using the intermediary exchange account. Thus, assets held on the Spin account cannot be exchanged through Instant Swaps.
{% endhint %}

At the moment, users can swap any assets via USDC. For example, if the user wants to change NEAR to REF, it can be done within two steps: swapping NEAR for USDC and then swapping USDC for REF.

Shortly the Spin team will implement a feature for one-step swapping with advanced routing. That will allow users to exchange all assets listed on Spin in a single click.

## Video Guide

If you prefer video guides, feel free to watch this Swapping Tutorial prepared by a member of the Spin community ;)

{% embed url="<https://twitter.com/iPakistani10/status/1596547057015468037>" %}


# Perpetual Futures

Perpetuals are a powerful derivatives instrument that allows you to extract yields on any market and use capital more efficiently thanks to up to x10 leverage.

{% hint style="success" %}
**Start trading Perpetual Futures on Spin 👉** [**https://perp.spin.fi**](https://perp.spin.fi/)**.**
{% endhint %}

## Quick Overview

Spin’s Perpetual Futures are the first implementation of on-chain derivatives trading on NEAR Protocol. This asset type traditionally has larger trading volumes because of its capital efficiency:

* With Perpetuals, you can earn on any price movement, be that asset growth or decrease in price;
* To trade any Perpetuals contract, you only need to have the collateral — USDC in the Spin case;
* You can open positions that increase your balance by up to 10 times (leverage).

Perpetuals trading is also associated with higher risks because of the leverage considering that it multiplies not only potential profits but also losses.

{% hint style="info" %}
If you’re new to the concept of Perpetuals trading, we recommend that you first get acquainted with our [educational guide on Medium](https://medium.com/spin-finance/spin-perpetual-contracts-a-degens-guide-d15c745eba57).
{% endhint %}

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FOPmaDV7aWsDeOA7wl6dM%2Fspin_12.07_4-01-2.png?alt=media&amp;token=b9c22b69-463b-4f1d-b481-315a56031084" alt=""><figcaption></figcaption></figure>

## How to trade Perpetual Futures on Spin?

The experience of futures trading on Spin is quite similar to centralized exchanges. Still, for a few minor differentiators. Long story short, here's a quick lifespan of your futures trade on Spin:

{% hint style="info" %}
If you don't yet have a NEAR wallet, please check the wallet creation instructions in the [Spot Trading section](/products/spot-trading#how-to-trade-on-spot).
{% endhint %}

1. Connect your NEAR wallet to Spin.
2. Deposit funds to a Margin Account (which is a smart contract). In the blockchain, all users' funds on margin accounts are placed in a vault, where each transfer is assigned a number to indicate the owner of funds.
3. Create a futures position by choosing the order type and direction and position size (the leverage will be adjusted).
4. The margin ratio for this position is temporarily locked on your account (the margin ratio size depends on the position size and asset volatility).
5. Closing or changing your position results in the funds being settled and unrealized PnL and funding amounts are either added to or deducted from your margin account balance.
6. Withdraw returns from the Margin Account to your wallet.

{% hint style="info" %}
Note that if you have an open position and want to withdraw funds to your wallet, you can easily do that, but the margin ratio will be reduced. If you suffer losses for this position, there will be not enough funds in your account for keeping the margin ratio above 0.7 and it will lead to liquidation.
{% endhint %}

## Additional reads

To have a deeper understanding of Perpetual Futures and their implementation on Spin, please read the information provided in the Perpetuals section.


# DeFi Option Vaults

DeFi Option Vaults (DOVs) are the first Automated Investment Product (AIP) to be released on Spin. The release is planned for Q1 2023.

{% hint style="success" %}
Start investing in DOVs **👉** [vault.spin.fi](https://vault.spin.fi/)
{% endhint %}

## Quick Overview

DeFi Options Vaults (DOVs) are instruments that simplify option investment strategies by allowing participants to stake their assets in a vault while earning yield simultaneously. The DOV automatically deploys staked assets into specific options strategies, a process entirely run by smart contracts.

Options strategies provide good yield, but employing the strategies without DOVs can be tiresome. Investors need to calculate premiums, strike prices, suitable dates to position buys or sells, etc. With DeFi option vaults, all the user has to do is stake their assets in the protocol while the protocol invests the staked assets in options strategies on behalf of its users.

## The Spin DOVs

The Spin DOVs are one-button automated investment strategies that allow to:

* Invest in selling call and put options through a vault (option sellers) and earn options premiums;
* Buy call and put options through an auction (option buyers) and earn on asset volatility.

There are two main strategies in DOVs: **Covered Call** and **Cash-Secured Put**.

| Vaults           | Strategy                         | Underlying asset | Vault asset |
| ---------------- | -------------------------------- | ---------------- | ----------- |
| Covered Call     | Selling OTM call options on NEAR | NEAR             | NEAR        |
| Cash-Secured Put | Selling OTM put options on NEAR  | NEAR             | USDC        |

A **call option** represents a right to **buy** an underlying asset or contract at a fixed price at a future date but at a price that is decided today.&#x20;

A **put option** is the right to **sell** an underlying asset or contract at a fixed price at a future date but at a price that is decided today.

But in case of cash settlement method there is no real transfer of an underlying asset, trades pay out in cash at expiration, rather than delivering the underlying asset or security, and Spin uses this type of settlement.

#### ITM and OTM terms in options trading

**ITM** means *“expiration in the money”,* and in this case, the option buyer can get some profit from his option. For example, if the NEAR call option strike is $2.5 and the expiration price of NEAR is $2.9, the option buyer can exercise it and get a $0.4 profit.

**OTM**, on the contrary, means *“expiration out of the money”*, and in this case, the option buyer can’t get any profit from his option. For example, if the NEAR call option strike is $2.5 and the expiration price of NEAR is $2.1, the option buyer can exercise the option but he will get nothing.

#### Auctions

**An auction on Spin** is the process of selling options created by Vaults to buyers. When an auction starts, all options that were created by the Vault are put up for sale, and their number depends on the number of assets invested in the Vault. Buyers place bids, and after the end of the auction, the buyers who placed the best (highest bid) buy orders receive options in exchange for a premium, which goes into Vaults as a yield for investing.

#### Comparing Covered Call to Cash-Secured Put strategies

In practice, Cash-Secured Put and Covered Call strategies have similar risk profiles though there are some nuances. The table below shows the user’s profit depending on the strategy and market conditions.

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FrvYPnpCGk32dD8yDN9xn%2Fimage.png?alt=media&amp;token=67cd26bf-d65f-4804-8819-fe9ec361f2c7" alt=""><figcaption></figcaption></figure>

As you can see, **the most aggressive strategy** is to hold the underlying asset rather than invest it in DOV. In the event of a sharp rise in price, it will bring more money compared to all other strategies.&#x20;

The Covered Call strategy is **less aggressive**, while the Cash-secure put strategy is a rather **conservative** strategy.&#x20;

And the most secure strategy is to simply hold stablecoins because there is **no profit or risk** in this strategy.

{% hint style="info" %}
DOVs are similar to a very common strategy in traditional markets.&#x20;

Investors sell options that have a fairly low probability of exercising ITM. This means that investors receive a premium and lose nothing. Strikes are selected in such a way that the probability of ITM expiration is less than 5%.&#x20;

However, there is still a risk that due to market conditions, the options will be exercised by ITM. In this case, the Vault will have to pay the buyers of the options, and this will lead to losses for investors, so such strategies carry some risk.
{% endhint %}

## How DOVs Work

Each Epoch lasts 7 days. It starts at 9 AM every Friday when the previous epoch ends.

Users can apply to deposit or withdraw assets to/from the Vault at any time, but assets will only be placed/withdrawn from the Vault at the beginning of the next epoch.&#x20;

Assets, deposited by users are used as collateral for writing and selling options.

Shortly after the start of a new Epoch, auctions begin. Each auction is a way of selling options to buyers who bid on the options, and the winners buy the options according to their bids. The number of options is equal to the amount of the underlying asset in the Vault. For example, if the NEAR Vault has 1,000 WNEAR, then 1,000 WNEAR options will be available in the auction.

At the end of the auction, the highest bidders receive options and pay a premium for them. This premium represents the return to the Vault investors.

At the end of an epoch, options expire. The expiration price is defined as 30 min. the time-weighted average price of the underlying asset provided by the oracle. Depending on the expiration price, option buyers either get nothing or receive a payout equal to the difference between the strike price and the expiration price multiplied by the number of options.

### DOVs Workflow Example

**Initial epoch:**&#x20;

* Wednesday, 20.12.22 15:30. \
  User A deposits 10000 WNEAR in option Vault.
* Friday, 23.12.22 8 AM. \
  NEAR price = 1.5 USDC. Spin defines NEAR Call option strike and min. option price for the first epoch. Strike = 2.5 USDC, min. option price = 0.03 NEAR.

**Epoch 1 starts:**&#x20;

* Friday, 23.12.22 9 AM. \
  10,000 vtNEAR are minted for User A representing his share in the NEAR Covered Call vault. 10,000 NEAR Call options with 2.5 USDC strike are minted.
* Friday, 23.12.22 9:30 AM. Epoch 1 auction starts. \
  User B places a bid to buy 5,470 options at 0.087 NEAR per option, he deposits 0.087\*5470=474.067 NEAR to the auction. \
  User C places a bid to buy 5,500 options at 0.073 NEAR per option, he deposits 0.073\*5500=403.33 NEAR to the auction.
* Friday, 23.12.22 9:40 AM. Epoch 1 auction finishes.

  User B receives 5,470 options at 0.073 NEAR per option.

  User C receives 4,530 options at 0.073 NEAR per option.\
  (5470+4530)\*0.073=733.33 NEAR premium goes back to the Vault.
* Friday, 23.12.22 9:45 AM. Option buyers claim the remaining funds back from the auction.

  User B claims  72.933 NEAR.

  User C claims 71.133 NEAR.
* Monday, 25.12.22 14:32 PM.

  User D submits an application to deposit 5,000 WNEAR to the Vault. His funds get a pending deposit status.

**Epoch 1 finishes:**

* Friday, 30.12.22 8 AM. The expiration price of NEAR is defined at 2.6 USDC, and expiration takes place.\
  After the expiration options are settled by the buyers.

  User B profit: (2.6-2.5)/2.6\*5470=210.38 NEAR

  User C profit: (2.6-2.5)/2.6\*4530=174.23 NEAR

  Spin defines the NEAR Call option strike and min. option price for Epoch 2. Strike = 3 USDC. Min. option price = 0.04 NEAR.

**Epoch 2 starts:**

* Friday, 30.12.22 9 AM.

  User D's 5,000 WNEAR is transferred from a pending deposit to an active deposit.

  4,831.5154 vtNEAR are minted for User D, representing his share in the NEAR Covered Call Vault.

  User A has 10,000 vtNEAR equal to 10348.72 WNEAR.

  15,348.72 NEAR Call options with a 3 USDC strike are minted.

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FVl3XahXfI64mhncXmopd%2Fspin_16.01_2-01.png?alt=media&amp;token=c1d01ddb-396c-4ffb-abc5-04e9a9b3d367" alt=""><figcaption></figcaption></figure>


# Covered Call Strategy

Covered Call DeFi Option Vaults are one of the early strategies to be released on Spin allowing investors to earn premiums and extract returns from underlying asset price changes.

## Quick Overview

Users add liquidity to the Vault by investing in an Underlying Asset (UA) and depositing funds in the Vault. These funds are used as collateral for selling OTM call options to auction winners.

1. Investors deposit WNEAR (Wrapped NEAR) to the Vault and receive vtNEAR (Vault NEAR tokens) representing investors’ share in the Vault.
2. Option buyers deposit WNEAR to the auction.
3. When the auction takes place, bidders bid on the price of the NEAR call options. Depending on the final price, they receive the remaining money back after the auction.
4. The Vault sends options to the auction winners.
5. The WNEAR premium received from auction participants is distributed to the vault. These funds are the income of investors.

If the price of the asset at expiration is lower than or equal to the strike price, vault investors receive all the profit, which means that the options are expired OTM.&#x20;

If the price of the asset at expiration is higher than the strike price, option buyers can exercise the option and the Vault will lose some of the assets. The higher the expiration price compared to the strike price the more assets are lost by Vault investors. BUT (!) in the event of a price increase, investors cannot lose in dollar terms, it's only the underlying asset amount that decreases. In this case, the options are expired ITM.


# Cash-Secured Put Strategy

Cash-Secured Put DeFi Options Strategy is one of the early AIP strategies to be released on Spin. It's a conservative investment strategy.

## Quick Overview

Users invest stablecoins (USDC), which are used as collateral to sell put options based on the price of the underlying asset defined through an auction to option buyers. Selling options generates premiums, which are profits for the investors.&#x20;

Option strikes are set to avoid ITM expiration. Usually, options have a delta of 5-10%, but this can fluctuate in case of extremely low or extremely high volatility.

1. Investors deposit USDC to the Vault and receive vt1USDC tokens, representing investors' share in the vault.
2. Option buyers deposit USDC to the auction.
3. When the auction takes place, auction participants make bid orders on the price of NEAR Put options. Depending on the final price after the auction they get the remaining money back.
4. The Vault sends options to the auction winners.
5. USDC premium, which was received from the auction is allocated to the Vault. These funds make investors' revenue.

If the expiration price of the Underlying Asset is below the strike price at the time of expiration, the difference between the expiration price and the strike price is paid to the buyers of the option. For example, the expiration price is 3 and the strike price is 5, so option buyers will receive 5 - 3 = $2 for each option purchased. In the event that the option payout exceeds the option premium, Vault investors lose money in USDC terms.&#x20;

If the expiration price of the asset is greater than or equal to the strike price, option buyers receive no payout.


# Other AIPs

AIPs are automated investment products, a one-button solution for investors that represents an automated trading strategy.

## Quick Overview

There are many types of AIPs (Automated Investment Products) that can be created in DeFi. In general, each AIP is a one-button solution for users to invest in some strategy. These AIPs are made based on some market opportunity or demand and investors can profit from them. Some strategies have market risks, such as [DOVs](/products/dovs), and some of them do not depend on market sentiment.&#x20;

## Basis Trading

The Basis Trading strategy includes two differently directed positions.&#x20;

Users invest their money in the Vault, which buys assets on the spot market and sells the same amount on the Perpetual Futures market. In this case, the investors will have the same value of the position if the market moves in any direction, so this strategy is called delta-neutral.&#x20;

In this strategy, returns are generated through funding rates. If the funding is positive, the vault will generate some profit without any market risk. But if the funding is negative, the Vault will have some losses.

## Passive liquidity providing

Liquidity providing was popularized with the creation of AMM. It is very easy for users to lend assets to the liquidity pool and start making profits by earning swap fees. But the downside is the impermanent losses that users experience when the price of an asset changes.

In the case of the order book, things get more complicated. Usually, market makers are advanced market players with complex software and extensive experience, and they use their own or borrowed funds for market making. In this case, ordinary users cannot participate in providing liquidity. This violates the decentralization principles of DeFi and can be overcome by introducing Vaults. In this case, users provide liquidity to the Vault, which directs that liquidity to the market maker operating in the respective trading pair. That means liquidity providers will receive income from rebates and spread (the difference between the prices of buy and sell orders).


# NEAR-Perp

| **Underlying asset**           | NEAR                                                                                                               |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| **Price Oracle**               | NEAR/USDC Dark Oracle Index                                                                                        |
| **Ticker**                     | NEAR-PERP                                                                                                          |
| **Quantity step**              | 0.01                                                                                                               |
| **Max position**               | 10000                                                                                                              |
| **Trading schedule**           | 24/7                                                                                                               |
| **Tick size**                  | 0.001 USDC                                                                                                         |
| **Futures price (currency)**   | USDC                                                                                                               |
| **Expiry time**                | No expiry                                                                                                          |
| **Expiration price**           | –                                                                                                                  |
| **Margin type (currency)**     | USDC (SPIN, DAI, BTC, ETH, NEAR to be added in v.2.5)                                                              |
| **Collateral coefficien**t     | 10%                                                                                                                |
| **Mark price**                 | The price at which the contract is priced during trading. The mark price may differ from the actual bidding price. |
| **Settlement type (currency)** | USDC                                                                                                               |
| **Fees**                       | Taker = 0.08%, Maker = -0.04% excluding SPIN staking or holding discounts and trading volumes                      |
| **Liquidation fee**            | 2.5%                                                                                                               |


# SPIN Utilities

The SPIN token is a utility and governance token of Spin. Being the native token of the platform, SPIN features a wide range of utilities for all user segments.

## Quick Overview

The SPIN token is a utility and governance token of Spin. It is an investment (staking), incentive (market-making, trading), yield-boosting, and governance instrument that forms the economic backbone of the Spin ecosystem of products.

* **Investors** [stake SPIN](/spin-token/spin-staking) to receive 50% of the platform’s fees as a reward. This model also includes game theory mechanics (see below).
* **Traders** receive [SPIN token incentives](/spin-token/trader-incentives) as a reward for trading actively on Spin.
* **Market makers** also receive [SPIN token incentives](/spin-token/market-maker-incentives) based on the amount of liquidity provided, spreads, and their uptime.
* **Vault investors** are able to get additional rewards in SPIN tokens apart from the returns extracted from investing in Vaults. For example, NEAR Covered-call Vaults' investors earn options premiums and escSPIN as an incentive part.

Additionally, all user segments enjoy **extra benefits from staking SPIN** because it boosts their yield from participating in various programs. Depending on the amount of SPIN staked, users receive a multiplier in Spin's incentive programs. For example, stakers can earn more SPIN tokens for trading because they can have an up to 3x multiplier, depending on their trading results and the amount of SPIN staked. The same applies to market makers and vault investors.

Also, SPIN holders can participate in **Governance** and propose and vote on the decisions on features, utilities, incentives, etc.

To increase the demand and reduce the selling pressure, Spin has 3 tokens forming the backbone of the project's economy:

* **SPIN** is the main token that can be staked by users to get a share of the protocol revenue in USDC as a reward and escSPIN as an incentive part.
* **escSPIN** is the escrowed SPIN token that is used as a reward token. If the user wants to convert escSPIN to SPIN it should be vested thus allowing for decreasing the selling pressure. Moreover, escSPIN can also be staked and will have the same rewards as SPIN.
* **Spin Points (SPs)** are awarded in proportion to the staking time of SPIN and escSPIN. They increase the share of users in the distribution of Spin's income pool (boost the yield). If the user cancels staking, their SPIN or escSPIN Spin Points will be burnt proportionately.

{% hint style="success" %}
This way, all mechanics are aimed at increasing the demand for the token, reducing the selling pressure, and are designed to ensure sustainable growth of the Spin ecosystem.
{% endhint %}


# Public Token Sale

This page summarises all information about the Spin Token Sale.

## Token Sale Details

The SPIN token is a crucial element for the sustainable growth of the Spin ecosystem. Its public sale will take place in July 2023. The Spin token sale encompasses three rounds, each offering a distinct opportunity for participation.

* The **Priority** Round, exclusively available to Freaky Elves holders on [Spin (NEAR Protocol)](https://spin.fi), provides a head start for dedicated community members.
* The **Round A** sale, conducted on [Tokensoft](https://app.tokensoft.io/) (Ethereum), invites select participants to contribute to Spin’s journey.
* Finally, the **Public Round** on [Tokensoft](https://app.tokensoft.io/) (Ethereum and Polygon zkEVM) offers broader access to the Spin token sale, ensuring inclusivity and widespread participation.

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FGGCS9rlRwC0OKLMFKhIA%2F1*fDMYJMSetdF2LlJqDQjwcQ.webp?alt=media&amp;token=6cfacf3a-bfa4-4fdc-a78d-5f959f8e4a39" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
*\* For the priority sale, the minimum check size is the minimum purchase amount per account. The maximum check size depends on the number of NFTs owned by the user but cannot exceed $10,000 (max of 10 NFTs can be activated by 1 account). Each NFT activated increases max allocation by $1,000.*
{% endhint %}

{% hint style="info" %}
*\*\* The Spin Token Generation event (TGE) must occur before the token sale so that the token can be bridged to the NEAR Protocol before the sale. Thus, public sale vestings are calculated based on the Token Listing Event (TLE) or when the token becomes available for trading.*
{% endhint %}

The Spin token sale targets a raise between $2,450,000 and $3,500,000, depending on user activity in the priority and invite-only rounds. This substantial funding will propel Spin’s development, expanding its innovative offerings and enhancing the user experience.

**Token name:** SPIN

**Max supply:** 1,000,000,000

**Supply type:** Limited

**Initial circulating supply:** 48,500,000 (4.85% of the total supply)

**Public sale token supply:** 70,000,000 (7% of the total supply).

**Initial market cap:** $2,425,000

**Fully diluted market cap:** $50,000,000

**Blockchain:** Ethereum, NEAR Protocol, Polygon zkEVM


# Tokenomics

This page contains all basic information about the $SPIN tokenomics.

## Basic information

**Token name:** SPIN

**Max supply:** 1,000,000,000

**Supply type:** Limited

**Initial circulating supply:** 48,500,000 (4.85% of the total supply)

**Initial market cap:** $2,425,000

**Fully diluted market cap:** $50,000,000

**Blockchain:** Ethereum, NEAR Protocol, Polygon zkEVM

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FemsPXD502PxrAGguKbfn%2FOne%20Pager-2.png?alt=media&amp;token=5e257f45-41ef-4b36-8b68-11931c28163b" alt=""><figcaption></figcaption></figure>

## Token Distribution

**DAO treasury – 12.5%**

The DAO treasury represents a pool of funds dedicated to the continuous growth and development of Spin. In the future, members of the Spin DAO will rely on governance mechanisms to determine how the DAO treasury funds are allocated.

**Liquidity for Exchanges – 5%**&#x20;

In order to list [$SPIN](https://twitter.com/search?q=%24SPIN\&src=cashtag_click) on centralized and decentralized exchanges, it is essential for the team to have an ample supply of tokens for liquidity provision or market making. [$SPIN](https://twitter.com/search?q=%24SPIN\&src=cashtag_click) will be listed on several DEXes right after the token sale.

**Incentive Pool – 20%**

Incentives form the backbone of the Spin go-to-market strategy. Shortly after the token is released, users will start receiving rewards for trading, investing, and market making on Spin.

**Advisors – 5%**

Throughout our journey, Spin has been fortunate to receive support from numerous brilliant minds with extensive expertise. We anticipate that more experts will join our team in the future, and this pool is specifically designed for their incentivization.

**Spin Digital – 20%**

Spin Digital encompasses the collective efforts of the company, including the core team, development, marketing, operational staff, partnerships, events, and more. These funds will be utilized to support the future growth and development of the company.

**Seed Round – 12.5%**&#x20;

In February 2022, Spin announced its seed round where it successfully raised $3.75 million in funding from renowned venture capital firms including Lemniscap, Spartan Group, GSR, LongHash Ventures, Angel DAO, and ZMT Capital.&#x20;

**Strategic Round – 12% and Private Round – 5%**

These rounds occur after the token launch, during a new phase of Spin scaling. Following each round, there will be a 6-month cliff before vesting begins for the tokens.

**Public Sale – 7%**

Spin will have 3 public sale rounds:&#x20;

• Priority round – for Freaky Elves holders only;&#x20;

• Round A – min. check $2,500; WL and KYC required;&#x20;

• Public Sale – FCFS, KYC required.

**Airdrop Stage 1 – 0.5% and Stage 2 – 0.5%**

These are two events which were designed to reward the early supporters of the Spin brand. You can check if you're legit to receive an airdrop [here](https://airdrop.spin.fi).

The Spin token model has been reviewed by several prominent crypto VCs. It incorporates incentivization and control of circulating supply, with some elements of game theory.&#x20;

If you have any questions about the Spin token model, [ask them on our DS](https://discord.gg/spinfi).


# Market Maker Incentives

For adding liquidity to the Spin order book, Market Makers not only receive rebates and earn on spreads, but also get SPIN tokens as incentives.

## Quick Overview

Users who provide liquidity to the Spin order book can participate in an incentivized liquidity mining program.

The goal of this program is to ensure the deep liquidity of the Spin Perpetual Futures and Spot markets. In addition to onboarding professional market-making firms, Spin aims to allow market-making in a more decentralized way: Any user can participate in the liquidity mining program by depositing funds to a special Liquidity Mining Vault or setting up their [Market Making Bot](https://github.com/spin-fi/spin-market-maker). The final reward will depend on the user’s KPIs.

**There are four metrics that will impact the final reward:**

1. Spread from the middle of the market for provided liquidity;
2. Liquidity size;
3. Uptime of providing liquidity;
4. Maker volume.

According to the algorithm described below, the final S-score of each participating user is calculated. The user receives a share of the total rewards pool for the epoch corresponding to his share of the Final S-score.

## Incentive program visualization

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FgHDhKLfDvncg3YuPSs5U%2Fimage-3.png?alt=media&amp;token=30ed9517-4447-46b4-910a-3c408c53a342" alt=""><figcaption></figcaption></figure>

## Incentives calculation algorithm

**Step 1.** Calculate the sum of the user’s S-Scores for an epoch.

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FeSAHhSrQ86vWS7UZSf1Y%2Fspin_11.01_1-03%20(1).png?alt=media&amp;token=c072b991-efe9-463f-aea3-1322ea07160b" alt=""><figcaption></figcaption></figure>

During each epoch, Spin takes a snapshot of the order book once a minute at a random moment. For every minute the user gets an S-Score depending on the amount of liquidity provided and spread from the middle of the market. After each epoch, all S-Scores for each minute are summed up.

Below is the list of parameters that should be met by users' orders to be taken into account during the calculation of the S-score:

1. Minimum order volume: $300.
2. Maximum spread from mid-price: 30 bps or 0.3% for NEAR (i.e. total spread is 60 bps, it varies for different markets).
3. Liquidity is provided for both bids and asks.

**Step 2.** Our snapshot counter calculates the amount of time the market maker worked during an epoch: The number of snapshots where the users' S-Scores are higher than 0.

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FdafUZv3lGrmixQ2OipmU%2Fspin_11.01_1-04.png?alt=media&amp;token=1080a9d6-40b6-4550-abf9-cae85613dd43" alt=""><figcaption></figcaption></figure>

**Step 3.** Calculate the user's maker volume for a given market over an epoch.

**Step 4.** Calculate the Final S-Score value for the user.

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2F6kRII0mBj1HE1vBGI60u%2Fspin_11.01_1-05%20(1).png?alt=media&amp;token=c07db77e-0794-43e6-b529-ad64c71faa03" alt=""><figcaption></figcaption></figure>

**Step 5.** The Final S-score of each user is divided by the total amount of the S-scores. This determines the share of the total rewards for the given instrument the user will get.

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FEptm9x2A3Ue7HzeAvSyx%2Fspin_11.01_1-07.png?alt=media&amp;token=3b64c4bd-e5c6-49e2-89ea-3ce53b4a20be" alt=""><figcaption></figcaption></figure>

*Amount  of NEAR the user receives:*

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2F3BOiBNdaDjwwjJyeHN2N%2Fspin_11.01_1-06.png?alt=media&amp;token=ba4d66eb-29a5-46d9-a9e5-c58b9e39f780" alt=""><figcaption></figcaption></figure>

![](https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FjsZR0s7D62xAFwLBy1dw%2F6hb8q5.gif?alt=media\&token=0037fbce-feca-43d6-bd94-237a9833b13e)


# Trader Incentives

Spin traders get SPIN tokens as a reward for using the Spin trading platform actively. This is a loyalty program aimed at stimulating users to trade on Spin more actively.

## Quick Overview

Incentivized trading allows Spin to attract more users to the platform and stimulate them to trade more actively. When the rewards are calculated, the following parameters are taken into consideration:

* **Trading volume:** The higher the user's trading volume, the higher the reward.
* **Staked SPIN** is used as a multiplier in the formula. It stimulates users to stake tokens to increase their rewards for trading.
* **The number of completed orders** parameter is introduced as a wash-trading protection mechanism. The formula counts only the orders which were partially or fully filled. The more trades are made, the lower the multiplier.

The number of tokens allocated as an incentive reward for each Epoch is fixed and is allocated pro rata to participants based on their scores. A part of the trading inventive reward is vested after it is paid to the users.

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2F5ZeDOlVLvyQsPATE2l2X%2F777anr.gif?alt=media&amp;token=fb71f1f7-e902-4569-9baf-43dc6bb5ba4a" alt=""><figcaption></figcaption></figure>

## Reward calculation algorithm

The SPIN rewards for trading are distributed to both makers and takers to stimulate people to create both maker and taker orders.

Shares of the reward pool are split between different trading pairs according to the trading volumes in respective trading pairs.

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FtsphTX7agOrMmkim0DsG%2Fspin_11.01_1-09%20(1).png?alt=media&amp;token=a3448fd0-eeb2-4403-94c6-e8bd83733d76" alt=""><figcaption></figcaption></figure>

***Where:***

*a,b, c, d* - variables;

*T* - filled orders (any user’s order, which was at least partially filled);

*S-score* - user's total score;

***Suggested numbers for the variables:***

*a* = 0.4

*b* = 0.1

*c* = -100

*d* = 0.6


# SPIN Staking

SPIN Staking is an incentive program for the Spin token holders that stimulates users to stake their SPIN thus decreasing the token's selling pressure.

## Quick Overview

SPIN – the native protocol token can be staked. For staking, the user receives:

* **50% of the Spin fees**, proportional to the amount of SPIN staked (paid in USDC);
* **escSPIN;**
* and **Spin Points** (SPs).&#x20;

This way, the SPIN staking system includes 3 tokens: [SPIN](/spin-token/spin-staking#spin-reservations-and-vesting), [escSPIN](#escspin), and [Spin Points (SPs)](#spin-points-sps).

The number of escSPIN which is an analog of the usual incentive program to be received by the users will be determined later. The staking pool contains N number of escSPINs, which are distributed among the SPIN stakers during the period for which this incentive is calculated. In the next period, the amount changes based on the current APY, the dynamics of the price of the token, and the number of tokens in staking.

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FG4KKp96vtLLMGj6SUz0z%2Fspin_11.01_1-10.png?alt=media&amp;token=cdaa5c56-630f-49ca-8222-4400677b4aed" alt=""><figcaption></figcaption></figure>

***Where:***

*escSPIN RPB* – user's reward for 1 block;

*RPB* – reward per block;

*Σ(SPIN staked + escSPIN staked)* - the sum of tokens staked by all users.&#x20;

{% hint style="info" %}
When depositing/withdrawing SPIN from staking, the claim of all received rewards in the form of escSPIN automatically occurs. This is necessary for the correct calculation of how many SPIN tokens need to be reserved for escSPIN vesting.&#x20;
{% endhint %}

The number of Spin Points received is 100% APR, based on the number of staked SPIN and escSPIN.

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FzkQ7sKmTOA5ZIY6KCptt%2F777a69.gif?alt=media&amp;token=b5e00400-f549-4e21-8628-67758e1a2179" alt=""><figcaption></figcaption></figure>

## SPIN Reservations and Vesting

The formula for calculating the number of SPIN tokens to be reserved for escSPIN vesting looks as follows:

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2Fx0tXMlO0pNaZ7qaefMCx%2Fspin_11.01_1-11.png?alt=media&amp;token=d9bb4d05-1580-4f6a-a775-b38f5fc35e75" alt=""><figcaption></figcaption></figure>

***Where:***

*i* – all iterations, where the user claimed a staking reward;

*SPIN reserved* – the number of SPIN tokens to be reserved for escSPIN vesting;

*SPIN used for earning* – the amount of SPIN used to mine the corresponding amount of escSPIN;

*escSPIN earned* – the amount of escSPIN mined by the corresponding amount of SPIN and escSPIN.

{% hint style="info" %}
In addition to SPIN earning escSPIN, escSPIN itself can be staked to receive escSPIN. This escSPIN does not require additional SPIN in the vesting.
{% endhint %}

***Example:***

In Stage 0, the user stakes 100 SPIN.

In Stage 1, the user increases the number of SPIN in staking up to 200. The reward of 10 escSPIN is automatically claimed and the user stakes 10 escSPIN. The smart contract accepts the information that 10 escSPIN was mined using 100 SPIN.

In Stage 2, the user reduces the number of SPIN in staking to 50. The reward of 20 escSPIN from SPIN staking and 1 escSPIN from escSPIN staking is automatically claimed. All rewards are added to staking. The smart contract accepts the information that 20+1 escSPIN is mined with 200 SPIN (escSPIN used to mine escSPIN is not taken into account).

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FNXya2cqPK7Scr8OShdpn%2Fspin_11.01_1-12.png?alt=media&amp;token=caf537ea-92a9-4d51-ab49-49cb8bcd7bf6" alt=""><figcaption></figcaption></figure>

Suppose that after Stage 3, the user decides to vest all escSPINs they have earned before, or 39.1 tokens. In this case, the amount of SPIN required for the vesting equals:&#x20;

$$
(100*10+200*21+50\*8.1)/(10+21+8.1)=143.35038
$$

**This way, SPIN tokens have 4 states:**&#x20;

* Staked;
* Staked and reserved for escSPIN vesting (you can cancel escSPIN vesting and withdraw from the reservation at any time);
* Held in the user's wallet;
* Ready to be claimed after escSPIN vesting.

## escSPIN

**escSPIN (Escrowed SPIN)** is a non-transferable token, credited as an incentive for staking.&#x20;

**escSPIN can be used in two ways:**&#x20;

1. **Staking.** When staked, escSPIN receives rewards similar to the SPIN staking rewards.
2. **Vesting.** When escSPIN is deposited to vesting, it stops receiving rewards and is unlocked gradually over the course of a year. When an escSPIN token is vested, the amount of SPIN that was used to mine the escSPIN is reserved for it. The reserved SPIN tokens still generate a yield from staking. In the event that the SPIN tokens are withdrawn from the reservation, escSPIN vesting is suspended.

**escSPIN vesting is calculated according to the formula:**

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FrrBjSnNzpTl0fqu5DJrZ%2Fspin_11.01_1-13.png?alt=media&amp;token=a6a23857-768f-4a33-a9a8-5aaa24a738aa" alt=""><figcaption></figcaption></figure>

***Where:***

*day a* – vesting start day (after the SPIN tokens are claimed it is *not* *updated* for a new date);

*day b* – current day;

*SPIN claimed* – SPIN tokens already claimed by the user.

**This way, escSPIN has 4 states:**

* Waiting for a claim or compound;
* Staked;
* Held in the user's wallet;
* Deposited to vesting.

## Spin Points (SPs)

**Spin Point (SP)** is a non-transferrable token, credited in proportion to the time and number of SPIN and escSPIN in staking.&#x20;

In case of unstaking, SPIN or escSPIN Spin Points are burned in proportion to the number of tokens withdrawn from staking. Spin Points are boosting the profits from protocol fees received by the user. The number of Spin Points cannot be greater than the sum of the user's SPIN + escSPIN.\
\
**Spin Points reward is calculated according to the formula:**

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FTDn6dPjo1CLmMeGZGCm1%2Fspin_11.01_1-14.png?alt=media&amp;token=0f49c7ad-86fd-42ec-b8d5-9175c47f0973" alt=""><figcaption></figcaption></figure>

***Where:***

*day a* – vesting start day (after the tokens are claimed it is *updated* for a new date);

*day b* – current day.

*Example:* A user staked 260 SPIN and 7 escSPIN. In a week, the number of earned (but not yet claimed) Spin Points will be 267/365\*7=5.12.

**Spin Points are burned according to the formula:**

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2F5VrdU8Fy0Cij7zqISnTY%2Fspin_11.01_1-15.png?alt=media&amp;token=a1dd0257-e3c3-4e9f-84f9-a7c0427f8f95" alt=""><figcaption></figcaption></figure>

***Where:***

*SPIN Unst* – the number of SPINs that the user withdraws from staking;

*escSPIN Unst* – the number of escSPINs that the user withdraws from staking.

*Example:* A user has 500 SPIN and 250 escSPIN staked. The user's Spin Points are 57. The user wants to withdraw 150 escSPIN from staking. In this case, 11,4 Spin Points will be burned.

**Spin Points boost the staking rewards according to the formula:**

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FzGuxKAVv67EHX5Wv6ntP%2Fspin_17.01_1-16.png?alt=media&amp;token=e927274a-0275-4962-8305-30deddfa7c60" alt=""><figcaption></figcaption></figure>

*Example:* A user has 500 SPIN and 250 escSPIN staked. The user stakes 57 Spin Points. In this case, the APR is boosted by 57/(500+250)=7.6%

**This way, Spin Points have 2 states:**

* Waiting for a compound;
* Staked.


# Insurance Fund

Insurance Fund is one of the key elements in the overall design of the Spin internal economy which acts as a creditor of the penultimate instance.

## Quick Overview

Part of the Spin fees is sent to the **Insurance Fund**, which acts as a creditor of the penultimate instance. The functioning operative purpose of the Insurance Fund is to **provide** **sufficient coverage for the liquidation process** and **mitigate an extreme price slide-off risk**.

Theoretically, a situation is possible in which, due to increased volatility, the user will not be liquidated when *M-uPnL > 0*. In such a case, liquidation under standard terms will not be beneficial for the liquidators, so Spin will pay part (or all) of it from the Insurance Fund.

The amount of funds in the Insurance Fund correlates with the trading volumes on the platform. In case the Insurance Fund pool exceeds the target value, the surplus is distributed between the SPIN token stakers and the Treasury.&#x20;

The target value of the Insurance Fund is the amount of funds in the insurance fund sufficient to cover losses to counterparties in the event of potential liquidation of users with M-uPnL <0, calculated as 5% of the average OI (open interest) by notional value for 7 days.&#x20;

The minimum target value of the insurance fund is $100,000, regardless of trading volumes.

![](https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MdXZ16pgLU14jLP6Urj%2F-MjYSeUqVNHkCAud__jj%2F-MjYSiVV1s6oW48x8VhL%2F5mwp0d.gif?alt=media\&token=d0365287-d690-47d0-a6d9-eaf64e910bdd)


# Freaky Elves NFTs

Freaky Elves by Spin are a gen art utility NFT collection on NEAR Protocol that consists of 2022 unique 1:1 JPEGs.

{% hint style="success" %}
**Buy a Freaky Elves NFT on Paras 👉** [**https://paras.id/collection/spin-nft-contract.near**](https://paras.id/collection/spin-nft-contract.near)
{% endhint %}

## Collection Overview

Spin’s Freaky Elves on NEAR Protocol is a utility NFT collection consisting of 2022 JPEGs. Launched in March 2022, Freaky Elves are one of the most popular and trending NFT collections on NEAR by the number of holders, trading volume, and floor price growth.&#x20;

At the moment of the collection minting, its price was 0.7 NEAR and as of January 2023, the collection floor price equals \~30 NEAR with a floor price ATH exceeding 90 NEAR.

{% hint style="info" %}
**Freaky Elves' official smart contract address: spin-nft-contract.near**
{% endhint %}

## Collection Utilities

The first announced utility of Freaky Elves was the priority access to the upcoming public token sale of SPIN tokens. Later, the collection received more utilities and their list is constantly being extended.

* Priority access to Spin’s upcoming token sale.
* Boosting leaderboard position in Spin’s trading tournaments.
* Opportunity to get a share of Spin’s Airdrop 1.0 and 2.0 for early users of the protocol.
* Early access to early mainnet releases and community voting.
* Access to a secret holders’ chat on Discord.
* SOON: More Spin-related utility cases (e.g. decreased fees, access to special product categories).
* SOON: Access to partner communities and product perks.

![](https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FMgXup5gHhc0LCk37TXOD%2Fspin_11.03_2-06.png?alt=media\&token=d68401e4-de6f-4111-8b88-29a701ece215)

## Marketplaces

Freaky Elves are traded on the following NEAR-native NFT marketplaces:

* [Paras](https://paras.id/collection/spin-nft-contract.near)
* [Mintbase](https://www.mintbase.io/contract/spin-nft-contract.near/nfts/0)
* [TradePort](https://www.tradeport.xyz/collection/spin-nft-contract.near?tab=marketview)

{% hint style="warning" %}
**Always check the collection address before buying an NFT on a marketplace to avoid being scammed.**
{% endhint %}


# Secret Chat on DS

Freaky Elves have a secret chat for the NFT holders only. To join it, users need to verify the Freaky Elves NFT ownership on our Discord server.

## Guide: Holder's role & Acess to the secret chat

If you hold a [Freaky Elves NFT](https://nft.spin.fi/), you can get a special role on [Discord](https://discord.gg/spinfi) and get access to a secret chat for holders. As an NFT holder, you will be able to make proposals and vote for initiatives proposed by the Spin team. Sounds interesting? Quickly do these:

1\. Join our [Discord Server](https://discord.gg/spinfi) and verify yourself in #get-verified, it looks like this:

![](https://lh6.googleusercontent.com/Zw9YRE8rgE-8GrYRZUjkOIR--bWUivuLlnOs-ItOzCBlp5pTljJPJgOh_T96_fnC-KPtRjbUWOhKuWgINFMyqaG_Wb3K5aoLQfp-q9SRjCkg4040UCKU-QTFi_fR56AWLTJBZegsd_4GLaLyZkwxiWhYwHC0eipGLZdHwbNMwfcJUeylRjh9F5bEE04j7w)

2\. Upon verification ✅, you will be able to see all channels relevant to Spin. Next, scroll down until you find the Freaky Elves category. It will look like this:

![](https://lh4.googleusercontent.com/DndBbwO0ir-cX6QxMHpvBgn6QSrNW-V8xQIONYtQRdU8ct9q3t98BhOajwZm8IXNCHXGvlOudcnDQ1Id7IfACCXeQpsfLQmJ_GOWWVv_5vPs_zsvytQyWfQT7h1rQM6PnlDyUu81HDsVGYL5nPPncDnO-P3wE7C3ea6-tBqxbi9gFlVnODaq0I6y-Bz57A)

3\. Select Verify-elf-holder and interact with the API. See:

<figure><img src="https://lh5.googleusercontent.com/1ldo-eFLfeVe3cZJNNyRW8s64wmrMTNBMjSdhwhlq0RVRSwoLXRNlaIwLArJ1CIMVQ_Th9nCAm74zQ9ItRv3mQJvgRiddiKnaMvgUGNpvNYMASS5Mo7sLe3ZxeoYxWqlv6YXYeAAY9BoiNJDhv63UzYZqhi03Uv1-VLgKAhbX7TWonuyPNlOnzCQ5Jrb_g" alt=""><figcaption></figcaption></figure>

4\. You will be redirected to a page that requires you to connect your Near wallet. As in:

<figure><img src="https://lh4.googleusercontent.com/4PHijvflTmo7faAqxP60750eiIJlSuY5ECxKhtQLwAvAl-15CzSjAD9MVkbmJEHNvS18DG9Nm76slv-ZYH4GJ1VFcMvjI1YRC9eGTc4Iqc4hy6SETHn0mM_wsqScfUI_ebfMw1oFG4d4KIjUKKLBfIH-88Baz6WrO7uqnDcjJQioSk17f_x0InJ1nSLkYA" alt=""><figcaption></figcaption></figure>

5\. Once you have connected your wallet, you will get a “Verification done” message. As in:

<figure><img src="https://lh6.googleusercontent.com/HrixwDiROTAVHGLW5doBxaaVqMmec_K4tw8kiPTeMhdsiwYyD99Y2ORocumUfFWbtASBjbKJKjfXNejYqiDiELMi8iKyIqXOenY6JcZepZQ9odCqWk6M_8W-JoFcavbnTOhMthEri3oq2Zkk-RXJooMlI0R-AKlPI_2-iy1pwM2WLMYFHYFk2k6fhGBRdA" alt=""><figcaption></figcaption></figure>

6\. Finally, head back to our [Discord server](https://discord.gg/spinfi) {Verify-elf-hodler} and React ✅ to get the Elf Hodler role.

<figure><img src="https://lh3.googleusercontent.com/iJgdwrBi9hYZ3O4QmHfJm6hZkRwvU5ZkvArS34PSYFiH8PH_XlFXBM-fuLJ8ciqJHMFmsjlS3pXaJY0tiPPO_TIylpia8KhlljfndNDQ5_xUP9bRdeBQXq1mGikRiFBplUtd9SNmu2xXFoFzEID8N1wvEw0D5Q6eqCwrwZzyhkAryn0zh5F9WP3KV_bHdQ" alt=""><figcaption></figcaption></figure>

**That’s it! Done 🌟**


# SC Methods & API

Developers' documentation of the Spin smart contract methods and API.

{% hint style="success" %}
**Actual documentation can be found at:** [**https://docs.api.spin.fi/**](https://docs.api.spin.fi/)
{% endhint %}


# Perpetuals

This part describes the fundamental components of Spin Perpetuals and their logic including Collateral, Liquidations, Margin Ratio, Funding, etc. Long story short, a nerdish read for techies.

## Table of Contents

* [Trading Modules](/tech-documentation/futures/trading-modules)
* [Collateral](/tech-documentation/futures/collateral)
* [Unrealized PnL](/tech-documentation/futures/unrealized-pnl)
* [Funding](/tech-documentation/futures/funding)
* [Margin Ratio & Liquidation](/tech-documentation/futures/margin-ratio-and-liquidation)

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2Fqa0fSTWlA6YUSSF35i51%2F777963.gif?alt=media&amp;token=e6489314-fbdd-4c2a-891f-8a89dd7c5edc" alt=""><figcaption></figcaption></figure>


# Trading Modules

This section describes Spin's trading architecture i.e. modules involved in perpetuals trading.

### Spin's trading modules

**Margin Vault** is an on-chain wallet that works according to the smart contract logic. To trade on Spin, users need to deposit funds to the margin vault that stores users' funds safely, while the smart contract defines the amount of funds the user can transfer depending on their balance and current positions.&#x20;

**Risk Engine** is a module that runs pre-trade checking and order settlement.&#x20;

All information about the user activity is kept in the smart contract that calculates traders' metrics such as required collateral, uPnL, margin ratio, etc.

1. The user deposits USDC to the margin account

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FkPrnNZMT7jYLhFmoGGnS%2Fspin_-03%20(1).png?alt=media&amp;token=c21b727e-be57-479f-91f8-8e67a57a6158" alt=""><figcaption></figcaption></figure>

2\. User enters a position for 1 BTC-PERP

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FyaNa97ZIelmCjz1U7MLb%2Fspin__tg.png?alt=media&amp;token=f44ee08f-5aa5-472e-ae37-4255ca5befc7" alt=""><figcaption></figcaption></figure>

3\. User closes the position

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FLVLC4Pg3ofFjs3hOTxuM%2Fspin__tg%20copy.png?alt=media&amp;token=1f4c66bd-5d75-42bb-9c7a-cb0ff96d13aa" alt=""><figcaption></figcaption></figure>


# Collateral

The collateral is the amount of funds blocked in the user's margin account when placing an order or increasing the net position. This is the insurance that guarantees the fulfilment of the trader's obligations. Collateral is calculated for each open position and for each standing order.

**Calculation of the collateral&#x20;*****Cp*****&#x20;for positions:**

![](https://lh6.googleusercontent.com/05ZK_CpJvEjyZaPSXBL2Wl9fjPZZGDpKimqe55UU9PHjntr0hc_3Pv3YuYhY7b9HGENDB37F3xsTOKNGoyhPLSsedr8cNL8HQydObZkb_37d7F0a_NerbhPSyZI28BBJYYzsrSxI8c2sSyr-07Xo-CY)

**Calculation of the collateral&#x20;*****Co*****&#x20;for open orders:**

![](https://lh5.googleusercontent.com/IRqIVLtUuYm-_q_Hu-SjWyTzi4CoDhh2sn5Wz3bHmPN5TFuqpt1fPcKZLLJp7YilJfy6jpKqNePwOgmAF1AKrt7wiQdkm_o80nWx2bGLVexJt8EANWvmxaKMVSW9CIhK3V7maUKmR-6xc-Ihx1gX34o)

Mark price is used for the market orders.


# Unrealized PnL

**Unrealized PnL (uPnL**) is the unrealized amount of the user's profit or loss if closing a position with current prices:

![](https://lh5.googleusercontent.com/1pktS5ndsSVr6tJ_mL5DDgO72XLUxUD49_y7j4OH2t5Q0daxZvYjXLjGodgLq3D5H1BKRrgeKABaHhXpKumYWi6yQC_NUg90C-lOqsDfqPMe6w8EiQVeRt3Ot0LCqt-LCy1kyuWS7veyw-ZZj5Wnj94)

> **Example:** Alice has 10,000 USDC on her margin account, and Bob has 6,000 USDC on his margin account. The BTC price is 33,520 USDC. At 15:00 Alice sells 1 BTC futures and Bob buys 1 BTC futures. The collateral for a position in both cases is 10%, or 0.1 BTC or 3,352 USDC.
>
> Suppose the BTC price rises by 5% to 35,200 USDC by 22:00. Alice's uPnL will be -1680 USDC, and Bob's uPnL will be 1,680 USDC. Collateral is still 10% of the price, or 3,520 USDC. uPnL is converted to the margin amount when the trade is closed.


# Funding

**Funding rates** are periodic payments either to traders that are long or short based on the difference between perpetual contract markets and spot prices. Therefore, depending on open positions, traders will either pay or receive funding.&#x20;

At Spin the funding amount is calculated slightly differently than in most CEXs and DEXs.&#x20;

The most common method for calculating the funding amount is to do it per some time interval. Let’s call this interval a financing period, **the funding epoch**. The most common funding epoch is either 1 hour or 8 hours. When it comes to on-chain perpetual trading, the smart contract has to call this method rather often to accrue the funding amount, especially if the number of users and markets available is big. This results in a spike in transaction fees.&#x20;

Hence, at Spin, we came up with a more optimal method to calculate the funding amount: **The funding event happens every time when the user changes or closes the position.** The final funding amount *Fa* depends on several parameters: funding rate *Fr*, the position size *S* and time in the position *Tp*.

**Funding rate&#x20;*****Fr*****&#x20;calculation:**

![](https://lh5.googleusercontent.com/wxXWzNHS1CEI0SEGZniW4yMNtctWpOmrjHjmwjE7sukXCrd6RKBxvOvSxSndkttlcaoxkZ_5Vpfl6Gv1GoaiZcPFCifQOnMwSwf4sYDX_jmHOD8Ak_gdEW6bw724KdBGJYJJTY2vf9m3iWZqsY0kpRI)

Fr can't be more than +1% and less than -1%.

**Funding amount&#x20;*****Fa*****&#x20;calculation:**

![](https://lh6.googleusercontent.com/Z3tGD0qCM1DvizXIylLb4iQZHnc0DRfvESHt7ZZzEZN9XH5zv2bA7E3KTE23Eww7GlHu7v1Bl2LbCgcC4FS2TMcGMrvSCgL1qrkO8-EDW4H2Go6G76eYs8VWL9yA80mpWEPG3u4AIGydMSTknDVpry4)


# Margin ratio & Liquidation

The **margin ratio** is used to assess the risk of a protocol user's position.

The margin ratio shows whether the user's positions are safe, whether the user can place new orders, and whether it is possible to partially liquidate or completely liquidate the user's position. At the first stage of implementation, all user collateral will be used to maintain positions in different markets, the so-called **cross-margin**. To simulate an isolated margin (when the user chooses which part of the margin will be used for a particular position), you can create an additional account.

Spin uses a rather conservative approach to calculating the margin ratio, which reduces the chance of liquidating users' positions and does not allow users to place orders, after which the position will have to be liquidated immediately or almost immediately.

The margin ratio depends on open positions and their unrealized PnL, on open orders that increase the position, and on funding.&#x20;

![](https://lh5.googleusercontent.com/uCodk4JRs9dti4-lCYBnwipC9yyGuTDrOdYKy9RLDh8fPoPRWJ_qD8y2eRPHYFroVCRddxYfA2cRNShZHnMs0ZxmQKb97-iWiEOJ8EDLRnVANb8WvF51Xn60H-QmbuO8sjn3PtjkCKWLuxBMe6hK36M)

The numerator is the user's **equity**: the user's real balance if he closes all positions at the moment. The denominator is the collateral required to support open positions and open orders.

If *∑Co* = 0, that is, the user has no open orders, then the margin ratio is calculated simply by the formula, without iterations over open orders.

### **Liquidation rules**

The following rules are used depending on the value of the margin ratio:

* if, after the user has made a trade,  his *Mr*,  then there is no risk of opening new positions,
* if 0.7 <= *Mr* < 1,  then the user can't open new positions,  but he is not subject to liquidation either,
* if 0.3 <= *Mr* < 0.7, a partial liquidation of user positions is possible,
* a trader cannot withdraw funds from his account if *Mr*< 1 or if,  as a result of his withdrawal,  falls below 1,
* if *Mr* < 0.3, the complete liquidation of the user's positions is possible.

**Or the same rules briefly:**

![](https://lh3.googleusercontent.com/Y9glfJO_tL4s0uBCdcZERXj9XJ_hD-WW-2kCsSTSov5S5PUmKNfvj5e9ftZlV4UYfBU3-5TwVLEvM4pEeNu-vEka-HtD-5yJTF-wSLPafXj_jOCZrm1X3lBsL_5aaAb_pNkNf47zPVpRUBxq55cb0k0)

#### The commission for closing a position paid to the liquidator is 1.5% of the value of the closed position,  and another 1% is sent to the insurance fund.

### Liquidation terms

* If *Mr* < 0.7, the user's position can be liquidated.
* The *Mr* of the liquidator after liquidation must be > 1.
* The liquidator is not obliged to “buy back” the entire position of the liquidated person available for closing, the minimum liquidation is a value equal step\_size parameter.
* The user's position can be liquidated until it becomes equal to 0.7, taking into account the penalty charged for liquidation.

![](https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2Fv7kJ97e1H5xiLF6MUN6d%2F6hb7yt.gif?alt=media\&token=e2eddbe7-0d03-4402-8d86-b572470b27cf)

### **Liquidation calculator**

Liquidation calculator, which calculates how much of a selected asset can be liquidated:

![](https://lh6.googleusercontent.com/ohQyJqgji94XQ6iHBSXFgDaCjGZqsRYMoa8Wi2xA0ZJY6E-dfUDllhcznlEtwoP1PdMeFbNbwaQr7qxjJKEh08zeRXoHGflY1kt8vC33Dwtbi-kQZy6q7x-RZgRJ0eEa6UmsYq_BfC6FeCA1wCEnCeE)

If the position is long, then the equation is multiplied by +1, if short, then -1. The result is rounded up to step\_size parameter.

### **Liquidation bot**

The liquidation mechanism on Spin is implemented using a separate liquidation bot, the source code of which will be open in the future, and anyone can run it and receive rewards of 1.5% for helping to liquidate users on the Spin site.

The liquidation bot, when launched, initializes its state, storing in memory all accounts that have positions. Once in a given time interval, the bot receives from the smart contract information on all positions that have been changed since the last iteration and merges them with the accounts received during initialization or with the accounts received at the previous iteration. After that, the bot runs through all these accounts and the off-chain calculates who needs to be liquidated and who does not. All accounts to be liquidated will be liquidated using the liquidate() on-chain method, inside the call of which it will once again check whether the user is really under liquidation.


# Spin Trading Strategies

Most people are well aware of the classic trading strategies. Though there are many more use cases of Perpetuals, especially in a combination with spot trading. Some ideas are below!

## Basis trading

As you already know, Perpetual Contracts follow the price of the underlying assets, and this is done thanks to the funding rate. When the funding rate is positive, the Perpetual Contract price is higher than the Spot asset price, thus the platform incentivizes users for selling Perpetual and vice versa to bring the price closer to Spot. The funding payments that incentivize users other buy or sell a Perp are based on the funding rate.

So, what can users do to extract profit? **If the funding rate is positive**, try doing the following:

1. Buy Perpetual’s underlying asset on Spot, say 500 NEAR.
2. Deposit USDC to your margin account, e.g. 500 USDC.
3. Sell 500 NEAR-Perp.

Imagine the NEAR spot price is 3 USDC, and the NEAR-Perp price is 3.1.

In this case, your position is delta-neutral, because the NEAR price can’t affect your PnL at all. If the price moves down you will lose money on your Spot position, but you will earn money with NEAR-Perp, thus your PnL will be equal to zero.

So how do we extract yield? The answer is funding rate payments. Considering that the funding is positive and the user has a short position, the user’s unrealized PnL increases by the funding amount. In the example above it is 0.625 USDC per hour, 15 USDC for 24 hours, and 5,475 USDC for 365 days.

This way, you invest $2,000 and enjoy a 273% APY till the funding rate reduces.

In case **the funding rate is negative,** basis trading is more difficult:

1. You have to burrow NEAR, on Burrow Cash for example.
2. Then you sell NEAR on Spot.
3. Buy NEAR-Perp.
4. And collect funding! Capital efficiency in this case is lower and you have to control your risk parameters on Burrow, but it works!

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2F4OXVlDBewje1D1P5z6hS%2F7778k9.gif?alt=media&amp;token=aa81ead6-e7f0-4345-946d-328f48daf9e6" alt=""><figcaption></figcaption></figure>

## **Hedging**

Say, you have positions in different assets, e.g. Near, NearX, PEM, PARAS, etc. and you think that the market will go down in a short term. The first option most people have in mind is to sell the tokens, but it’s not convenient, especially if some tokens are used for staking, farming, or are potentially vested.

In this case, you can just short NEAR-Perp to hedge. Most tokens correlate in price, so shorting NEAR-Perps will hedge your positions, partly or fully. Moreover, Perpetuals’ fees are lower in comparison to the spot market, so you will spend less!

## **Buying spreads**

Buying spreads is a more advanced strategy. If you think that the price of an asset will rise against BTC, but you are not sure about the price of the asset in USDC, you can buy the asset on spot and sell BTC-Perp for an equal amount.

For example, the NEAR price is $3 and the BTC price is $20,000. You buy 300 NEAR on Spot ($900) and sell 0.045 BTC-Perp ($900). In this case, your total PnL will change only if the NEAR/BTC price is changing. This strategy works well if you think the entire crypto-market is weak but NEAR should go up due to some circumstances.

{% hint style="success" %}
**Was this article helpful and inspiring? Then it’s time to** [**give these strategies a try**](http://perp.spin.fi/) **on Spin! And of course, do not hesitate to ask your questions on our** [**Discord**](https://discord.gg/spinfi)**, the Spin fam is always there to help!**
{% endhint %}


# Using Ledger on Spin

A detailed guide on how to use the Ledger wallet to connect and use Spin Products.

## Introduction

There are two main ways to use Ledger:

1. Using "Near Wallet".
2. Using the native Ledger support.

{% hint style="warning" %}
At this time, "Near Wallet" is the only option available for spot and perps. However, DeFi Option Vaults support both NEAR Wallet and native Ledger connection.
{% endhint %}

{% hint style="success" %}
Before you start, make sure you have a Ledger with the NEAR application installed. You can install the NEAR application using Ledger [Live.](https://www.ledger.com/ledger-live)
{% endhint %}

## Using NEAR Wallet

1. Open [trade.spin.fi](http://trade.spin.fi/) and tap the “Connect to NEAR” button.<br>

   <div align="left"><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FSJTNSOjdtOloSd9wArcd%2FUntitled-13.png?alt=media&amp;token=a8daf22d-7fd5-4a71-847d-4bf0db1b163f" alt="Untitled"></div>
2. Select “NEAR Wallet” in the wallet selector.<br>

   <div align="left"><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FL0Ajy9GToIosLCldIb0t%2FUntitled-14.png?alt=media&amp;token=3dc8c735-d305-4f85-a47c-eadd561e1ac5" alt="Untitled"></div>
3. In the NEAR Wallet, tap on “Import Existing Account”.

   <div align="left"><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FkTmPu7C7Crje4LyiYIv7%2FUntitled-15.png?alt=media&amp;token=af6f40b8-b325-4a1b-b99f-efb4f3dd148d" alt="Untitled"></div>
4. Select “Sign in with Ledger”

   <div align="left"><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FZIxdSgiIQwWG77fNLZ9L%2FUntitled-16.png?alt=media&amp;token=e32dc274-dff6-4dd9-bb70-a396e15df029" alt="Untitled"></div>
5. Connect Ledger to your computer.
6. Unlock Ledger with your PIN.
7. Open the NEAR application on your Ledger.
8. Press the "Connect Ledger" button in the top right corner.

   <div align="left"><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FuFfQWygwpDlLauWkGLPL%2FUntitled-17.png?alt=media&amp;token=64ca66d3-a625-4b09-9132-f78b17fff821" alt="Untitled"></div>
9. Tap on "Connect" in the pop-up window.<br>

   <div align="left"><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FxISP4sMNNbiEgvrxbZkL%2FUntitled-18.png?alt=media&amp;token=d6d9b3db-54b2-4e15-b862-3e6d8f3d52f0" alt="Untitled"></div>
10. (Optional) If you want to import an existing account that was created by Ledger Live, you may need to change the HD Path in "Advanced Options". You can find your account's HD Path in Ledger Live by going to “Accounts” → “NEAR” → “Edit account” → “Advanced” (See attached images).\
    \
    **You can read about HD Path** [**here**](https://thebitcoinmanual.com/articles/btc-derivation-path/)**.**<br>

    <div align="left"><figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FiaZJ8PFmEgoRVm9xMeSe%2FScreenshot%25202023-03-28%2520at%252014.48.34.png?alt=media&amp;token=8adb8e4d-9279-4182-ba74-cbb2f503b66f" alt=""><figcaption></figcaption></figure></div>

    <div align="left"><figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FNfQm50WZiF6aE88hqs6o%2FUntitled-19.png?alt=media&amp;token=07c43a02-d9f2-4b9f-aef6-7146b588b3df" alt=""><figcaption></figcaption></figure></div>

    ![](https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FMLjmk0YzdtzQ9zvCoS7W%2FUntitled-20.png?alt=media\&token=adb32efd-e627-4e15-bff0-a16b763e8b31)
11. In the “NEAR Wallet”, tap on “Authorize”\
    ![](https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FCflzzllsCeFt3rLCxxqY%2FUntitled-21.png?alt=media\&token=591d3a50-8460-42ec-8f1a-c66e74b63544)
12. Next, confirm the public key on your Ledger device.
13. Select the account you wish to import and tap on “Next”.\
    ![](https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FvAV90XfnQ8XfNZ23TTXr%2FUntitled-22.png?alt=media\&token=a61d58d4-c487-4447-9b46-3fdd25bff17f)
14. Tap on “Connect” to link your account with [Spin.fi](http://spin.fi/)

{% hint style="warning" %}
Sometimes NEAR Wallet can become stuck and not allow you to connect your account. If you encounter this problem, try again later.
{% endhint %}

<div align="left"><figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FrxPrlc7Pr8Ye68tVwLYC%2FUntitled-23.png?alt=media&amp;token=7430273b-ed01-4a4d-816f-4fc6763dbef3" alt=""><figcaption></figcaption></figure></div>

**Done!**

## Using Native Ledger connection

1. Tap on “Connect Wallet” on [vault.spin.fi](https://vault.spin.fi/)
2. Select Ledger in the wallet selector

   <div align="left"><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FogHjvVRigw0k8DPyzyf2%2FUntitled-24.png?alt=media&amp;token=3e099df2-6b24-4dd4-af22-342bbb29175f" alt="Untitled"></div>
3. Connect Ledger to the computer.
4. Unlock Ledger with your PIN.
5. Open the NEAR application on your Ledger.
6. (Optional) If you want to import an existing account that was created by Ledger Live, you may need to change the HD Path in "Advanced Options". You can find your account's HD Path in Ledger Live by going to “Accounts” → “NEAR” → “Edit account” → “Advanced” (See attached images).

   \
   **You can read about HD Path** [**here**](https://thebitcoinmanual.com/articles/btc-derivation-path/)**.**

   ![Screenshot 2023-03-28 at 14.48.34.png](https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FiaZJ8PFmEgoRVm9xMeSe%2FScreenshot%25202023-03-28%2520at%252014.48.34.png?alt=media\&token=8adb8e4d-9279-4182-ba74-cbb2f503b66f)

   <div align="left"><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FNfQm50WZiF6aE88hqs6o%2FUntitled-19.png?alt=media&amp;token=07c43a02-d9f2-4b9f-aef6-7146b588b3df" alt="Untitled"></div>

   <div align="left"><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FMLjmk0YzdtzQ9zvCoS7W%2FUntitled-20.png?alt=media&amp;token=adb32efd-e627-4e15-bff0-a16b763e8b31" alt="Untitled"></div>
7. Tap on “Continue” and confirm the public key on your Ledger device.

![Untitled](https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FIuzzVvLZDyBn2u88Z23U%2FUntitled-25.png?alt=media\&token=21c6eb9b-cf10-413a-9a77-edd90ae9a975)

8. Tap on “Finish”. If you have multiple accounts, you need to choose one.

![Untitled](https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FbLhntkPfCztnmX0H6mkt%2FUntitled-26.png?alt=media\&token=159c6d9a-8bbe-4fc8-bfe1-84973e0bb6dc)

9. Congratulations! Now you can use vaults with Ledger.


# Useful links

Links to socials, websites, and more!

<table data-column-title-hidden data-view="cards"><thead><tr><th>Resource</th><th>Link</th></tr></thead><tbody><tr><td><strong>Website</strong></td><td><a href="www.spin.fi">spin.fi</a></td></tr><tr><td><strong>Twitter</strong></td><td><a href="https://twitter.com/spin_fi">https://twitter.com/spin_fi</a></td></tr><tr><td><strong>Telegram</strong></td><td><a href="https://t.me/spin_fi">https://t.me/spin_fi</a></td></tr><tr><td><strong>Discord</strong></td><td><a href="https://discord.gg/spinfi">https://discord.gg/spinfi</a></td></tr><tr><td><strong>Medium</strong></td><td><a href="https://medium.com/spin-finance">https://medium.com/spin-finance</a></td></tr><tr><td><strong>Smart Contract Methods &#x26; API</strong></td><td><a href="https://docs.api.spin.fi/">https://docs.api.spin.fi</a></td></tr></tbody></table>

<figure><img src="https://1444018571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdXZ16pgLU14jLP6Urj%2Fuploads%2FZHESJeo2snngYSCpc5tz%2F7778b4.gif?alt=media&amp;token=b5003002-11b3-4d9d-a93d-2b432e662160" alt=""><figcaption></figcaption></figure>


