// {type:class}
// {direction:topDown}
[trait-vault|+(get-balance (trait-sip-010) (response unit uint)); +(get-balances () (response (list 2000 (tuple string-ascii uint)) uint)); +(flash-loan (trait-flash-loan-user trait-sip-010 trait-sip-010 (optional trait-sip-010) uint uint (optional unit)) (response bool uint)); +(transfer-to-vault (uint principal principal trait-sip-010 (optional buff)) (response bool int))]
[trait-sip-010| +(transfer (uint principal principal) (response bool uint)); +(get-name () (response string-ascii uint)); + get-symbol () (response string-ascii uint)); +(get-decimals () (response uint uint)); +(get-balance-of (principal) (response uint uint)); +(get-total-supply () (response uint uint)); +(get-token-uri () (response string-utf8 uint))]
[trait-pool-token| +(mint principal uint (response bool uint)); +(burn principal uint (response bool uint))]
[trait-yield-token| +(get-token () (response principal uint)); +(get-expiry () (response uint uint))]
[trait-flash-loan-user|+(execute (trait-sip-010 trait-sip-010 (optional trait-sip-010) uint uint (optional unit)) (response bool uint))] 
[fixed-weight-pool| +(get-pool-count () (response uint uint)); +(get-pool-contracts (uint) (response (tuple principal principal uint uint))); +(get-pools () (response (list 2000 (tuple principal principal uint uint)) uint)); +(get-pool-details (trait-sip-010 trait-sip-010 uint uint) (response (tuple uint uint uint uint uint principal principal) uint)); +(get-balances (trait-sip-010 trait-sip-010 uint uint) (response (list 2 uint) uint); +(create-pool (trait-sip-010 trait-sip-010 uint uint trait-pool-token trait-vault uint uint) (response bool uint)); +(add-to-position (trait-sip-010 trait-sip-010 uint uint trait-pool-token trait-vault uint uint) (response bool uint)); +(reduce-position (trait-sip-010 trait-sip-010 uint uint trait-pool-token trait-vault uint) (response bool uint)); +(swap-x-for-y (trait-sip-010 trait-sip-010 uint uint trait-vault uint) (response (list 2 uint) uint)); +(swap-y-for-x (trait-sip-010 trait-sip-010 uint uint trait-vault uint) (response (list 2 uint) uint)); +(set-fee-to-address (trait-sip-010 trait-sip-010 uint uint principal) (response bool uint)); +(get-fee-to-address (trait-sip-010 trait-sip-010 uint uint) (response principal uint)); +(get-fees (trait-sip-010 trait-sip-010 uint uint) (response (list 2 uint) uint)); +(collect-fees (trait-sip-010 trait-sip-010 uint uint) (response (list 2 uint) uint)); +(get-y-given-x (trait-sip-010 trait-sip-010 uint uint uint) (response uint uint)); +(get-x-given-y (trait-sip-010 trait-sip-010 uint uint uint) (response uint uint)); +(get-x-given-price (trait-sip-010 trait-sip-010 uint uint uint) (response uint uint)); +(get-token-given-position (trait-sip-010 trait-sip-010 uint uint uint uint) (response (tuple uint uint) uint)); +(get-position-given-mint (trait-sip-010 trait-sip-010 uint uint uint) (response (tuple uint uint) uint)); +(get-position-given-burn (trait-sip-010 trait-sip-010 uint uint uint) (response (tuple uint uint) uint))]
[collateral-rebalancing-pool| -(erf (uint) (response uint uint)); +(get-pool-count () (response uint uint)); +(get-pool-contracts (uint) (response (tuple principal principal uint))); +(get-pools () (response (list 2000 (tuple principal principal uint)) uint)); +(get-pool-details (trait-sip-010 trait-sip-010 uint) (response (tuple uint uint uint uint uint principal principal uint uint) uint)); +(get-balances (trait-sip-010 trait-sip-010 uint) (response (list 2 uint) uint); +(get-weight-x (trait-sip-010 trait-sip-010 uint) (response uint uint)); +(create-pool (trait-sip-010 trait-sip-010 uint trait-yield-token trait-vault uint uint) (response bool uint)); +(add-to-position (trait-sip-010 trait-sip-010 uint trait-yield-token trait-vault uint uint) (response bool uint)); +(reduce-position (trait-sip-010 trait-sip-010 uint trait-yield-token trait-vault uint) (response bool uint)); +(swap-x-for-y (trait-sip-010 trait-sip-010 uint trait-vault uint) (response (list 2 uint) uint)); +(swap-y-for-x (trait-sip-010 trait-sip-010 uint trait-vault uint) (response (list 2 uint) uint)); +(set-fee-to-address (trait-sip-010 trait-sip-010 uint principal) (response bool uint)); +(get-fee-to-address (trait-sip-010 trait-sip-010 uint) (response principal uint)); +(get-fees (trait-sip-010 trait-sip-010 uint) (response (list 2 uint) uint)); +(collect-fees (trait-sip-010 trait-sip-010 uint) (response (list 2 uint) uint)); +(get-y-given-x (trait-sip-010 trait-sip-010 uint uint) (response uint uint)); +(get-x-given-y (trait-sip-010 trait-sip-010 uint uint) (response uint uint)); +(get-x-given-price (trait-sip-010 trait-sip-010 uint uint) (response uint uint)); +(get-token-given-position (trait-sip-010 trait-sip-010 uint uint uint) (response (tuple uint uint) uint)); +(get-position-given-mint (trait-sip-010 trait-sip-010 uint uint) (response (tuple uint uint) uint)); +(get-position-given-burn (trait-sip-010 trait-sip-010 uint uint) (response (tuple uint uint) uint))]
[yield-token-pool| +(get-pool-count () (response uint uint)); +(get-pool-contracts (uint) (response (tuple principal))); +(get-pools () (response (list 2000 (tuple principal)) uint)); +(get-pool-details (trait-sip-010) (response (tuple uint principal uint uint uint uint principal principal) uint)); +(get-balances (trait-sip-010) (response (list 2 uint) uint); +(create-pool (trait-sip-010 trait-sip-010 trait-pool-token trait-vault uint uint) (response bool uint)); +(add-to-position (trait-sip-010 trait-sip-010 trait-pool-token trait-vault uint uint) (response bool uint)); +(reduce-position (trait-sip-010 trait-sip-010 trait-pool-token trait-vault uint) (response bool uint)); +(swap-x-for-y (trait-sip-010 trait-sip-010 trait-vault uint) (response (list 2 uint) uint)); +(swap-y-for-x (trait-sip-010 trait-sip-010 trait-vault uint) (response (list 2 uint) uint)); +(set-fee-to-address (trait-sip-010 principal) (response bool uint)); +(get-fee-to-address (trait-sip-010) (response principal uint)); +(get-fees (trait-sip-010) (response (list 2 uint) uint)); +(collect-fees (trait-sip-010) (response (list 2 uint) uint)); +(get-y-given-x (trait-sip-010 uint) (response uint uint)); +(get-x-given-y (trait-sip-010 uint) (response uint uint)); +(get-x-given-price (trait-sip-010 uint) (response uint uint)); +(get-token-given-position (trait-sip-010 uint) (response (tuple uint uint) uint)); +(get-position-given-mint (trait-sip-010 uint) (response (tuple uint uint) uint)); +(get-position-given-burn (trait-sip-010 uint) (response (tuple uint uint) uint))]
[weighted-equation| +(get-y-given-x (uint uint uint uint uint) (response uint uint)); +(get-x-given-y (uint uint uint uint uint) (response uint uint)); +(get-x-given-price (uint uint uint uint uint) (response uint uint)); +(get-token-given-position (uint uint uint uint uint uint uint) (response (tuple uint uint) uint)); +(get-position-given-mint (uint uint uint uint uint uint) (response (tuple uint uint) uint)); +(get-position-given-burn (uint uint uint uint uint uint) (response (tuple uint uint) uint))]
[yield-token-equation| +(get-y-given-x (uint uint uint uint) (response uint uint)); +(get-x-given-y (uint uint uint uint) (response uint uint)); +(get-x-given-price (uint uint uint uint) (response uint uint)); +(get-token-given-position (uint uint uint uint uint uint) (response (tuple uint uint) uint)); +(get-position-given-mint (uint uint uint uint uint) (response (tuple uint uint) uint)); +(get-position-given-burn (uint uint uint uint uint) (response (tuple uint uint) uint))]
[trait-oracle|+(get-price (string-ascii string-ascii) (response uint uint))]
[math-fixed-point| +(scale-up (uint) (response uint uint)); +(scale-down (uint) (response uint uint)); +(add-fixed (uint uint) (response uint uint)); +(sub-fixed (uint uint) (response uint uint)); +(mul-down (uint uint) (response uint uint)); +(mul-up (uint uint) (response uint uint)); +(div-down (uint uint) (response uint uint)); +(div-up (uint uint) (response uint uint)); +(pow-down (uint uint) (response uint uint)); +(pow-up (uint uint) (response uint uint))]
[math-log-exp| -(ln-priv (int) (response int uint)); -(accumulate_division ((tuple int int bool) (tuple int int)) (response (tuple int int) uint)); -(rolling_sum_div (int (tuple int int int)) (response (tuple int int int) uint)); -(pow-priv (uint uint) (response int uint)); -(exp-pos (int) (response int uint)); -(accumulate_product ((tuple int int bool) (tuple int int)) (response (tuple int int) uint)); -(rolling_div_sum (int (tuple int int int)) (response (tuple int int int) uint)); +(pow-fixed (uint uint) (response uint uint)); +(exp-fixed (int) (response int uint)); +(log-fixed (int int) (response int)); +(ln-fixed (int) (response int uint))]

[yield-token-equation]<-[yield-token-pool]
[weighted-equation]<-[fixed-weight-pool]
[weighted-equation]<-[collateral-rebalancing-pool]

[trait-oracle]<-[collateral-rebalancing-pool]

[trait-sip-010]^-.-[trait-pool-token]
[trait-sip-010]<-[trait-flash-loan-user]
[trait-sip-010]<-[trait-vault]
[trait-sip-010]<-[fixed-weight-pool]
[trait-sip-010]<-[collateral-rebalancing-pool]
[trait-sip-010]<-[yield-token-pool]

[trait-pool-token]^-.-[trait-yield-token]
[trait-pool-token]<-[fixed-weight-pool]
[trait-pool-token]<-[yield-token-pool]

[trait-yield-token]<-[collateral-rebalancing-pool]
[trait-yield-token]<-[yield-token-pool]

[trait-flash-loan-user]<-[trait-vault]

[trait-vault]<-[yield-token-pool]
[trait-vault]<-[fixed-weight-pool]
[trait-vault]<-[collateral-rebalancing-pool]

[math-log-exp]<-[math-fixed-point]
[math-fixed-point]<-[weighted-equation]
[math-fixed-point]<-[yield-token-equation]
[math-fixed-point]<-[yield-token-pool]
[math-fixed-point]<-[fixed-weight-pool]
[math-fixed-point]<-[collateral-rebalancing-pool]