SpartanDev: 08NOV21 - 14NOV21

Dev Update

SpartanDev: 08NOV21 - 14NOV21

Last week went by in a flash... faster than a Flash Bond! The DAO saw a cancelled ETH proposal and a promising BUSD one, meanwhile, Synths were enabled to be Forged finally on V2 marking a very large milestone for this community project!

SpartanDev: 08NOV21 - 14NOV21

Dao Proposals

This week the proposal to get ETH listed as a Curated pool did not meet consensus and was cancelled, followed by a new proposal to list BUSD for Bond which reached consensus very fast and is likely to be finalised very soon!

Flash Bonds

A round of small Flash Bonds went live to make up for the imperfect attempt at regulating the first Bond allocation via the pool caps. It was very successful with 500K SPARTA being bonded on 4 occasions 12 hours apart giving everyone a chance to get some Bond in. There were some unfortunately-timed RPC issues for 2 of the Bond events but ultimately time was the bigger factor here with each allocation being eaten up in a mere minute or two. Spartans wanna Bond it would seem!

With Flash Bonds out of the way, we can now resume the usual 2M full allocations as proposed and actioned by the DAO.

SYNTHS!

Wow-what a week! And to top it all off we got Synths enabled too! That's right! Synths are now enabled on Spartan Protocol V2. The Synth Caps are dynamic and open up every second to let in more Synth minters.

SynthVault incentives are not yet enabled, once some time has passed to allow more distributed weight (remember we did the same thing with the DaoVault harvest rewards) the incentives will be enabled and no doubt drive a lot more demand for these yield-generating assets.

#300SPARTA Quiz Fridays

The first quiz Friday kicked off with an easy one to grease the wheels!

The competition is still open, all you have to do to qualify is reply to the tweet with the answer to the quiz question "Name the settlement asset used in the Spartan Protocol pools"

Spartan Pools

Just a friendly reminder that Spartan Protocol is an AMM that provides its own markets for swapping assets. If you are looking to trade $SPARTA you really should be doing it through the Spartan pools to ensure you get the best rate!

Have had many reports recently of Spartans buying $SPARTA on other DEXs and being exposed to massive price impact/slippage. A quick thread comparing rates here:


Wednesday feeBurn Update

As the use of SpartanProtocol V2 increases, so does the feeBurn activity of $SPARTA (first time over 100,000 being burnt in a week).

Spartan Socials - Twitter

Tweet of the Week:

Community Tweet of the Week:

SpartanSocials - Medium‌

SpartanSocials - Telegram


Contributor's Focus

COMPLETE  ✅ - DAO incentives

COMPLETE  ✅ - DAO proposals

COMPLETE  ✅ - Begin Bond V2

COMPLETE  ✅ - Reserve diversifying into LPs

COMPLETE  ✅ - Set up Subgraph

COMPLETE  ✅ - Enable Synths

IN PROGRESS - Build a 'positions' page for the DApp

IN PROGRESS - Connect SPARTAv2 pools to aggregators

Enable SynthVault Incentives

Build some charting/analytics into the DApp

Overhaul style/UI of DApp

Post-C4-contest article on the top issues

Work with CMC/CoinGecko to feed in the SPARTA pool info

March onwards with our original goals of building the decentralised, yield-generating synthetics protocol on Binance Smart Chain


GitHub Activity — Spartan Contracts v2

Main Branch

contracts/Router.sol

  1. Simplified dividend revenue 'history' logic (use subgraph instead)

contracts/Synth.sol

  1. Added a 'realise' event to keep Subgraph in sync
sLend Branch

contracts/lendBase.sol

  1. Set up contracts for 'Lend SPARTA' implementation (yes... single staking SPARTA):
  • Users bring SPARTA to lend to the protocol
  • Gets asymmetrically added as liquidity, LP tokens held by protocol (POL)
  • The user gets no exposure to impermanent loss / impermanent gain and no exposure to revenue/incentives from the LP tokens, if they provide 1000 SPARTA, they are owed 1000 SPARTA + pre-agreed interest when their position expires
  • Fixed lend sizes, slots & time periods f0r a fixed % yield
  • A lot of details still to simulate and work out of course, and this is just one of many implementations. But it's a nice simple one that could be turned around rather fast compared to a lot of others (and it has the advantage of offering single staking + protocol owned liquidity with minimal development time)

