SpartanDev: 25OCT - 31OCT21

Dev Update

SpartanDev: 25OCT - 31OCT21

Another week of solid contributions from the Spartan community! Increased pool revenue, diversified Reserve, Bond allocation imminent, new security partner? Read up!

SpartanDev: 25OCT - 31OCT21

Summary

Yet another week of solid progress from the contributors at Spartan Protocol.

  • Contracts continue to be enhanced to ensure liquidity providers continue to receive greater dividend and overall revenue injections
  • Reserve has begun diversifying into Liquidity Provision
  • Final stages of organising a new Security Partner is in progress
  • Bond allocation (our first since V2 Launch) is imminent
  • Positions page & subgraph have continued to march forwards... the list goes on, so let's quickly go over a few of them and move back to BUIDL!

Security Partner

Our Spartans have been busy behind the scenes with a continued focus on providing a secure DeFi experience, before, during, and post-launch. Whilst the initial plan was to launch V2 with an independent bug bounty program (self-hosted by Spartan Protocol), this idea has really transformed from discussions with the Binance team & the Spartan Protocol community since then. As a community project, we have taken this on-board and are happy to announce that Spartan Protocol is in the final stages of securing an amazing security partner for the all-important ongoing V2 bug bounty.

Keep your eyes peeled for an update on this soon!

Pool Revenue

The Dividend logic has been fine-tuned and ramped up now that the pools have had a chance to settle and stabilise.  Dividends in the Curated pools will now be more frequent and on-average larger now, this should be represented by more SPARTA revenue being injected in the pools, and this will only become more apparent once aggregators start connecting to the pools and increasing swap activity. It is in the best interests of Spartan Protocol to continue to work with the variables to provide the best ratio between efficient and lucrative.

Bond

Well done DAO-Spartans! We have successfully proposed and listed $BNB & $BTCB for the Bond program, and now we have a proposal for our first Bond allocation ready to be finalised within the next 12 hours! Make sure you get prepared and read up on the Bond program here:

Bond - Spartan Protocol
Bond: a Spartan Protocol liquidity-bootstrapping pool option.

Positions Page

Our front-end contributors have been putting continued focus into the Subgraph & Positions logic recently and now have the Subgraph in a fairly final 'positions' state to be plugged in and utilized. Subgraph, if you are not aware, allows for more detailed chain analytics to be performed and referenced by the dApp.

This week saw 4 'states/scopes' built into a 'Positions' page, and most of the required logic implemented, except for the API calls to the Subgraph. This week, the plan is to connect the Subgraph and commence internal testing by the contributors to lead to a basic/simple public Positions page to be iterated upon.

With a Bond allocation releasing this week, there will be a focus for the front end contributors on adjusting any functional Bond-related quirks that may show up, with focus again being on the Positions page after that. If you do Bond, and you see some front-end issues, reach out in Telegram or raise an issue directly in Github, and the front-end devs will jump onto it for you.

Also on the cards is a focus on the colour scheme and general style of the DApp, we are finally getting to a stage where the 'visual' side of things becomes the next priority, which is a great position (pardon the pun) to be in. Looking forward to seeing what this, and other community DApps, transform into over the coming months.

Happy Halloween - a.k.a - Happy 13th Bitcoin White Paper Day

No one knows why Satoshi released the white paper on a spooky day, but we have to say that we love it. 13 years on, Halloween holds extra meaning to the crypto-verse around the globe, so thankyou Satoshi.

We will have a read while chewing into copious amounts of candy today!!! Happy Halloween!

Bitcoin: A Peer-to-Peer Electronic Cash System

Wednesday feeBurn Update

As the use of SpartanProtocol V2 increases, so does the feeBurn rate of $SPARTA.

Spartan Socials - Twitter

Tweet of the Week:

Community Tweet of the Week:

SpartanSocials - Medium

SpartanSocials - Telegram


Contributor's Focus

ONGOING - Continue updating DApp

COMPLETE  ✅ - Enable the Vault incentives

