Skip to content

Instantly share code, notes, and snippets.

@y2kappa
y2kappa / notes.md
Created March 10, 2022 20:12
Community Forum 10 March

Scaling Hubble

  1. Peg stability
    • The basics:
      • if USDH below peg -> need to create demand
      • if USDH above peg -> need to create supply
    • Before: Redemptions / Burn
      • if USDH below peg 0.95 -> start with 100 UST -> buy 105 USDH
@y2kappa
y2kappa / liquidation_calcs.rs
Last active February 25, 2022 19:56
Liquidations bot hubble
pub fn calc_system_mode(
global_deposited_collateral: &CollateralAmounts,
global_debt: u64,
prices: &TokenPrices,
) -> BorrowResult<(SystemMode, Decimal)> {
let _150 = Decimal::from_percent(150);
let tcr = CollateralInfo::calculate_collateral_value(
global_debt,
global_deposited_collateral,
prices,
@y2kappa
y2kappa / piping.ml
Created March 28, 2021 14:00
OCaml piping
type user = int
type task = {
desc: string;
priority: int;
is_finished: bool;
}
let to_string (t : task) : string =
Printf.sprintf
"Task { desc: %s; priority: %d; is_finished: %b"
@y2kappa
y2kappa / install_packages.sh
Created July 9, 2017 18:21 — forked from luiscape/install_packages.sh
Install Python dependency packages from requirements.txt using conda.
#
# Original solution via StackOverflow:
# http://stackoverflow.com/questions/35802939/install-only-available-packages-using-conda-install-yes-file-requirements-t
#
#
# Install via `conda` directly.
# This will fail to install all
# dependencies. If one fails,
# all dependencies will fail to install.