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

EPIC: Centrifuge SDK #3

Open
sophialittlejohn opened this issue Oct 11, 2024 · 0 comments
Open

EPIC: Centrifuge SDK #3

sophialittlejohn opened this issue Oct 11, 2024 · 0 comments
Labels

Comments

@sophialittlejohn
Copy link
Collaborator

sophialittlejohn commented Oct 11, 2024

Centrifuge SDK

MVP Scope

  • transfer tranche tokens
  • request deposit

First steps

  1. discover Viem - how to connect to node --> create repo outside of monorepo centrifuge-sdk
  2. deployment setup --> ask Guillermo
  3. new multicall not linked to etherjs - maybe viem has an implementation? viem has a multicall implementation
  4. base class that provides default, accepts signer as arg, be multichain/chain agnostic for fetching, chain-specific for transactions, explore using observables in SDK and expose promise AND observable API for users
  5. caching layer in SDK - learn how to leverage RxJs for caching. Learn from useCentrifugeQuery shareReplayWithDelayedReset
  6. Subquery integration --> are subscriptions possible?
  7. Utilities: CurrencyBalance, Rate, Tokens etc ideally without BN.js instead using native BigInt
  8. Docs!!
  9. Tests - ideally TDD. Figure out which test runners to use and how to fork chain for best results (Tenderly)

Questions

  • how do we query pools without polkadot connection? Should we use centrifuge-js to query pools under the hood?
  • how do we want to handle onboarding
  • do we want to integrate IPFS pinning and reading into SDK?

TBD

  • Adopt new terminology (share pools instead of pools, subscriptions instead of investments, loans?)
  • Set up sync where new info is shared about upcoming changes

Protocol specs

SDK specs

We want each type to be a class with getters and setter.
Group by: Entity (Loan, Pool, AccountPermissions)

// borrow
const pool = await cent.getPool(poolId) // returns type Pool that contains methods to fetch anything pool related
const loans = await pool.getLoans() // returns type Loan[] where each loan contains methods for anything loan related
// examples
const loan = loans.find(...) 
await loan.borrow(amount)
await loan.repay(amount)
@onnovisser onnovisser transferred this issue from centrifuge/apps Oct 16, 2024
@onnovisser onnovisser added the SDK label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants