SpartanDev: 11OCT - 17OCT21

Dev Update

SpartanDev: 11OCT - 17OCT21

Spartan Protocol's 2nd week of mainnet V2 is now wrapped up. The DAO is prepared for its next phase to begin, get ready for proposals.

SpartanDev: 11OCT - 17OCT21

TLDR: DAO proposals go live tomorrow, Tuesday the 19th. The contributors will begin the process of testing and enabling around 2.00 AM (GMT)

Community is a core mantra of Spartan Protocol & its shield wall, in line with this ethos and now that the following has been achieved, we can open up the DAO and begin making protocol-changing proposals in a more distributed manner!

  • Mainnet V2 protocol up and running for 2 weeks
  • TVL building steadily with confidence
  • The DaoVault weight is looking strong & distributing further each day

What is a DAO?

Decentralised Autonomous Organisation

DAOs are unlike traditional organisations that have a hierarchical control structure, generally private and inaccessible to a community. Centralised exchanges are an example of this; you might want a token listed on the project's platform, but besides a Twitter barrage, you have very little influence on that decision coming to fruition.

DAOs place the community participants in control of the platform transparently and programmatically. The power of contracts enforced by mathematics means that a large number of automated actions within a contract can be set up and voted on, the results of which will be automatically actioned.

This would mean when applied to the above example; the community would be able to propose and vote on which tokens they want to be listed for 'Bond' for instance. On a successful vote, these tokens would be automatically listed. Resistant to external entities, governments and bad actors getting in the way of that decision.

The community is already familiar with the Spartan Protocol ethos being; ‘birthed by the community, for the community’ with the initial community building the platform the way they wanted to see it within the Binance Smart Chain ecosystem. Chosen for its power, speed and low fees.

Having Spartan Protocol run by a DAO was a central pillar of its development.

If you want to read a little more into DAO’s check out the Binance Academy article below.

Decentralized Autonomous Organization (DAO) | Binance Academy
Decentralized Autonomous Organization | Definition: A system of hard-coded rules that define which actions a decentralized organization will take.

What is best for SPARTA!?

At this point it is super important to reiterate that the community continues to drive SpartanProtocol for the benefit of the community and if you want to join the DAO it is hoped that you join it with the intent to see it succeed, grow and prosper for the LONG TERM.

A focus on proposals that will benefit the platform in the long run, means focusing on things that help it grow, develop and improve reach before focusing on individual benefit. Community value will drive results in individual benefit, it most likely won't work the other way around.

To learn more about the Spartan Protocol take on a Decentralised Autonomous Organisation head over to the SpartanProtocol.org page

Spartan Protocol | DAO Governance on BSC
Spartan Protocol’s incentive token is programmable with multiple incentive streams that the SPARTA community collectively manage through decentralised proposals and voting

Or check out this article for our OG DAO implementation in V1

Spartan Protocol DAO — (Decentralised Autonomous Organisation)
Bond+Mint DAO — Now Live

YES, proposals do include the old fan favourite - 'Bond' - its time......

Bond+Mint on Spartan Protocol
Bootstrapping Liquidity + Initial SPARTA Token Distribution

Wednesday feeBurn Update

It is quite cool to see mainnet live now, watching these numbers grow and the total supply being deflated every time SPARTA moves around.

Spartan Socials - Twitter

Tweet of the Week:

Community Tweet of the Week:

SpartanSocials - Medium

SpartanSocials - Telegram


Contributor's Focus

ONGOING - Continue updating DApp during mainnet ('functional' priority)

COMPLETE  ✅ - Enable the Vault incentives

TOMORROW - Enable the DAO proposals

DAO to manage the Bond program (list assets & release allocations)

IN PROGRESS - Work with aggregators to connect the SPARTA pools

IN PROGRESS - Set up a reliable index of history scoped to contracts (for 'positions' page)

Build a 'positions' page for V2

Post-C4-contest article on the top issues

(Side-Task) — 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

Lending work has restarted with some fresh new ideas that have come about since the V2 refresh began. The current implementation leans towards utilizing our pools & liquidity providers instead of creating a more traditional 'separate pool' market. This brings some POL opportunities & significant potential revenue opportunities for our existing pools/liquidity providers which will also drive more TVL & help harden the goal to provide self-sustaining incentivised liquidity.

As a general explainer, what we might see is something like this:

  • Liquidity providers supply liquidity to the pools & receive LP tokens (just like normal)
  • There is an option for another form of utility for your LP tokens with a LendVault
  • The liquidity provider has a choice between staking them in the DaoVault or LendVault. Each with its own dynamic yield & utility advantages
  • The LP tokens staked in the LendVault will be added to a lending pool ready to be borrowed out by users
  • They can borrow a safe amount of a base asset (BUSD, BNB etc) and provide SPARTA as collateral
  • The LP tokens held in the LendVault are redeemed for the underlying assets, swapped if required (to the chosen asset) and sent to the borrower
  • When the borrower is ready to close their CDP and get their collateral back, they bring the chosen assets back and send in the full amount & receive their collateral minus the interest
  • There will obviously be liquidation opportunities

This implementation provides a lot of potential opportunities for the liquidity providers & therefore the whole ecosystem. It does however make it hard to provide any form of 'single staking' via the Lending contract like some of the previous implementations.

Whilst single-staking would be nice & will continue to be attempted to plug in somewhere in a sustainable protocol-benefitting way, it will not be the #1 priority when designing this lending system.

If single-staking works somewhere in the system, it will be plugged in. If it doesn't or the Lending model requires major nerfing to make it work, it will be pushed to be attempted in another feature instead.

Branch: LendingV1

contracts/Lend.sol

  1. Created new Lend contract
  2. Setup structure and list of likely functions based on current implementation being worked on

contracts/Reserve.sol

  1. Modified Reserve contract with some proposed POL placeholders

contracts/lendRouter.sol

  1. Created new LendRouter contract
  2. Setup structure and list of likely functions based on current implementation being worked on

contracts/lendVault.sol

  1. Created new LendVault contract
  2. Setup structure and list of likely functions based on current implementation being worked on
  3. Padded out lendLP() & removeLP() with some logic, similar to the DaoVault/mappings

GitHub Activity — Spartan DApp v2

Global Changes

  1. Changed the nav structure & urls/routes
  2. Changed the sitemap accordingly
  3. Updated some text/icon colours for lightMode
  4. Added some more injected translation IDs
  5. Forked the Assets repo to manually add token icons
  6. Changed number inputs to have a min of 0

src/components/AssetSelect/AssetSelect.js

  1. Changed the 'wallet type' check to use localStorage (wallet that the user selected) rather than isMetaMask || isTrust
  2. Conditionally show TrustWallet icon if TrustWallet 'wallet type' is detected

src/components/Footer/Footer.js

  1. Removed RecentTxns component from the footer (only commented out; needs to be removed)

src/components/Icons/icons.js

  1. Added TxnsHistory & Trsh icons
  2. Updated ArrowDownUp & ArrowLeftRight icons

src/components/Supply/Supply.js

  1. Added 'loading' states to all supply items

src/components/Tooltip/tooltip.js

  1. Added 3 new tooltips

src/components/WalletSelect/*.js

  1. Changed the 'wallet type' check to use localStorage (wallet that the user selected) rather than isMetaMask || isTrust
  2. Conditionally show TrustWallet icon if TrustWallet 'wallet type' is detected

src/components/WalletSelect/Txns.js

  1. Created component for 'transaction history'
  2. Essentially the same as 'RecentTxns' component from the footer but with the formatting updated and is now located in the wallet modal
  3. Updated the pagination behaviour
  4. Changed the 'ClearTxns' button to a trash icon and added an alert/confirm when clearing

src/components/WalletSelect/WalletSelect.js

  1. Bumped up the setTimeout() in onWalletConnect() to 35 to make this more reliable
  2. Added a 'txns' tab with a 'history' style icon for the transactions history content
  3. Added a 'clear wallet' button if no wallet is connected to clear the local storage item in case a user has corrupted local storage selection for their lastWallet

src/components/WalletSelect/txnTypes.js

  1. Added a Types file for all transaction types (parsed transactions for the 'Txns History' component)

src/routes.js

  1. Culled all the old lines in the routes file
  2. Changed Vault to Vaults
  3. Moved Bond into the Vaults
  4. Changed Overview to Pools

src/store/pool/actions.js

  1. Fixed the newRate / oldRate logic to handle both directions the same

src/utils/math/nonContract.js

  1. Added swapRate helpers for swapping and zapping

src/utils/web3.js

  1. Added blacklist functionality to force a token icon to be the fallback img if it is broken (reactively)
  2. Pointed getTwTokenLogo() to our forked version of the repo instead of TrustWallet's API & repo

src/views/pages/Pools/PoolItem.js

  1. Added a visual pool ratio safety gauge/scale
  2. Added tooltip placeholder explaining the feature (could do with some rewriting/simplifying)

src/views/pages/Swap/Swap.js

  1. Refactored a lot of conditional logic out of the JSX
  2. Added in spot & swap rate logic
  3. Added in slip calc logic
  4. Added in 'revenue' logic inc dividends

src/views/pages/Vaults/BondVault.js

  1. Moved Bond -> BondVault inside the Vaults view

src/views/pages/Vaults/DaoVault.js

  1. Added option to view weights in $USD (click on it to flip back to SPARTA)

src/views/pages/Vaults/Overview.js

  1. Added BondVault

GitHub Activity — Spartan Subgraph

It's time for work to resume on the positions page. Before that, we need a reliable scoped index of relevant data from the chain. Makes sense to at least initially do this with the help of a subgraph

subgraph.yaml

  1. Flipped the network over to bsc (mainnet)
  2. Updated the poolFactory contract address
  3. Updated the startBlock to the deployment blockstamp
  4. Updated the eventHandlers to match the new events

src/const.ts

  1. Updated relevant contract & token addresses
  2. Updated array of stablecoins

src/mapping.ts

  1. Made init value of SPARTA $0.60 for the first blocks before the BUSD pool takes over for internal pricing

src/mappingPool.ts

  1. Removed the 'create pool' logic in handleAddLiquidity() now that the events are emitted in an order that suits the subgraph
  2. Fixed the wrong logic for member.liqNetUSD
  3. Added sync() at the end of the swap event to ensure pool balances are synced for internal subgraph pricing (dividends aren't accounted for via any events so a sync needs to be performed instead)

src/utils.ts

  1. Changed updateSpartaPrice() to only use stablecoin pools with at least 100K SPARTA depth
  2. Changed sync() to only check for baseAmount to account for dividends

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.