SpartanDev: 06DEC21 - 12DEC21

Dev Update

SpartanDev: 06DEC21 - 12DEC21

Another big week with 1inch completing the integration of the SpartaV2 pools, DEX swap volume booming & some serious progress in the various Sparta repos

SpartanDev: 06DEC21 - 12DEC21

1inch Integration

Some very welcome news near the dawn of the week (#TuesdayNewsday) was that 1inch Network finalised the integration of the Spartan Protocol V2 pools & SPARTAv2 token as a routable asset.

Now when you swap on 1inch with the BSC network selected, your assets may route through a Spartan pool behind the scenes to make your swap happen. This brings some obvious growth in terms of swap volume which increases pool revenue leading to increased demand to provide liquidity to the pools which further improves the swap rate through the pools in turn again increasing swap volume and so on in a circular loop.

With Spartan Protocol being exactly that (a protocol) this was a good first step with having our first network connect to the protocol and begin to unlock the potential of these liquidity pools to the outside world. Now we should look to continue this with more networks (accessibility) and increase our TVL to make the pools more efficient and likely to be used (activity).

A big thanks to 1inch for being the first to make this happen not only for V2 but also V1 back in the day!

DEX Swap Volume Increase

Despite the market being completely flat in terms of volatility (worst conditions for swap volume), the 1inch integration has shown signs that it has at least doubled our swap volume through the protocol's pools and more than doubled our daily swap count.

This instant boost was a surprise to most due to the low TVL, it was expected to require a drive for more TVL before seeing the benefits, but served as a timely reminder and testament to the design choices of the Spartan Protocol pools (more on that below)

Viable Route on Aggregators

The liquidity sensitive fees that the Spartan pools provide have proven to give our young, low-TVL pools a punch well above their weight. Visiting 1inch and performing a reasonable swap-size between any of our listed assets often at least involves one of our pools (sometimes 2 or more in the one swap!) despite our TVL being in the early stages. We are far from showing up 100% of the time, especially for the whale-sized trades, but this will only further improve as pools get deeper.

Liquidity Sensitive Fees

As TVL grows in a pool, the rate for a swap improves with it. Our fees trend towards zero whereas AMMs typically use a fixed-fee model (on top of the slip rate) which means their swap fee is always the same for a determined swap size regardless of pool depth.

Our model not only helps hinder pool manipulation by making the cost of an attack scale exponentially the larger the manipulation but also means the deeper the pool, the more likely it will be a better rate than the other AMMs. Also if the swapper is in a rush to swap their full amount (usually an arbitrageur), they share more of the arb opportunity with the liquidity providers providing more circular benefit to all good peers involved.

New #LearnToEarn Quiz

Congratulations to last weeks winners of the #FridayFor300 #LearnToEarn quiz! A new quiz is up and a little bit easier this time:

  • "List two ways you can earn yield inside the Spartan Protocol ecosystem"

To enter, simply go to the tweet and quote-retweet it with your answer. Make sure you are following @SpartanProtocol on Twitter too. 3 winners will be randomly selected from the quote retweets later this week.

New DOT Pool Listed

As we should all know by now, token listings in Spartan Protocol are done by the community. Anyone can list a pool whenever they like! Well, this week a Spartan listed a $DOT (Polkadot) | $SPARTA pool and proceeded to add enough liquidity to almost hit the initial pool's liquidity cap.

The pool has only been up for less than 2 days so it's hard to gauge at this time, but it appears to be similar in swap demand to the AVA pool so will likely be a good, viable pool ongoing.

DOT Pool #OpenTheGates

Not long after listing, the $DOT pool reached the liquidity caps and its swap history was fortunately easy to assess quickly and have the caps promptly doubled to let in more liquidity.

Spartan Socials - Twitter

Community Tweet of the Week:

SpartanSocials - Medium‌

SpartanSocials - Telegram


Contributor's Focus

COMPLETE  ✅ - Connect SPARTAv2 pools to 1inch

COMPLETE  ✅ - Extend the pool-scoped charting/analytics in DApp

IN PROGRESS - SPARTA<>Bram NFTs

IN PROGRESS - Setup simple token supply API

IN PROGRESS - Connect SPARTAv2 pools to other aggregators

IN PROGRESS - Create a UI material library to revamp the DApp

Overhaul website/landing page into a 1-pager with a more call-to-action focus


GitHub Activity — Spartan <> Bram NFTs

GitHub - spartan-protocol/spartan-nfts-bram-01: 🎭 Spartan Protocol NFTS 01: the Bram Vanhaeren Collection (https://twitter.com/BramVanhaeren)
🎭 Spartan Protocol NFTS 01: the Bram Vanhaeren Collection (https://twitter.com/BramVanhaeren) - GitHub - spartan-protocol/spartan-nfts-bram-01: 🎭 Spartan Protocol NFTS 01: the Bram Vanhaeren Collec...

New NFT Contracts to the ERC-721 Standard

The ECR-1155 standard appears to not be well supported/integrated with the BSC ecosystem yet. BSCScan does not appear to handle them as Etherscan does, most BSC NFT marketplaces have little to no support.

Therefore, decided to rewrite to ERC-721 standard for that reason, even though the type of NFTs we are doing are more suited to ERC-1155

Disadvantages of ERC-721:

  • Much higher gas costs to mint and transact (thank god we are on BSC!)
  • Much-much-much more difficult handling the URIs, need to make a separate URI for every single NFT unit that's minted (300 URIs) instead of for each variation (20 URIs)
  • Need to create a separate contract for each NFT type (6 contracts vs 1)
  • For the reasons above, we will opt to have a centralised server handle the URIs instead of IPFS (less decentralised, more work, more infrastructure)
  • Changing/updating URIs need to be done individually
  • In general, it's just a lot more work, but probably the way forward!

Advantages of ERC-721:

  • Whilst ERC-1155 is widely accepted now on Ethereum, BSC is lagging and not looking as positive, so a big advantage is that we know these NFTs will have wider acceptance
  • They 'feel' more unique and 'non-fungible' especially with the unique JSONs, which means we can add a '1/300' type of property to be listed via the metadata

To Do:

Reproduce the ERC-721s for each edition · Issue #1 · spartan-protocol/spartan-nfts-bram-01
Get the ALEX-721 contracts completed Replicate for ANAX Replicate for CLEO Replicate for LACE Replicate for LEON
Create custom Athena ERC-721 contract · Issue #2 · spartan-protocol/spartan-nfts-bram-01
Create a special edition &#39;Athena&#39; contract with no pre-mint Make sure it has a batch mint script though Maybe even with an array of addresses so they can be batch minted to different users?...
Create all 300 URIs for the NFTs metadata · Issue #3 · spartan-protocol/spartan-nfts-bram-01
Create all 300 URI json files for the NFTs to link to Use IPFS for the images and verify them all) This will be done manually by Samus unless someone has time to create a python script Follow forma...
Create a server to hold the URIs · Issue #4 · spartan-protocol/spartan-nfts-bram-01
Spin up a simple server to hold the NFTs URIs Could use https://nfts.spartanprotoco.org with a subfolder like ./URIs/ Or im now leaning towards making it completely siloed like https://uris.spartap...
Create a custom batchURI update function · Issue #5 · spartan-protocol/spartan-nfts-bram-01
With the change to ERC-721, the URIs being updated if ever required will be a bit of a headache, with that said we might be able to do this: Create 4 functions per contract, something like batchUpd...
Deploy to mainnet | Verify details · Issue #6 · spartan-protocol/spartan-nfts-bram-01
Deploy to mainnet Verify contract details Verify qtys & balances Verify metadata for each ID Verify metadata on contract level

GitHub Activity — Spartan Subgraph

GitHub - spartan-protocol/spartan-subgraph: 🏃‍♀️ Spartan Protocol Subgraph
🏃‍♀️ Spartan Protocol Subgraph. Contribute to spartan-protocol/spartan-subgraph development by creating an account on GitHub.

Added Vault APY Metrics

The DaoVault & SynthVault APY's can be generated based on their total SPARTA weight vs the amount of SPARTA value harvested in a rolling period.

So some metrics were added to the subgraph to tally these figures:

  • SynthVault harvested (daily)
  • DaoVault harvested (daily)
  • SynthVault harvested (rolling 30 days)
  • DaoVault harvested (rolling 30 days)

This means adding some bloat to the already struggling subgraph, but it seemed okay, synced back up after a few days.


GitHub Activity — Spartan UI Library

GitHub - spartan-protocol/spartan-ui-library: ⚙ Spartan Protocol Community UI Components
⚙ Spartan Protocol Community UI Components. Contribute to spartan-protocol/spartan-ui-library development by creating an account on GitHub.

Initial Setup of Repo

A decision was made to move over to a new repo to handle the 'new DApp style' in a slightly different way from previous plans. This new repo will handle the UI components and some style/structure aspects that can be brought into any community DApp in the future with the style being consistent.

This is really the next stage to creating community libraries that can be used by other Spartans looking to extend the ecosystem.

This first stage was just setting up a bit of a base for contributors to build off. We had a Spartan ready to work on this for the next 2 weeks which has fallen through unfortunately so this will fall back on Jacobo & Samus to work on for now, but anyone interested in helping out please reach out.

Done:

  • Setup init structure and .gitignore
  • Brought over the existing Icons component from the DApp including all the SVGs
  • Setup a colors const file with branding & theme colours + gradients
  • Setup dark mode & light mode interface files to grab all the relevant components and variables based on the theme selected
  • Setup a utils const file with a bunch of helpful CSS rules (breakpoints, shadows, zIndex etc)

To Do:

Create Major Theme Components #01 · Issue #1 · spartan-protocol/spartan-ui-library
Header Sidebar Desktop Sidebar Mobile Footer (Optional) Main/Wrapper Layout
Create General Components #02 · Issue #3 · spartan-protocol/spartan-ui-library
Button Card Checkbox (Form Select) Icon Progress Bar Radio (Form Select) Spinner (Loading animation) Table Tooltip
Create Header Modules #03 · Issue #2 · spartan-protocol/spartan-ui-library
Dark/Light theme switcher Language dropdown Wallet modal Contracts dropdown

GitHub Activity — Spartan DApp

GitHub - spartan-protocol/SpartanProtocol-DAppV2: 📱 Spartan Protocol Community DApp
📱 Spartan Protocol Community DApp. Contribute to spartan-protocol/SpartanProtocol-DAppV2 development by creating an account on GitHub.

Simplified Network Helper Functions

  • changeNetworkLsOnly() reduced to 1 argument with the network return object simplified to just chainId
  • changeNetwork() reduced to 1 argument with the network return object simplified to just chainId
  • getNetwork() removed arguments, no longer use rpcUrls
  • Changed all instances of the above 3 functions throughout the codebase to not hand in the removed arguments

Updated Supply Dropdown Component

Updated the hardcoded Bond distribution tally to match the newly released Bond allocation. This is only used to represent the share of distribution methods visually in the progress bar.

Updated Donations Page

With the 100K SPARTA DAO grant going into the community wallet seemed like a good time to update the donations page to be a bit more generic. The AMA donations have been refunded pending finding community members to host the event. Until then, the AMA event has moved down the list on the donations page.

  • Updated the text used in the general section
  • Updated the 'current campaigns' to include the marketing/Edu fund + Friday quizzes
  • Changed the visual gauge to just list the token balances in the community wallet instead of a USD target/gauge

Added TimeOut to RPC Checks

There was an issue with some RPCs recently that didn't result in a fail nor timeout when an RPC was called, holding up the entire DApp sometimes. This is very odd and unexpected behaviour from an RPC call, but a solution was added.

Now when the entire list of RPCs do a Promise.allSettled() if there is a lagging RPC, it will timeout after 3 seconds even if it hasn't yet failed or succeeded. This actually helps even with filtering out lagging RPCs that are up to date with the current block.

This may present an issue when there are global RPC issues though, maybe all RPCs are working but taking longer than 3s to respond (essentially makes the dapp unusable anyway, but still). We can act reactively if that ever comes about (OR: maybe just add a fallback to trying to use rpc[0] in the event that all RPCs are BAD ?)

Added Check Resolve Helper

Added a helper to utils to check the status of a Promise.allSettled() item and return value or error message

Added a Synth Vault APY Helper

Added a helper to calculate the SynthVault APY specifically. Previously we used an APY calc function for all APY calculations but the SynthVault needs its own

Extended Metrics / Charting:

  • Added a dropdown selector to the 'Liquidity' page to change the chart's scoped metrics
  • Updated the titles and text labels of all charts
  • Added a 'swap demand' metric + chart which pins the swap volume against the pool's depth. This helps us visually gauge a rough TVL-weighted swap demand of each pool.
  • Added a data point for the 'current externally derived' TVL to the pool-scoped and global-scoped TVL charts
  • Added a 'swap volume' chart scoped by the pool

Extended PU Page

  • Added an 'others' tab to the PU page for any extra variables that aren't helpful in the general dapp but might be helpful to quickly view without calling the contracts. Added stirStamp and synthCap as placeholders here for now, not sure what variables would be good to add here yet
  • Added a 'reserve' page to assess the reserve holdings without having to go to BscScan. Added some random metrics in a table as placeholders for whatever this component ends up being

To Do:

Use SynthVault + DaoVault harvest tallys for APYs · Issue #646 · spartan-protocol/SpartanProtocol-DAppV2
Previous Issue (Kept for relevance to comments): Be conscious of keeping the pool items uniform in height even if they are different types (ie. curated pools don&#39;t have synths so we either need...
RPC Checks | Add fallback to rpc[0] · Issue #659 · spartan-protocol/SpartanProtocol-DAppV2
src/store/web3/actions.js getRPCBlocks() Just before pushing the list of resolved RPCs, but BEFORE it gets sorted by &#39;block&#39;: Count how many of the RPCs are &#39;good&#39; If the count is =...
Help Contribute Extra Info to the DApp! · Issue #527 · spartan-protocol/SpartanProtocol-DAppV2
How to make suggestions for &#39;extra info&#39; in the DApp: Please comment on this issue in the following format: Component/Page: Name of component; or your best attempt at describing the area fo...
Help Contribute to Language / Translations! · Issue #513 · spartan-protocol/SpartanProtocol-DAppV2
Remember this is a community project; the original base translations are from Google Translate and obviously omit perspective &amp; accuracy. The structure has been placed for us (the community) to...

GitHub Activity — Resources

  • Added a SPARTAv2 Santa token icon for the socials (HAPPY HOLIDAYS!)

GitHub Activity - Spartan Site

GitHub - spartan-protocol/spartan-site: 🕸 Spartan Protocol Community Website
🕸 Spartan Protocol Community Website. Contribute to spartan-protocol/spartan-site development by creating an account on GitHub.

Well, we have almost come full circle through the first phase of big projects that needed completing since the V2 mainnet launch. Almost ready to begin phase 2 which involves making the DApp prettier and launching some NFTs etc (see above) but before we embark on that exciting adventure, the last and arguably one of the most important tasks for phase 1 needs to be tackled.

The landing page/website that we have now was built as a solution to having a nice all-in-one website to cover education, info, and navigation to the DAppV1 (back then) and any other websites or socials relevant for the phase of V1 that we were in.

Now that we have decent documentation being built out, the website can proceed to become what it really should be, a simple one-pager designed to receive the user and send them swiftly where they want to go. Whether that is a particular part of the DApp or a section of the docs, this phase aims to do exactly that.

A lot of the bloated text content can be ripped out in this phase and we no longer need separate 'pages', just a simple one-pager, with a section for each feature of the protocol or wider community ecosystem. Each section will feature some kind of punchy text explaining the benefits provided by a feature along with probably two CTA buttons directing the user to the DApp or the docs depending on why they were on the website in the first place.

One thing to note is that by removing a lot of this textual content, we will drop down somewhat in terms of Google visibility in search results. However, of the visitors we do capture, the conversion rate is much likely to trend higher than the current website that gets more outdated every day.

To Do:

Build new landing page (one-pager) · Issue #70 · spartan-protocol/spartan-site
Phase 01: Create new branch for this phase Select a headless CMS Build header, footer and nav Create a templated section (hero -&gt; features -&gt; CTA?) Use templated section for each feature of t...

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.