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!
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:
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!
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
- Added WBNB address (for wrap/unwrap logic)
- Added new variables for handling new diversification features
- Added
onlyDao
modifier to potentially allow the DAO to handle some of the new logic - Added
RealisePOL
event to ensure subgraph stays in sync - Added
receive
function to handle contract receiving unwrapped BNB - Added
setParams()
to handle changing the pool in focus for diversification - Added
setPOLParams()
to handle regulating the diversification and realise - 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 - 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) - Added
realisePOL()
function to essentially 'burn' a portion of the diversified LP tokens, funnelling the underlying redemption value down the liquidity providers - Added
flipPol()
to easily switch on/off the diversification logic - Added
addPOL()
which handles checking of conditions and the size of the diversification event
contracts/Router.sol
- Added an adjustable
minDiv
variable to regulate the min size of a dividend - Added
Dividend
event to ensure subgraph stays in sync - Added
onlyRESERVE()
modifier - Changed
_getsDividend()
to check/use the newminDiv
amount - Changed
_addDividend()
to emit the newDividend
event at the end - Changed
changeDiviClaim()
to also set theminDiv
(also added a sanity check to ensure a wei amount is not accidentally used) - 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)
- Creates & Curates pools
- Adds liquidity & swaps (generate LPs)
- Realises non-BNB LPs
- Realises BNB LPs (test wrap/unwrap)
- Forges & Melts synths
- Deposits & withdraws SynthVault
- Harvests
GitHub Activity — Spartan DApp v2
src/components/PoolSelect/PoolSelect.js
- Added a pool search / select modal
src/components/Sidebar/SidebarLg.js
- Added a desktop-optimized sidebar
src/components/Supply/Supply.js
- Changed
getCirculatingSupply()
to account for Reserve-held LPs - Conditionally load the component to reduce calls overhead (only make the calls if the user clicks the supply dropdown)
src/components/WalletSelect/LPs.js
- Change
getUSD()
based oncalcLiqValueInBase
changing tocalcLiqValueIn
- Refactor
getTotalValue()
using newcalcLiqValueAll()
src/components/layout/Common.js
- Added in new
<SidebarLg/>
component (desktop optimized sidebar)
src/routes.js
- Added in
Positions
route
src/store/reserve/*.js
- Added
getReservePOLDetails()
and other relevant variables/items to retrieve the Curated LP token holdings on the Reserve
src/utils/math/nonContract.js
- Changed
calcLiqValueInBase()
tocalcLiqValueIn()
now returning both thespartaValue
&&usdValue
- Added
calcLiqValueAll()
to return the total spot value of all liquidity by user/wallet inspartaValue
&&usdValue
- Added
getPOLWeights()
to help get the SPARTA value of Reserve held LP tokens
src/utils/math/router.js
- Added
minDivi
to handle things similar to the Router contract - Adjusted every dividend calculation to account for
minDivi
src/utils/web3.js
- Updated addresses
- Changed
ethers.providers.JsonRpcProvider
toethers.providers.StaticJsonRpcProvider
to cache the chainId and reduce calls
src/views/pages/Dao/Overview.js
- Fixed
isLoading
bug - Fixed 'current' view/tab to only display the most recent proposal if it is still open
- Put
noOpenProposalsInfo
section into its ownCard
element
src/views/pages/Donate/Overview.js
- Fixed the progress bar length/proportions
src/views/pages/Liquidity/LiqBond.js
- 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
- Made the buttons a more neutral colour
- Fixed the filter for new pools to not show on the main tab
src/views/pages/Pools/PoolItem.js
- Made the buttons a more neutral colour
- Conditionally show the 'stake' button only on Curated pools (instead of disabling on non-Curated)
src/views/pages/Pools/SummaryItem.js
- 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
- Added a positions page with each scope in a separate tile
- When complete, merge each pair into their own with a button to switch scopes
- At the moment it just adds dummy data to local storage and then calls/parses from there
- 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
- 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
- Added a check for whether 'Synths Minting' is enabled & show the state accordingly
src/views/pages/Vaults/Components/SynthHarvestModal.js
- Added a check for whether 'Synths Minting' is enabled & show the state accordingly
src/views/pages/Vaults/DaoVault.js
- Removed test Reserve logic
GitHub Activity — Spartan Subgraph
/schema.graphql
- Added incentives/revenue tally to the
Pool
scope - Added
netAdd
to theMember
scope - Added
netRemove
to theMember
scope - Added
netHarvest
to theMember
scope - Added
Harvest
&Bond
&Position
toMember
scope - Created
Position
entity (scoped toMember
/Pool
) - Added
Harvest
&Bond
toTransaction
scope - Removed
derivedSparta
fromLiqAdd
&LiqRemove
(probably only really need these for theMember
scope - Created
Harvest
entity (scoped toMember
/Transaction
) - Created
Bond
entity (scoped toMember
/Pool
/Transaction
)
src/const.ts
- Added
preDiviEventCurateds
to handle static array of Curated pool addresses up until the dynamic logic kicks in
src/mappingDao.ts
- Added Dao contract handlers
- Added
handleHarvest()
to parse and update based onHarvest
events - Added
handleBond()
to parse and update based onDepositAsset
events
src/mappingPool.ts
- Adjusted
handleAddLiquidity()
to check if it's the first liqAdd and if so add thefee
amount on top to ensure the total supply is always in sync - Handle updating all the new variables from the schema
- Add a
sync()
call inhandleSwapped()
conditionally if the block number is before theDividend
event existed and if the swapped pool was Curated at the time
src/mappingReserve.ts
- Added
handleRealisePOL()
to handle the Realise event (keep pools in sync)
src/mappingRouter.ts
- Added
handleDividend()
to handle theDividend
event
src/utils.ts
- Updated all entity check/creations to ensure all added/removed schema is accounted for
/subgraph.yaml
- Added in all the contracts and Entities relevant to the logic added for new events
GitHub Activity — Spartan Site
General
- Updated code of conduct
- Swapped out the header logo for the new v2 one
- Adjusted the button colour in header
- Minor style adjustments
- Fixed spelling mistake on front page
- Updated the favicon to v2
- Minor text/copy changes throughout
Project Information
Official Links
- 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.
- Medium: https://medium.com/spartanprotocol
- Twitter: https://twitter.com/spartanprotocol
- Telegram Community: https://t.me/spartanprotocolorg
- Telegram Announcements: https://t.me/spartanprotocolann
- Discord Academy: https://discord.gg/wQggvntnGk