COMPLETE  ✅ - Enable the DAO proposals

COMPLETE  ✅ - DAO to list Bond assets

COMPLETE  ✅ - Update Reserve to diversify into LPs

COMPLETE  ✅ - Set up initial Subgraph (for positions & some global metrics)

IN PROGRESS - Build a 'positions' page for V2

IMMINENT - DAO to release first Bond allocation

IN PROGRESS - Work with aggregators to connect the SPARTA pools

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

contracts/Reserve.sol

  1. Added WBNB address (for wrap/unwrap logic)
  2. Added new variables for handling new diversification features
  3. Added onlyDao modifier to potentially allow the DAO to handle some of the new logic
  4. Added RealisePOL event to ensure subgraph stays in sync
  5. Added receive function to handle contract receiving unwrapped BNB
  6. Added setParams() to handle changing the pool in focus for diversification
  7. Added setPOLParams() to handle regulating the diversification and realise
  8. The diversification event piggybacks the grantFunds() function, so any time there is any SPARTA leaving the reserve, the conditions are checked and if met, a diversification event happens
  9. Added grantPOLFunds() for easier Reserve migration/upgrade (and to potentially allow LPs paid out as incentives, later on, however, it already can 'burn' the LPs absorbing their value to the underlying LPers so this shouldn't really be required)
  10. Added realisePOL() function to essentially 'burn' a portion of the diversified LP tokens, funnelling the underlying redemption value down the liquidity providers
  11. Added flipPol() to easily switch on/off the diversification logic
  12. Added addPOL() which handles checking of conditions and the size of the diversification event

contracts/Router.sol

  1. Added an adjustable minDiv variable to regulate the min size of a dividend
  2. Added Dividend event to ensure subgraph stays in sync
  3. Added onlyRESERVE() modifier
  4. Changed _getsDividend() to check/use the new minDiv amount
  5. Changed _addDividend() to emit the new Dividend event at the end
  6. Changed changeDiviClaim() to also set the minDiv (also added a sanity check to ensure a wei amount is not accidentally used)
  7. Added syncPool() to ensure the Reserve is able to attribute the LP token value to the LPers during a 'realise' event

test/6_POL.js (Automated testing for diversification logic)

  1. Creates & Curates pools
  2. Adds liquidity & swaps (generate LPs)
  3. Realises non-BNB LPs
  4. Realises BNB LPs (test wrap/unwrap)
  5. Forges & Melts synths
  6. Deposits & withdraws SynthVault
  7. Harvests

GitHub Activity — Spartan DApp v2

src/components/PoolSelect/PoolSelect.js

  1. Added a pool search / select modal

src/components/Sidebar/SidebarLg.js

  1. Added a desktop-optimized sidebar

src/components/Supply/Supply.js

  1. Changed getCirculatingSupply() to account for Reserve-held LPs
  2. Conditionally load the component to reduce calls overhead (only make the calls if the user clicks the supply dropdown)

src/components/WalletSelect/LPs.js

  1. Change getUSD() based on calcLiqValueInBase changing to calcLiqValueIn
  2. Refactor getTotalValue() using new calcLiqValueAll()

src/components/layout/Common.js

  1. Added in new <SidebarLg/> component (desktop optimized sidebar)

src/routes.js

  1. Added in Positions route

src/store/reserve/*.js

  1. Added getReservePOLDetails() and other relevant variables/items to retrieve the Curated LP token holdings on the Reserve

src/utils/math/nonContract.js

  1. Changed calcLiqValueInBase() to calcLiqValueIn() now returning both the spartaValue && usdValue
  2. Added calcLiqValueAll() to return the total spot value of all liquidity by user/wallet in spartaValue && usdValue
  3. Added getPOLWeights() to help get the SPARTA value of Reserve held LP tokens

src/utils/math/router.js

  1. Added minDivi to handle things similar to the Router contract
  2. Adjusted every dividend calculation to account for minDivi

src/utils/web3.js

  1. Updated addresses
  2. Changed ethers.providers.JsonRpcProvider to ethers.providers.StaticJsonRpcProvider to cache the chainId and reduce calls

src/views/pages/Dao/Overview.js

  1. Fixed isLoading bug
  2. Fixed 'current' view/tab to only display the most recent proposal if it is still open
  3. Put noOpenProposalsInfo section into its own Card element

src/views/pages/Donate/Overview.js

  1. Fixed the progress bar length/proportions

src/views/pages/Liquidity/LiqBond.js

  1. Added Harvest confirm/warning to the Bond component (all this harvest logic can probably be refactored into its own component and replaced everywhere it is used)

src/views/pages/Pools/Overview.js

  1. Made the buttons a more neutral colour
  2. Fixed the filter for new pools to not show on the main tab

src/views/pages/Pools/PoolItem.js

  1. Made the buttons a more neutral colour
  2. Conditionally show the 'stake' button only on Curated pools (instead of disabling on non-Curated)

src/views/pages/Pools/SummaryItem.js

  1. Added the new pool filter / select / search component here. Should probably grab the logic and put it directly on this page at some point to inline search/filter the pools list

src/views/pages/Positions/Overview.js

  1. Added a positions page with each scope in a separate tile
  2. When complete, merge each pair into their own with a button to switch scopes
  3. At the moment it just adds dummy data to local storage and then calls/parses from there
  4. Most of the maths are done / ready, just need to pull in the subgraph calls and be careful about how often users can call it etc

src/views/pages/Swap/Swap.js

  1. Removed the Synths logic from the swap page (was a cool idea and will probably come back later on, but for now it just clogs the UI for users trying to swap) users can use the normal 'Synths' page for this until this component has a refresh

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

  1. Added a check for whether 'Synths Minting' is enabled & show the state accordingly

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

  1. Added a check for whether 'Synths Minting' is enabled & show the state accordingly

src/views/pages/Vaults/DaoVault.js

  1. Removed test Reserve logic

GitHub Activity — Spartan Subgraph

/schema.graphql

  1. Added incentives/revenue tally to the Pool scope
  2. Added netAdd to the Member scope
  3. Added netRemove to the Member scope
  4. Added netHarvest to the Member scope
  5. Added Harvest & Bond & Position to Member scope
  6. Created Position entity (scoped to Member / Pool)
  7. Added Harvest & Bond to Transaction scope
  8. Removed derivedSparta from LiqAdd & LiqRemove (probably only really need these for the Member scope
  9. Created Harvest entity (scoped to Member / Transaction)
  10. Created Bond entity (scoped to Member / Pool / Transaction)

src/const.ts

  1. Added preDiviEventCurateds to handle static array of Curated pool addresses up until the dynamic logic kicks in

src/mappingDao.ts

  1. Added Dao contract handlers
  2. Added handleHarvest() to parse and update based on Harvest events
  3. Added handleBond() to parse and update based on DepositAsset events

src/mappingPool.ts

  1. Adjusted handleAddLiquidity() to check if it's the first liqAdd and if so add the fee amount on top to ensure the total supply is always in sync
  2. Handle updating all the new variables from the schema
  3. Add a sync() call in handleSwapped() conditionally if the block number is before the Dividend event existed and if the swapped pool was Curated at the time

src/mappingReserve.ts

  1. Added handleRealisePOL() to handle the Realise event (keep pools in sync)

src/mappingRouter.ts

  1. Added handleDividend() to handle the Dividend event

src/utils.ts

  1. Updated all entity check/creations to ensure all added/removed schema is accounted for

/subgraph.yaml

  1. Added in all the contracts and Entities relevant to the logic added for new events

GitHub Activity — Spartan Site

General

  1. Updated code of conduct
  2. Swapped out the header logo for the new v2 one
  3. Adjusted the button colour in header
  4. Minor style adjustments
  5. Fixed spelling mistake on front page
  6. Updated the favicon to v2
  7. Minor text/copy changes throughout

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.