npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@obligate/strukk-sdk

v0.1.8

Published

SDK for Strukk Financial Contracts Platform

Downloads

625

Readme

Strukk Financial Contracts Platform

Strukk is a facilitation platform for establishing automated self-settling financial contracts between issuers and investors. The platform currently supports one type of contract (Strukk.Yield a Barrier Reverse Convertible) with Sol as the underlying asset.

Components

1. Instruct Program

The main Solana program that handles the core functionality of structured products.

Key features:

  • Initialize structured products
  • Handle investor and issuer acceptance
  • Manage payments and settlements
  • Handle defaults

2. Payment Authority BRC Program

A specialized program for Barrier Reverse Convertible (BRC) contracts.

Key features:

  • Initialize BRC contracts
  • Fix payments based on price updates
  • Close BRC contracts

3. Treasury Wallet Program

Manages the issuer's treasury wallet for handling payments.

Key features:

  • Initialize treasury wallets
  • Add and remove withdraw authorizations
  • Handle withdrawals

4. InstructSdk

A TypeScript SDK for interacting with the Instruct, Treasury Wallet, and Payment Authority BRC programs.

Functionality

  1. Contract Initiation:

    • Investor sets desired parameters and requests a quote
    • Issuer provides a quote
    • Coordinator/authority initializes the structured product
    • Investor signs the transaction that includes acceptance and transfers funds to escrow
    • Issuer signs the transaction to accept and issues the structured product receiving the funds from the escrow
    • Fees go to the coordinator/authority
    • Investor receives on-chain confirmation of the claim in the Structured Product account
  2. Final Settlement:

    • At maturity, the payoff is determined by comparing the oracle-provided price with the barrier price
    • Payoff is automatically claimed from the issuer's treasury wallet
    • If the balance is insufficient or payment does not occur for any reason, a default can be triggered
    • Repayments can be done after pay_from_date has passed
    • Default can be triggered after pay_by_date has passed
  3. BRC final fixing calculation:

    • Parameters: Maturity date, Yield (p.a.), Barrier
    • At maturity:
      • If price > barrier: Investor receives principal + coupon in cash
      • If price <= barrier: Investor receives the initial principal amount of SOL at the initial fixing price + coupon in cash

Usage

To interact with the Strukk platform, use the InstructSdk to create and manage structured products, handle investor and issuer actions, and manage payments and settlements.

Development

  1. Set up a Solana development environment
  2. Install dependencies: pnpm install
  3. Build the programs: anchor build
  4. Run tests: anchor test

Note

This README provides an overview of the main components and functionality. For detailed implementation and usage, refer to the individual source files.