GitHub Activity — Spartan DApp v2

General

  1. Updated ABIs to fix any broken txn parsing (for recent txns/history list)
  2. Updated every web3 function/action to include the new rpcs list (to ensure best RPC is used)
  3. Replaced all dividend/incentive tracking logic to use subgraph data instead
  4. Added a bunch of tooltips
  5. Show full WEI amount in tooltip on hover of the input wallet balance on all components & also on the pools page when hovering over the token's derived price

src/components/DataManager/DataManager.js

  1. Added call (20s interval) to check all RPCs and sort by best first
  2. Added call (whenever curated pools update) to get the new rolling 30-day incentives data from the subgraph

src/components/Notifications/Notifications.js

  1. Updated notification text to point user at the right spot (recent txns is in the wallet modal now)

src/components/WalletSelect/WalletSelect.js

  1. Improved WalletConnect logic:
  • Uses best RPC available instead of the index[0] now
  • Listens/waits for the user confirming to connect on their app, when its successful automatically directs the user to their actual assets/wallet now instead of having to close the modal and re-open

src/store/pool/*.js

  1. Removed all logic relating to:
  • mapAddress_30DayDividends & mapAddress_Past30DayPoolDividends
  • recentDivis & lastMonthDivis

2. Added getMonthIncentives() to get the new incentives/dividend subgraph data

src/store/utils/*.js

  1. Culled most of the logic here, its pretty much all covered by our off-chain math now

src/store/web3/*.js

  1. Added getRPCBlocks() to test/check all RPCs and sort by preference (this can be further improved at some point)

src/utils/extCalls.js

  1. Added subgraph call getSubGraphBlock() to get the subgraphs most recent block (this helps figure out how far behind sync the subgraph is)
  2. The above function is interfaced inside getMemberPositions() so that we can mark down the block relevant to the subgraph positions pulled instead of using the 'current time' which isn't useful
  3. Added subgraph call getPoolIncentives() to grab the most recent 30day rolling dividend/incentives data by pool:
  • Uses Curated pools array to cut down on wasted calls, this means if a pool is removed from Curated its APY will drop down a fair bit as the dividend/incentives data will be ignored (non-issue but worth noting)

src/utils/math/nonContract.js

  1. Fixed SynthVault weight logic bug (unfiltered array used in parallel with filtered array resulting in some wrong weights on occasion)
  2. Updated calcAPY() function:
  • Removed old dividend logic, replaced with the new subgraph supplied data
  • Added a fallback for baseDepth used in this calculation, if a pool has less than 10K SPARTA depth, we use 20K SPARTA as the pool's TVL to calc the pool's APY (prevent ridiculous APYs from showing up on shallow pools)
  • Converted the APR logic into a conservative monthly-compound APY (technically its instant-compounding every txn, but using a more conservative algo will help nerf out any extreme APY percentages & average out IL/asset movements a bit)

src/utils/math/router.js

  1. Fixed bug in 'Swap + Forge Synth' logic where the Synth Cap check was not allowing non-SPARTA users to Forge Synths

src/utils/web3.js

  1. Updated addresses & commit hashes
  2. Updated all RPCS
  3. Added synthHarvestLive const to easily enable all the disabled logic when synth harvest incentives are enabled
  4. Added changeRpcNew() to handle, filter and select the best RPC (with a dash of randomization)
  5. Added router to most masterAbi refs to handle the new Dividend event that didn't exist when this logic was created on testnet (this mostly fixed any recent txn parse issues for the recent txns / history component)

src/utils/web3React.js

  1. Changed all connectors to use dynamic RPC & network (higher probability of using a good RPC)

src/views/pages/Dao/NewProposal.js

  1. Added check for >250K SPARTA depth for proposing a Curated pool (consider bumping this up more)
  2. Hid some proposal types that are irrelevant for the current stage of the protocol
  3. Added tooltip for the proposal fee

src/views/pages/Dao/ProposalItem.js

  1. Changed 'Vote Up' to 'Add Vote'
  2. Changed 'Vote Down' to 'Remove Vote'
  3. Dynamically show one button or the other based on whether the user has already voted for the proposal

src/views/pages/Dao/types.js

  1. Added long description & link to the Docs for every proposal type (this could do with some community input making the words a bit more understandable/clear)

src/views/pages/Liquidity/LiqAdd.js

  1. Added helper to calculate the estimated combined revenue from the asymmetrical add liquidity transaction

src/views/pages/Liquidity/LiqBond.js

  1. Fixed Progress Bar bug (two bars with the same key)

src/views/pages/Liquidity/LiqRemove.js

  1. Added helper to calculate the estimated combined revenue from the asymmetrical remove liquidity transaction

src/views/pages/Liquidity/Overview.js

  1. Added URL-param functionality to navigate to a tab directly via link (this was so we can have CTAs to direct users to Bond specifically but can be used for all tabs on the Liquidity page)

src/views/pages/PU/Overview.js

  1. General cleanup in the PU dashboard
  2. Fixed Cols (multiple cards in a row instead of pushed to next row)
  3. Added a simple RPC status viewer (check which RPCs are best)

src/views/pages/Pools/NewPool.js

  1. Changed min SPARTA input to create a pool to 20K SPARTA

src/views/pages/Pools/Overview.js

  1. Fixed pool count bug based on hidden pools & new pools

src/views/pages/Pools/PoolItem.js

  1. Pulls in the new subgraph dividend/incentives data
  2. Updated APY to hand in that new data
  3. Added Synth Cap visual indicator & tooltip

src/views/pages/Positions/Overview.js

  1. Added block (from subgraph data) to the positions array so that we know how old/new/stale the data is
  2. Added the 'good' RPCs current block for us to compare to
  3. Made the 'wait 60s' button dynamic with a countdown instead
  4. Fixed some Popover incorrect headers

src/views/pages/Swap/SwapPair.js

  1. Pulls in the new subgraph dividend/incentives data
  2. Updated APY to hand in that new data

src/views/pages/Synths/Overview.js

  1. Updated everything to align with the rest of the DApp for mainnet
  2. Added harvest check/confirm
  3. Simplified the confirm switches with tooltips and shorter messages
  4. Added in all the relevant data grabbers
  5. Added helper to calculate the estimated combined revenue from the synth transaction
  6. Added Synth Cap visual indicator & tooltip

src/views/pages/Vaults/BondVaultItem.js

  1. Added direct links to go to the Bond section/tab

src/views/pages/Vaults/Components/SynthHarvestAllModal.js

  1. Added full list of Synths that would be time-locked

src/views/pages/Vaults/Components/SynthHarvestModal.js

  1. Added full list of Synths that would be time-locked

src/views/pages/Vaults/DaoVault.js

  1. Added 'Harvestable' tooltip

GitHub Activity — Spartan Subgraph

/schema.graphql

  1. Fixed MintSynth & BurnSynth double-up names (same key)
  2. Added daily & rolling 30day incentives to MetricsPoolDay

src/mappingDao.ts

  1. Fixed bug causing pool.tokenAmount and pool.totalSupply to go out of sync with each Bond event (commented out as a reminder to not forget and add it back in)

src/mappingPool.ts

  1. Added handleMintSynth() to parse and process all 'Forge Synth' related events
  2. Added handleBurnSynth() to parse and process all 'Melt Synth' related events

src/mappingReserve.ts

  1. Added call to update daily metrics after a realise event

src/mappingRouter.ts

  1. Added call to update daily metrics after a realise event

src/utils.ts

  1. Added logic to handle the 30 day rolling figure
  2. Made some variable names more clear

GitHub Activity — Spartan Site

  1. Removed target="_blank" from all external links

Project Information

  • Website: https://spartanprotocol.org/
  • DApp: https://dapp.spartanprotocol.org/
  • GitBook (Docs): https://docs.spartanprotocol.org/
  • GitHub: https://github.com/spartan-protocol

Community Contribution

Spartan Protocol is at its core, a community-driven and led project. In this vein, the more contributors the better. There is a great opportunity for community members to contribute by making LP reward analysis tools, etc.

Recently, community members have been graciously funnelling in to contribute to explainer articles, ideas and even $SPARTA donations to support the growth of the platform.‌

Binance Smart Chain testnet Faucet

Engage with the community and contributors

Where to find out about all the latest updates or suggest improvements — get involved.