@@ -38,6 +38,14 @@ message PoolTrancheConfig {
3838 ];
3939}
4040
41+ // Pool tranche config V1
42+ message PoolTrancheConfigV1 {
43+ // maturity duration in seconds
44+ int64 maturity = 1 ;
45+ // borrow apr permille
46+ uint32 borrow_apr = 2 [(gogoproto.customname ) = "BorrowAPR" ];
47+ }
48+
4149// Pool config
4250message PoolConfig {
4351 // collateral asset metadata
@@ -125,7 +133,7 @@ message PoolConfigV1 {
125133 (gogoproto.nullable ) = false
126134 ];
127135 // tranches
128- repeated PoolTrancheConfig tranches = 7 [(gogoproto.nullable ) = false ];
136+ repeated PoolTrancheConfigV1 tranches = 7 [(gogoproto.nullable ) = false ];
129137 // request fee
130138 cosmos.base.v1beta1.Coin request_fee = 8 [
131139 (gogoproto.nullable ) = false
@@ -147,6 +155,50 @@ message PoolConfigV1 {
147155 bool paused = 14 ;
148156}
149157
158+ // Pool config V2
159+ message PoolConfigV2 {
160+ // collateral asset metadata
161+ AssetMetadata collateral_asset = 1 [(gogoproto.nullable ) = false ];
162+ // lending asset metadata
163+ AssetMetadata lending_asset = 2 [(gogoproto.nullable ) = false ];
164+ // supply cap
165+ string supply_cap = 3 [
166+ (gogoproto.customtype ) = "cosmossdk.io/math.Int" ,
167+ (gogoproto.nullable ) = false
168+ ];
169+ // borrow cap
170+ string borrow_cap = 4 [
171+ (gogoproto.customtype ) = "cosmossdk.io/math.Int" ,
172+ (gogoproto.nullable ) = false
173+ ];
174+ // minimum amount to be borrowed
175+ string min_borrow_amount = 5 [
176+ (gogoproto.customtype ) = "cosmossdk.io/math.Int" ,
177+ (gogoproto.nullable ) = false
178+ ];
179+ // maximum amount to be borrowed
180+ string max_borrow_amount = 6 [
181+ (gogoproto.customtype ) = "cosmossdk.io/math.Int" ,
182+ (gogoproto.nullable ) = false
183+ ];
184+ // tranches
185+ repeated PoolTrancheConfigV1 tranches = 7 [(gogoproto.nullable ) = false ];
186+ // request fee
187+ cosmos.base.v1beta1.Coin request_fee = 8 [
188+ (gogoproto.nullable ) = false
189+ ];
190+ // origination fee factor permille
191+ uint32 origination_fee_factor = 9 ;
192+ // reserve factor permille
193+ uint32 reserve_factor = 10 ;
194+ // maximum ltv percent
195+ uint32 max_ltv = 11 ;
196+ // liquidation ltv percent
197+ uint32 liquidation_threshold = 12 ;
198+ // indicates if the pool is paused
199+ bool paused = 13 ;
200+ }
201+
150202// Pool tranche
151203message PoolTranche {
152204 // maturity duration
@@ -237,6 +289,40 @@ message LendingPoolV1 {
237289 PoolStatus status = 11 ;
238290}
239291
292+ message LendingPoolV2 {
293+ string id = 1 ;
294+ cosmos.base.v1beta1.Coin supply = 2 [
295+ (gogoproto.nullable ) = false
296+ ];
297+ string available_amount = 3 [
298+ (gogoproto.customtype ) = "cosmossdk.io/math.Int" ,
299+ (gogoproto.nullable ) = false
300+ ];
301+ string borrowed_amount = 4 [
302+ (gogoproto.customtype ) = "cosmossdk.io/math.Int" ,
303+ (gogoproto.nullable ) = false
304+ ];
305+ string total_borrowed = 5 [
306+ (gogoproto.customtype ) = "cosmossdk.io/math.Int" ,
307+ (gogoproto.nullable ) = false
308+ ];
309+ string reserve_amount = 6 [
310+ (gogoproto.customtype ) = "cosmossdk.io/math.Int" ,
311+ (gogoproto.nullable ) = false
312+ ];
313+ string total_reserve = 7 [
314+ (gogoproto.customtype ) = "cosmossdk.io/math.Int" ,
315+ (gogoproto.nullable ) = false
316+ ];
317+ cosmos.base.v1beta1.Coin total_ytokens = 8 [
318+ (gogoproto.nullable ) = false ,
319+ (gogoproto.customname ) = "TotalYTokens"
320+ ];
321+ repeated PoolTranche tranches = 9 [(gogoproto.nullable ) = false ];
322+ PoolConfigV2 config = 10 [(gogoproto.nullable ) = false ];
323+ PoolStatus status = 11 ;
324+ }
325+
240326// Loan Status
241327enum LoanStatus {
242328 // Unspecified
@@ -476,6 +562,54 @@ message LoanV3 {
476562 LoanStatus status = 25 ;
477563}
478564
565+ message LoanV4 {
566+ string vault_address = 1 ; // id
567+ string borrower = 2 ;
568+ string borrowerPubKey = 3 ;
569+ string borrowerAuthPubKey = 4 ;
570+ string dcm = 5 [(gogoproto.customname ) = "DCM" ];
571+ int64 maturity_time = 6 ;
572+ int64 final_timeout = 7 ;
573+ string pool_id = 8 ;
574+ cosmos.base.v1beta1.Coin borrow_amount = 9 [(gogoproto.nullable ) = false ];
575+ cosmos.base.v1beta1.Coin request_fee = 10 [(gogoproto.nullable ) = false ];
576+ string origination_fee = 11 [
577+ (gogoproto.customtype ) = "cosmossdk.io/math.Int" ,
578+ (gogoproto.nullable ) = false
579+ ];
580+ string interest = 12 [
581+ (gogoproto.customtype ) = "cosmossdk.io/math.Int" ,
582+ (gogoproto.nullable ) = false
583+ ];
584+ string protocol_fee = 13 [
585+ (gogoproto.customtype ) = "cosmossdk.io/math.Int" ,
586+ (gogoproto.nullable ) = false
587+ ];
588+ int64 maturity = 14 ;
589+ uint32 borrow_apr = 15 [(gogoproto.customname ) = "BorrowAPR" ];
590+ string start_borrow_index = 16 [
591+ (cosmos_proto.scalar ) = "cosmos.Dec" ,
592+ (gogoproto.customtype ) = "cosmossdk.io/math.LegacyDec" ,
593+ (gogoproto.nullable ) = false
594+ ];
595+ string liquidation_price = 17 [
596+ (cosmos_proto.scalar ) = "cosmos.Dec" ,
597+ (gogoproto.customtype ) = "cosmossdk.io/math.LegacyDec" ,
598+ (gogoproto.nullable ) = false
599+ ];
600+ uint64 dlc_event_id = 18 ;
601+ repeated Authorization authorizations = 19 [(gogoproto.nullable ) = false ];
602+ string collateral_amount = 20 [
603+ (gogoproto.customtype ) = "cosmossdk.io/math.Int" ,
604+ (gogoproto.nullable ) = false
605+ ];
606+ uint64 liquidation_id = 21 ;
607+ Referrer referrer = 22 ;
608+ google.protobuf.Timestamp create_at = 23 [(gogoproto.nullable ) = false , (gogoproto.stdtime ) = true ];
609+ google.protobuf.Timestamp disburse_at = 24 [(gogoproto.nullable ) = false , (gogoproto.stdtime ) = true ];
610+ LoanStatus status = 25 ;
611+ }
612+
479613// Referrer defines the referrer
480614message Referrer {
481615 // Optional name
0 commit comments