Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
kakucodes committed Feb 29, 2024
0 parents commit 630393d
Show file tree
Hide file tree
Showing 9 changed files with 53,075 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
compounds_query_results
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Gas Stats Calculator

Script for evaluating gas usage of the ymos junostake outpost.

To run it yourself you would execute the `store_compoundings.sh` script which will store the logs of the compoundings that have occured so far. at time of writing the shell script generates 229 json files.

The last step is to `npm i && npm start` to run the ts script which will calculate the stats and output them to the console.

at time of writing the results look as such

```json
{
"mean": "13372200.000 JUNO. (1,002,915 gas)",
"median": "11421786.667 JUNO. (856,634 gas)",
"lowest": "1609026.667 JUNO. (120,677 gas)",
"highest": "67080440.000 JUNO. (5,031,033 gas)",
"totalCount": 11400,
"totalGasUsed": "152443125453.333 JUNO. (11,433,234,409 gas)"
}
```
252 changes: 252 additions & 0 deletions compounds.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
export interface CompoundResp {
total_count: string;
count: string;
page_number: string;
page_total: string;
limit: string;
txs: TxElement[];
}

export interface TxElement {
height: string;
txhash: string;
codespace: string;
code: number;
data: string;
raw_log: string;
logs: Log[];
info: string;
gas_wanted: string;
gas_used: string;
tx: TxTx;
timestamp: Date;
events: TxEvent[];
}

export interface TxEvent {
type: Type;
attributes: PurpleAttribute[];
}

export interface PurpleAttribute {
key: AttributeKey;
value: string;
index: boolean;
}

export enum AttributeKey {
AccSeq = "acc_seq",
Action = "action",
Amount = "amount",
Amount0 = "amount_0",
AskAsset = "ask_asset",
Asset = "asset",
AuthzMsgIndex = "authz_msg_index",
CommissionAmount = "commission_amount",
ContractAddress = "_contract_address",
DAO = "dao",
Delegator = "delegator",
Fee = "fee",
FeePayer = "fee_payer",
Grantee = "grantee",
Granter = "granter",
Lottery = "lottery",
Module = "module",
NewShares = "new_shares",
OfferAmount = "offer_amount",
OfferAsset = "offer_asset",
Payouts = "payouts",
ProtocolFeeAmount = "protocol_fee_amount",
Receiver = "receiver",
Recipient = "recipient",
ReturnAmount = "return_amount",
Sender = "sender",
Signature = "signature",
Spender = "spender",
SpreadAmount = "spread_amount",
Status = "status",
Subaction = "subaction",
Tickets = "tickets",
ToAddress = "to_address",
Validator = "validator",
WithdrawAddress = "withdraw_address",
}

export enum Type {
CoinReceived = "coin_received",
CoinSpent = "coin_spent",
Delegate = "delegate",
Execute = "execute",
Message = "message",
PayoutFeeshare = "payout_feeshare",
SetWithdrawAddress = "set_withdraw_address",
Transfer = "transfer",
Tx = "tx",
WASM = "wasm",
WASMAmountAutomated = "wasm-amount_automated",
WASMDAOStake = "wasm-dao_stake",
WASMDelegate = "wasm-delegate",
WASMGelottoLottery = "wasm-gelotto_lottery",
WASMSendTokens = "wasm-send_tokens",
WithdrawRewards = "withdraw_rewards",
}

export interface Log {
msg_index: number;
log: string;
events: LogEvent[];
}

export interface LogEvent {
type: Type;
attributes: FluffyAttribute[];
}

export interface FluffyAttribute {
key: AttributeKey;
value: string;
}

export interface TxTx {
"@type": TxType;
body: Body;
auth_info: AuthInfo;
signatures: string[];
}

export enum TxType {
CosmosTxV1Beta1Tx = "/cosmos.tx.v1beta1.Tx",
}

export interface AuthInfo {
signer_infos: SignerInfo[];
fee: Fee;
tip: null;
}

export interface Fee {
amount: Amount[];
gas_limit: string;
payer: string;
granter: string;
}

export interface Amount {
denom: DenomEnum;
amount: string;
}

export enum DenomEnum {
Ujuno = "ujuno",
}

export interface SignerInfo {
public_key: PublicKey;
mode_info: ModeInfo;
sequence: string;
}

export interface ModeInfo {
single: Single;
}

export interface Single {
mode: Mode;
}

export enum Mode {
SignModeDirect = "SIGN_MODE_DIRECT",
}

export interface PublicKey {
"@type": PublicKeyType;
key: PublicKeyKey;
}

export enum PublicKeyType {
CosmosCryptoSecp256K1PubKey = "/cosmos.crypto.secp256k1.PubKey",
}

export enum PublicKeyKey {
Ao5Or9WLFO2G7FBHPJh0OBlEizYIVjBdRc5Mww2P2LB = "Ao5or9wLFO2G7FBHpJh0o+BlEizYIVjBdRc5mww2p2Lb",
}

export interface Body {
messages: Message[];
memo: Memo;
timeout_height: string;
extension_options: any[];
non_critical_extension_options: any[];
}

export enum Memo {
YieldmosCOM = "Yieldmos.com",
}

export interface Message {
"@type": MessageType;
sender: string;
contract: Contract;
msg: Msg;
funds: any[];
}

export enum MessageType {
CosmwasmWASMV1MsgExecuteContract = "/cosmwasm.wasm.v1.MsgExecuteContract",
}

export enum Contract {
Juno1Uaf673War8S0Yg25Saa07Rps796R88Dh3Luar54D06Ug8Heqm5Jq4Ccqvv = "juno1uaf673war8s0yg25saa07rps796r88dh3luar54d06ug8heqm5jq4ccqvv",
}

export interface Msg {
compound: Compound;
}

export interface Compound {
user_address: string;
comp_prefs: CompPrefs;
tax_fee: string;
}

export interface CompPrefs {
relative: Relative[];
}

export interface Relative {
amount: string;
destination: Destination;
}

export interface Destination {
token_swap?: TokenSwap;
juno_staking?: JunoStaking;
unallocated?: Unallocated;
send_tokens?: SendTokens;
dao_staking?: string;
gelotto_lottery?: GelottoLottery;
}

export interface GelottoLottery {
lottery: string;
lucky_phrase: number;
}

export interface JunoStaking {
validator_address: string;
}

export interface SendTokens {
address: string;
denom: DenomClass;
}

export interface DenomClass {
native: string;
}

export interface TokenSwap {
target_denom: DenomClass;
}

export interface Unallocated {}
Loading

0 comments on commit 630393d

Please sign in to comment.