# UpdateGlobalVar

### Parameter

Parameter is an interface which contains 5 types of struct

#### type ParameterFeeAccount

```go
type ParameterFeeAccount struct {
	AccountId AccountId
}
```

This parameter is used to modify the collect-fee account.

#### type ParameterInsuranceFundAccount

```go
type ParameterInsuranceFundAccount struct {
	AccountId AccountId
}
```

This parameter is used to modify the insurance fund account.

#### type ParameterMarginInfo

```go
type ParameterMarginInfo struct {
	MarginId MarginId
	TokenId  TokenId
	Ratio    uint8
}
```

This parameter is used to modify the margin info in the specified index.

#### type ParameterFundingInfos

```go
type ParameterFundingInfos struct {
	Infos []FundingInfo
}
```

This parameter is used to ppdate the funding rates to accumulated funding rates of the Global Vars for all position(contract pair) in this period.

**type FundingInfo**

```go
type FundingInfo struct {
	PairId      PairId
	Price       BigUint
	FundingRate int16
}
```

#### type ParameterContractInfo

```go
type ParameterContractInfo struct {
	PairId                PairId
	Symbol                string
	InitialMarginRate     uint16
	MaintenanceMarginRate uint16
}
```

This parameter is used to modify the info of every perpetual contract pair.

### type UpdateGlobalVarBuilder

```go
type UpdateGlobalVarBuilder struct {
    FromChainId  ChainId
    SubAccountId SubAccountId
    Parameter    Parameter
    SerialId     uint64
}
```

The builder is used to build new [UpdateGlobalVar](#type-updateglobalvar) transaction.

### type UpdateGlobalVar

[UpdateGlobalVar](/developer/api-and-sdk/transaction/update_global_var.md) transaction type, it's a opaque data type.

#### func NewUpdateGlobalVar

```go
func NewUpdateGlobalVar(builder UpdateGlobalVarBuilder) *UpdateGlobalVar
```

Create a new [UpdateGlobalVar](#type-updateglobalvar) transaction.

#### func (\*UpdateGlobalVar) GetBytes

```go
func (*UpdateGlobalVar) GetBytes() []uint8
```

Get the encoded bytes to create the L3 signature. See more in [Private Key and Signature](/developer/api-and-sdk/private_key/funding.md)

#### func (\*UpdateGlobalVar) TxHash

```go
func (*UpdateGlobalVar) TxHash() []uint8
```

Get the transaction hash of the transaction.

#### func (\*UpdateGlobalVar) JsonStr

```go
func (*UpdateGlobalVar) JsonStr() string
```

Get the json string of the transaction.

#### func (\*UpdateGlobalVar) IsValid

```go
func (*UpdateGlobalVar) IsValid() bool
```

Check if the transaction is valid or not.

#### func (\*UpdateGlobalVar) ToZklinkTx

```go
func (*UpdateGlobalVar) ToZklinkTx() ZkLinkTx
```

Change the transaction to the [ZkLinkTx](/developer/sdk/changelog/basic_types.md#zklinktx)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zk.link/developer/sdk/changelog/transactions/10-update-global-var.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
