Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: factorial tvl #13192

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

bhjiwonoh
Copy link

NOTE

Please enable "Allow edits by maintainers" while putting up the PR.


  • If you would like to add a volume adapter please submit the PR here.
  • If you would like to add a liquidations adapter, please refer to this readme document for details.
  1. Once your adapter has been merged, it takes time to show on the UI. If more than 24 hours have passed, please let us know in Discord.
  2. Sorry, We no longer accept fetch adapter for new projects, we prefer the tvl to computed from blockchain data, if you have trouble with creating a the adapter, please hop onto our discord, we are happy to assist you.
  3. Please fill the form below only if the PR is for listing a new protocol else it can be ignored/replaced with reason/details about the PR
  4. For updating listing info It is a different repo, you can find your listing in this file: https://github.com/DefiLlama/defillama-server/blob/master/defi/src/protocols/data2.ts, you can edit it there and put up a PR
  5. Do not edit/push package-lock.json file as part of your changes, we use lockfileVersion 2, and most use v1 and using that messes up our CI
  6. No need to go to our discord and announce that you've created a PR, we monitor all PRs and will review it asap

Name (to be shown on DefiLlama):

Factorial

Twitter Link:

https://x.com/FactorialFi

List of audit links if any:

1 done
1 progressing
I will update the audit document link later

Website Link:

https://factorial.finance/

Logo (High resolution, will be shown with rounded borders):

Factorial-logo

Current TVL:

--- ton ---
USDT 127.24 k
TON 31.42 k
Total: 158.66 k

--- tvl ---
USDT 127.24 k
TON 31.42 k
Total: 158.66 k

------ TVL ------
ton 158.66 k
total 158.66 k

Treasury Addresses (if the protocol has treasury)
Chain:

Ton

Coingecko ID (so your TVL can appear on Coingecko, leave empty if not listed): (https://api.coingecko.com/api/v3/coins/list)
Coinmarketcap ID (so your TVL can appear on Coinmarketcap, leave empty if not listed): (https://api.coinmarketcap.com/data-api/v3/map/all?listing_status=active,inactive,untracked&start=1&limit=10000)
Short Description (to be shown on DefiLlama):

Factorial is built on The Open Network (TON), utilizing its parallelism and scalability to provide a decentralized, permissionless lending solution

Token address and ticker if any:
Category (full list at https://defillama.com/categories) *Please choose only one:

[Lending]

Oracle Provider(s): Specify the oracle(s) used (e.g., Chainlink, Band, API3, TWAP, etc.):

Redstone

Implementation Details: Briefly describe how the oracle is integrated into your project:
Documentation/Proof: Provide links to documentation or any other resources that verify the oracle's usage:
forkedFrom (Does your project originate from another project):
methodology (what is being counted as tvl, how is tvl being calculated):
Github org/user (Optional, if your code is open source, we can track activity):

@llamabutler
Copy link

The adapter at projects/factorial exports TVL:

ton                       158.60 k

total                    158.60 k 

const amountIdx = 4;
const assets = result[assetDicIdx][_kv]["elements"];
const amount = assets[tonIdx]["tuple"]["elements"][amountIdx];
const basicPoolTonAmount = amount["number"]["number"];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the pooled amount doesnt include ton balance on the contract?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's included in the contract but not properly tracked when using existing helpers.
I separately extracted only the TON asset from the contract using the get_method(get_pool_data) interface and added it.

@g1nt0ki g1nt0ki self-assigned this Jan 21, 2025
@bhjiwonoh
Copy link
Author

@g1nt0ki The existing sumOfToken helper is designed to display wallet balances. However, in lending protocols like ours, this approach doesn’t seem suitable. It would be appeared as the remaining jettons have decreased when borrowing occurs. What do you think?

If you agree, �I will update it to extract and display the supplied jetton information from the contract state. (The PR will be submitted soon, so please continue with the listing work without any delays)

@bhjiwonoh
Copy link
Author

@g1nt0ki I have another question. Since we are dealing with lending, we want to display the borrowed amount separately from TVL. If we return the value with the borrowed key, will it be reflected?

In helper/compound.js, they have same concept:

function compoundExports(comptroller, cether, cetheEquivalent = nullAddress, { blacklistedTokens = [], abis = {}, } = {}) {

@g1nt0ki
Copy link
Member

g1nt0ki commented Jan 24, 2025

hi @bhjiwonoh you can check our evaa implementation, for tvl, we pull token balance. For borrowed, we query from smart contract: https://github.com/DefiLlama/DefiLlama-Adapters/blob/main/projects/evaa/index.js

https://defillama.com/protocol/evaa-protocol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants