Sushiswap - Top Kashi Pairs III

    - Find the top 5 kashi pairs based on: A- The number of loans they have generated B- The total available for lending (in USD) C- Total collateral deposited (in USD)

    Kashi Pairs

    • Kashi Pairsis a masterContract for BentoBox that provides functionality for supplying an asset, borrowing that asset by supplying capital, and links to an oracle for the exchange rate.

    What is Kashi?

    • Kashi is a lending and margin trading platform, built on the BentoBox, that allows for anyone to create customized and gas-efficient markets for lending, borrowing, and collateralizing a variety of DeFi tokens, stable coins, and synthetic assets. Kashi's broad diversity of tokens is supported through the use of a unique isolated market framework. Unlike traditional DeFi money markets where high-risk assets can introduce risk to the entire protocol, in Kashi, each market is entirely separate (similar to the Sushiswap DEX), meaning the risk of assets within one lending market has no effect over the risk of another lending market.
    db_img

    Kashi Pairs Functions

    • init, accrue, _isSolvent, updateExchangeRate, _addTokens, addCollateral, _removeCollateral ,removeCollateral, _addAsset, addAsset,_removeAsset, removeAsset, _borrow, borrow, _repay, repay, _bentoDeposit, _bentoWithdraw, _call, cook, liquidate, withdrawFees, setSwapper, setFeeTo

    1 ---> The number of loans they have generated

    KshiPair format

    • The Kashi Pairs format is [km%collateral/asset]
    • collateral is an asset against which another asset is borrowed

    Description of work

    • In this bounties, we are going to Find the top 5 kashi pairs based on:
      • a: The number of loans they have generated
      • b: The total available for lending (in USD)
      • c: Total collateral deposited (in USD)
      • In the [ethereum_core.fact_event_logs table], there are 6 events for kashi on Bentbox that include the following:
      • LogAddCollateral, LogRemoveCollateral, LogAddAsset, LogRemoveAsset, LogBorrow, LogRepay
      • We use the LogBorrow and LogRepay for find 5 top ksshi based on number of loans user address have generated
      • To do this, use the Bentobox address in the [ethereum_core.fact_event_logs] table and the `[event_name = 'LogDeploy'] condition
      • BentoBox contract address is 0xf5bce5077908a1b7370b9ae04adc565ebd643966
    db_img
    • In this section:
      • we first receive all the collateral and asset tokens name from [fact_hourly_token_prices] tabel,
      • In the [ethereum_core.fact_event_logs] table we find the list of events on Bentbox where [event_name = 'LogDeploy']`
      • separate the collateral and assets from the [event_inputs: cloneAddress]
      • Then we receive and count the addresses based on LogRepay and LogBorrow functions that have been transferred and [borrowed].
    Loading...
    Loading...
    Loading...

    In the charts above you can see a list of the top 5 Kashi Pairs based on the number of loans generated

    • Pair kmxSUSHI/DAI-LINK It has the largest number of generated loans, followed by kmxSUSHI/USDC-LINK

    2 ---> The total available for lending (in USD)

    • In this section:
      • we first receive all the collateral and asset tokens name from [fact_hourly_token_prices] tabel,
      • In the [ethereum_core.fact_event_logs] table we find the list of events on Bentbox where [event_name = 'LogDeploy']`
      • separate the collateral and assets from the [event_inputs: cloneAddress]
      • Then we receive and count the addresses based on LogRemoveAsset, LogRemoveCollateral, LogAddAsset and LogAddCollateral functions that have been transferred.
      • For find total available for lending (in USD) we sum all available asset on the [plus for LogAddAsset function and minus for LogRemoveAsset function]
    Loading...
    Loading...

    In the charts above you can see a list of the top 5 Kashi Pairs based on total available for lending (in USD)

    • Pair kmWBTC/DAI-LINK It has the largest available for lending , followed by kmWETH/DAI-LINK

    3 ---> Total collateral deposited (in USD)

    • In this section:
      • we first receive all the collateral and asset tokens name from [fact_hourly_token_prices] tabel,
      • In the [ethereum_core.fact_event_logs] table we find the list of events on Bentbox where [event_name = 'LogDeploy']`
      • separate the collateral and assets from the [event_inputs: cloneAddress]
      • Then we receive and count the addresses based on LogRemoveAsset, LogRemoveCollateral, LogAddAsset and LogAddCollateral functions that have been transferred.
      • For find Total collateral deposited (in USD) we sum all available asset on the [plus for LogAddCollateral function and minus for LogRemoveCollateral function]
    Loading...
    Loading...

    In the charts above you can see a list of the top 5 Kashi Pairs based on total collateral deposited (in USD)

    • Pair kmWBTC/DAI-LINK It has the largest collateral deposited, followed by kmWETH/DAILINK