Skip to content

feat: add new skill to bucket sdk#122

Open
ZouBadCode wants to merge 5 commits intomainfrom
sync-constructor-skill
Open

feat: add new skill to bucket sdk#122
ZouBadCode wants to merge 5 commits intomainfrom
sync-constructor-skill

Conversation

@ZouBadCode
Copy link
Copy Markdown
Contributor

Summary

Add a Copilot Skill for the Bucket Protocol SDK (bucket-sdk). This gives GitHub Copilot deep, structured knowledge of the SDK so it can accurately assist with CDP transactions, PSM swaps, saving pool operations, oracle queries, flash mints, and leverage patterns — without hallucinating API signatures or misunderstanding protocol mechanics.

The skill is strictly additive (4 new files) and does not modify any source code.


Changes

SKILL.md

Main integration guide consumed by Copilot. Covers:

  • Installation & peer dependencies
  • Quick start with BucketClient.initialize() and buildManagePositionTransaction
  • Key concepts:
    • PTB builder pattern
    • coinWithBalance lazy resolver
    • decimal table
    • Account vs EOA
  • Full API reference for all query methods and transaction builders:
    • CDP
    • Saving
    • PSM
    • Flash Mint
  • Composing multiple operations in a single PTB
    (e.g. PSM swap → saving deposit)
  • One-click leverage pattern via flash mint
  • Complete low-level PTB helper listing:
    • price
    • CDP internals
    • pool calls
    • object refs
    • account helpers
  • All public types:
    • VaultInfo
    • PositionInfo
    • SavingPoolInfo
    • PsmPoolInfo
    • SavingInfo
    • FlashMintInfo
  • 9 common gotchas:
    • async vs sync builders
    • zero coin cleanup
    • mint caps
    • full liquidation
    • etc.

coin-types.md

Reference table of all mainnet coin type strings organized by category:

  • USDB stablecoin
  • 16 basic collateral types:
    • SUI, BTC, ETH, WAL, USDC, USDT, haSUI, CERT, afSUI, SCA, BUCK, DEEP, XBTC, WBTC, UP_USD, XAUM
  • 10 derivative collateral types:
    • 7 sCoin
    • 2 gCoin
    • 1 BFBTC
    • (with underlying mappings)
  • PSM pool coins
  • Saving pool LP types
  • Common reward types
  • BUT protocol token

protocol-concepts.md

Protocol-level decision guide covering:

  • CDP mechanics:

    • CR formula
    • liquidation price calculation
    • MCR
    • interest model (no borrow fee)
  • Liquidation:

    • full seizure
    • flash-mint-based execution
    • bad-debt backstop
  • USDB peg:

    • PSM 1:1 swaps
    • arbitrage conditions (upward/downward depeg)
    • PSM vs CDP decision table
  • Two-layer saving system:

    • Layer 1: sUSDB / BSR
    • Layer 2: sUSDB Savings Pool rewards
  • Flash mint mechanics and use cases

  • Leverage patterns:

    • one-click (flash mint)
    • manual looping
  • Account system:

    • EOA vs Account objects

query-state.ts

Diagnostic script for querying live on-chain state.

Outputs include:

  • USDB supply
  • Oracle prices
  • Vault stats
  • PSM pool balances
  • Saving pool info
  • Flash mint fees
  • Supported collateral types

Runnable via:

npx tsx skills/bucket-sdk/scripts/query-state.ts

zasper32171 and others added 3 commits March 12, 2026 04:35
- Add await to all config-dependent methods (getConfig, getAllCollateralTypes,
  getUsdbCoinType, getAggregatorObjectInfo, getVaultObjectInfo, etc.)
- Add await to build methods (buildClosePositionTransaction,
  buildDepositToSavingPoolTransaction, buildWithdrawFromSavingPoolTransaction,
  buildClaimSavingRewardsTransaction, flashMint, flashBurn)
- Add await to CDP helpers (debtorRequest, checkUpdatePositionRequest,
  updatePosition, checkUpdatePositionResponse, newAccountRequest)
- Document sync constructor as alternative to initialize()
- Update API Reference section for new constructor signature

Made-with: Cursor
@ZouBadCode ZouBadCode requested a review from allen-hsu March 19, 2026 04:36
Base automatically changed from sync-constructor to main March 20, 2026 06:31
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