Helping With Testnet

Guide, General

Helping With Testnet

Help contribute to the Spartan Protocol V2 public testnet. We all must help balance the pools and arb our way to glory!

Helping With Testnet

Welcome to the release of public testnet, Spartans! We will need all shields in hand to help balance the pools and squeeze out those beautiful edge case issues that we all love!

There are many tasks you can perform during testnet. You can report functional issues with the DApp, issues with the contracts, help balance the pools, send testnet funds to the contributors or just come have a look!

Please follow the below steps to get set up from wallet to Spartan-arbitrageur!

DApp Issue Submissions

If you come across any glaring issues in the DApp; please check the issues list via the link below and if it's not already covered please submit an issue and follow the template on how to provide all the required info.

Please note that 'style' related issues are not really desired at this point; only UX-related and bugs etc. Things like "this font doesn't look nice" or "light-mode is horrid" or "the translations don't make sense" aren't really helpful; the DApp is in its functional focus phase and those scopes will get an ongoing focus afterwards; so for now let's stick to either reporting functional issues or of course you can put up your hand to contribute with the UI/style issues instead of pointing at them.

Issues · spartan-protocol/SpartanProtocol-DAppV2
The Spartan Protocol DApp v2. Contribute to spartan-protocol/SpartanProtocol-DAppV2 development by creating an account on GitHub.

Contract Issue Submissions

There will be a 100K SPARTA pool for bounties on any exploits now and ongoing; valid findings will be rewarded from this float; please reach out on Telegram to get into a private discussion with an admin to submit or discuss an exploit if you feel you have found one. Your anonymity will be protected & respected!

Whilst all feedback is welcome; optimizations and UX-based findings most likely won't be met with a reward, but valid value-extraction findings will be rewarded appropriately.

Spartan Protocol - Community
Please take the time to read the pinned post first. Be respectful, be polite, be patient and welcome to Decentralised Finance on Binance Smart Chain.

Creating a Wallet

In order to use Spartan Protocol, you will initially need to set up a web3 wallet that supports Binance Smart Chain (BSC) testnet. Please note that WalletConnect is not compatible with BSC testnet (only mainnet) & that Trustwallet's DApp browser has been removed on iOS; so iPhone users should consider using desktop or Metamask-mobile instead.

Create a Wallet
Create your BSC Web3 wallet

Connecting your Wallet to the Spartan DApp

Once your wallet is set up, you will need to ensure you have added the BSC testnet RPC / network. If you are using BinanceChain Chrome Extension / Wallet, it will already have testnet/mainnet added by default.

If you are using Metamask; go back to the create a wallet guide and don't skip the section where they mention the RPCs / network:

Use MetaMask For Binance Smart Chain - Binance Chain Docs
Binance Chain Technology Documentation

For everyone else; the RPCs are listed here:

RPC - Binance Chain Docs
Binance Chain Technology Documentation

With that sorted; you may now need some guidance getting the wallet connected to the Spartan DApp. You can find a good guide here:

Connect Your Wallet
Spartan Protocol wallet connection guide

Congrats! You are connected and ready to begin!

Tasks to help with Testnet

Our main task, as Spartans, is to help keep the pools balanced with the outside market. Start by visiting the home page of the dapp. You will be presented with something like this:

As you can see; there are three assets here; BNB, DAI & BUSD. They are in order of depth/TVL (biggest pools first)

Your job is to get the market price of each asset and swap your assets to try to balance the pools. So go somewhere like Coingecko or CMC to get the market price of each asset first:

CoinGecko: Cryptocurrency Prices and Market Capitalization
Get cryptocurrency prices, market overview, and analysis such as crypto market cap, trading volume, and more.

DAI & BUSD are easy as they are stable coins; your goal is to swap them back to parity ($1.00USD). BNB in this example is $399.81

Comparing this to the screenshot of the pools above; we can see that all three assets are underpriced in the pools. That means SPARTA is more valuable against them in the pools than the outside market. This presents an 'arbitrage' opportunity in which you could trade your SPARTA for the asset at a favourable rate vs the outside markets.

So; when an asset is underpriced (ie. BUSD or DAI are less than $1.00 in the pools, or right now; BNB is less than $400) your goal is to swap SPARTA into the pool and receive the opposing asset. This in turn adds SPARTA to the pool and removes the other asset; making it more scare and therefore increasing its internal price in the pool.

Let's start by picking a pool you would like to arbitrage. Let's go with DAI in this example. Click 'swap' under the pool you would like to arb:

You can also click the menu icon and go to 'Swap' there if you would prefer.

Here we are now on the swap screen. You will see we are now selling DAI and buying SPARTA which is the wrong way around based on the explanation above on what we need to do to balance this particular pool. We can click the icon in the middle to flip this around if we like:

Or simply change the input asset to SPARTA by clicking the input asset and selecting SPARTA instead. Then select the output asset and change it to the asset you are wanting to swap to. Perfect; now we have the correct input and output assets; let's assess the size of the arbitrage opportunity. You will see on the right of the swap section a pool info section:

We can see DAI is underpriced still at $0.868 instead of $1.00 signalling a 10-15% price difference between the market and the actual pool rate. Ideally, you then do a small trade in the direction we need the pool to move. It can be quite complex working out exactly the perfect amount to put in to balance the pools, but in Testnet ideally, we just do a small-mid-size trade instead of one large trade. A simple quick minimal-math way to help do this is to look at the SPARTA depth of the pool (input asset) and get the portion of that with respect to the price difference (10-15%). In the above example that means:

96 SPARTA * 15% = ~14 SPARTA

We need to then at least halve that number, but I would then suggest breaking that number down further, let's try 3:

14 SPARTA / 3 = ~5 SPARTA

You will see in the above example we have input 5 SPARTA resulting in an estimated output of ~2.4 DAI. You will likely have to perform a token contract approval (one time per wallet->asset->contract). If so; you will see an 'Approve ASSET' button like so:

Click it and approve the txn in your wallet before you can then proceed to perform the actual swap txn. Once that is complete click 'Sell ASSET':

And confirm the txn in your wallet:

Soon after your transaction is complete; the DApp will automatically update the information of the pool:

As you can see; we are much close to the $1.00 USD peg for DAI now at $0.954. You can now assess the arb opportunity again if you like and try to balance it further:

Step 1: 1 - (currentRate / marketRate) = Rate Difference

1 - (0.954 / 1.00) = ~4.6%

Step 2: SpartaDepth * Rate Difference

101 * 0.046 = 4.64

Step 3: Get half of the opp (We are close to peg now; so halving it is fine for a final stab at getting a sweet, sweet, balanced pool)

4.64 / 2 = 2.32 SPARTA

Input 2.32 SPARTA, perform the swap, and this should bring us basically to peg 1:1 now:

Congrats! You are a rough-arb master! In the real world on mainnet, you will want to be more careful and calculated with arbitrating; feel free to reach out on Telegram and the community SpartAcademy on Discord to get some helpful tips from the community. The protocol will rely on us Spartans to help arb the pools as arbitrageurs are the economically incentivized security model of the protocol.

What Else?

You may also explore the rest of the DApp and perform other actions such as adding/removing liquidity, staking in the vaults, DAO proposals, synths etc but keep in mind there may be times where certain features are not available during testnet as testing will be siloed and in phases.

Also please be conscious of your actions; don't mint a gazillion synths or swap a pool's ratio way out of balance and walk away; please be conscious of your actions and how they will affect the pools. Try to act in testnet the same way you would on mainnet; you wouldn't act like that on mainnet as you would lose a lot of real money, so for some fun and in the interest of a successful experiment; pretend your testnet assets have real value pegged to their mainnet assets during this public testnet phase!

Go forth Spartans! ARBITRAGE!